Input files with multiple record types

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
paweljanowski
Participant
Posts: 6
Joined: Mon Nov 06, 2006 4:08 am
Location: Warsaw, Poland

Input files with multiple record types

Post by paweljanowski »

Hi!
Sorry for this probably stupid question, but what is the easiest way to read data from files with multiple record types. I'd like to read the file (which is tab delimited itself) and the according to the value of the first field pass the input data (record) to separate link. I've planned to use the Sequential File stage to read the data, but the records inside vary in number of columns (and their types, but this is less important) - some of them contain 6 fields and the longest one contains 64.

Thanx in advance.

Regards,

Pawel Janowski
Pawel Janowski
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read it as one long varchar column, then parse out the first column (with FIELD more than likely) and take it from there based on that value.
-craig

"You can never have too many knives" -- Logan Nine Fingers
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Post by asitagrawal »

If you know the maximum number of columns..then specify all those on the columns and select Retain for the Incomplete Column. This you can set in the Columns tab of Output properties for the stage.

So, Depending on the value of the first column, route the data to the desired links..
Share to Learn, and Learn to Share.
paweljanowski
Participant
Posts: 6
Joined: Mon Nov 06, 2006 4:08 am
Location: Warsaw, Poland

Post by paweljanowski »

Thx. :D

Pawel Janowski
Pawel Janowski
Post Reply