Page 1 of 1

File upload

Posted: Mon Sep 21, 2009 11:56 pm
by pavan31081980
Hi

I have a file which has information spiltted into 3 parts.
1. Header
2. Details
3. Trailer

Below is the sample data which i have to load.

97 DSS5320 010209
0169000104584400407079670460000012807550000000000 844
0169000237584400361566050460000002044570000000000 844
0169000238584400361566050460000041927810000000000 844
0169000239584400361566050460000041927810000000000 844
0169000240584400362061660460000001010000000000000 844
0169000241584400362061660460000001010000000000000 844
0169000242584400362061660460000004010000000000000 844
98 000001 00000000000000000000

First line data - starting with 97 is header data
Last line data - starting with 98 is trailer data
Rest of the data is detail data.

Can you please help me in uploading the above data which is coming in file. Please let me know if this can be done thru a single stage.If so, which stage can i use?Else let me know the alternative methods of doing it.Thanks in advance.

Regards,
Pavan

Posted: Tue Sep 22, 2009 2:08 am
by ArndW
This can be done by using the complex flat file stage, which is used for COBOL type record formats such as yours. You can declare multiple record types for header, data, and footer and filter out what you don't require.

Posted: Tue Sep 22, 2009 2:37 am
by ray.wurlod
Another method is to use a Sequential File stage to read each line as a single VarChar field then a Column Import stage or a Transformer stage to parse the different record types.

Posted: Tue Sep 22, 2009 3:26 am
by laknar
Use the Sequential File Stage. Specify first line is column names.
Use the rowcount property to read first N rows.
use before job routine to count the number of rows in a file.
N-1 Pass this value as Rowcount Parameter.