Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 01 Mar 2007 @ 23:30:48 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Multiple record types using mload
 
From:   Fred W Pluebell

If you use VARTEXT, the "Start Position" is effectively ignored. So the following isn't really valid but is interpreted as defining records each containing five fields:

     .LAYOUT test_LAYOUT;
            .FILLER IN_Indicator                        1 VARCHAR(3);
            .FIELD IN_b_a                               3 VARCHAR(2);
            .FIELD IN_c_a                               * VARCHAR(3);

            .FIELD IN_b_b                               3 VARCHAR(3);
            .FIELD IN_c_b                               * VARCHAR(2);

In the special case where you have the same number of fields in each record type (as in the specific example cited), then you are in luck. Just make the individual .FIELD lengths the max of any value, e.g.

     .LAYOUT test_LAYOUT;
            .FILLER IN_Indicator                      * VARCHAR(3);
            .FIELD IN_b                               * VARCHAR(3);
            .FIELD IN_c                               * VARCHAR(3);

MLOAD expects every VARTEXT record to have at least enough delimited fields to match the LAYOUT; "short" records will always cause an error, but records with extra trailing fields/delimiters are accepted (unless you set MATCHLEN=ON). So one possible workaround for dealing with unlike records is to append extra delimiters to the end of every record or at least the short ones. That can be done prior to the MLOAD or "on the fly" using an INMOD.



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023