Fixed formatted import file

 

This topic gives an example of a Field Definition File that describes the fixed formatted file.

  - *********************************************************/      
  - ****            Field Definition File                   */      
  - *********************************************************/      
 - Description: This Field Definition File                     
 - defines the import's file                              */   
 -       (FROMFILE) field start and end positions.       */   
 - *********************************************************/   
 -       (FROMFILE) field start and end positions.       */   
 -FILE MYLIB/MYFILE                                       */   
 field1   1    12   13                                         
 field2  14    24    0                                         
 field3  25    55   56                                         
 field4  78    89   90                                         
 field5 100   109    0                                         
 field6 110   119  120                                         
 field7 121   221    0                                         
 *END                                                          
                                                               
                                               
 The following is a brief explanation of the   
 Field Definition File format:                
                                               
      -     =  Comment line                    
      *END  =  End of definition, this must be included          
                                                             
 Field     Starting     Ending         Null                  
 Name      Position     Position       Character Position    
 _________________________________________________________   
                                                             
  field1   1            12             13                    
  field2   14           24             None                  
  field3   25           55             56                    
  field4   78           89             90                    
  field5  100          109             None                  
  field6  110          119             120                   
  field7  121          221             None                  
                                                             
                                                                                                                                                                           

Field Name

This name is the name of the to-file field name.

Starting Position

This is the starting position for the field in the import file of each record. This is the byte position.

Ending Position

This is the ending position for the field in the import file of each record. This is the byte position.

Null Character Position

This is the position for the NULL value for the field in the import file of each record. The value zero specifies that NULL does not have a value. The value in the import file can be 'Y' or 'N'.

'Y' means the field is NULL. 'N' means the field is not NULL.

Each column must be separated by a blank character.

Each row must be sequentially ordered. An alternative for creating the Field Definition File is using the *COL keyword instead of the actual column names. *COL indicates the positions of the data in the stream file for all the columns in the target files listed in order. The following example shows how to describe fixed formatted files using the *COL keyword:

*COL   1   12  13
*COL  14   24   0
*COL  25   55  56
*COL  78   89  90
*COL 100  109   0
*COL 110  119 120
*COL 121  221   0
*END

 

Parent topic:

Using the Copy From Import File (CPYFRMIMPF) command to copy between different systems