Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 30 Sep 2004 @ 14:39:07 GMT


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


Subj:   Multiloading different length records
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, September 30, 2004 10:32 -->

Hi,

We are trying to Multiload a variable length file into 3 separate tables, details as follows:

File contains one Header, length 22 bytes, starting with char(2) Header ID of '10'.

Detail records can be one of 2 types, some rows are length 564, and others are 599. (1st 2 characters indicate which type).

One Trailer, length 10, starting with char(2) Trailer ID '90'.


We are trying to load the data into 3 separate tables - one Trailer table, and 2 Detail tables, and ignore the Header.

Should we be able to do this in Multiload (without adding a filler to make the rows the same length)? We have all our layouts etc. specified correctly in the script, but are getting the following error:

     14:09:36 UTY4203 Attempted to access out of range input data in field
          'DATARECORD2', file '/account/load/AC1090',record number '3'.

(The file used in the above case had only 1 detail record in it - it appear to have correctly ignored the Header (record 1), and correctly determined what to do with the detail record (record 2 - which began with 'BO'), but the trailer (record 3) is causing difficulty. Why didn't it ignore it if the first 2 characters weren't 'BO'??

Our .Import/Apply statements in this case are shown below:

     .Import Infile @INFILE@  From 2        /* Ignore Header */
       Layout Account
       Format Text
       Apply Ins_Account
           Where DataRecord1 = 'AC';

     .Import Infile @INFILE@  From 2        /* Ignore Header */
       Layout Bonus
       Format Text
       Apply Ins_Bonus
           Where DataRecord1 = 'BO';


     .Import Infile @INFILE@  From 2        /* Ignore Header */
        Layout Trailer
        Format Text
        Apply Ins_Trailer
           Where RecordType = '90';

DataRecord1 and RecordType are both Char(2) and after that the layouts differ.


Please can anyone help???

Thanks.



     
  <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