File upload

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pavan31081980
Participant
Posts: 17
Joined: Sun Mar 19, 2006 5:46 am
Location: vja

File upload

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post 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.
Regards
LakNar
Post Reply