how can I read all three formats from the same sequential fi

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
HariD
Participant
Posts: 15
Joined: Tue Feb 23, 2010 3:14 am
Location: Chennai
Contact:

how can I read all three formats from the same sequential fi

Post by HariD »

I have one text file with 3 different layouts.

content of the file:
the first 5 lines contain header information (layout 1)
line 6 to 20 contains detail record information (layout 2)
line 21 to the end contain trailer information. (layout 3)

how can I read all three formats from the same sequential file?
I want to
read layout 1 and output to dataset 1,
read layout 2 and output to dataset 2,
read layout 3 and output to dataset3.

Can I do that in one job, and avoid all the warnings.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Parallel job (as marked) or server job (as posted)?

Probably the easiest way to do this is to read the file using a single field (data type VarChar) with a Transformer stage executing in sequential mode.

The Transformer stage has three outputs with constraints based on the system variable @INROWNUM.

Code: Select all

@INROWNUM <= 5
@INROWNUM >= 6 AND @INROWNUM <= 20
@INROWNUM >= 21
Parse appropriately using Field() functions or substring (for fixed-width data).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply