Multiple Record Types in sequential files

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
fridge
Premium Member
Premium Member
Posts: 136
Joined: Sat Jan 10, 2004 8:51 am

Multiple Record Types in sequential files

Post by fridge »

Hi , I have a file that has two distinct record types of form

RECT1 field1 field2 field3
RECT2 fielda fieldb

Question is what is the easiest way to read this using PX v7.1 (I know there is CFF stage in 7.5)

I believe I can do something with schemas but am new to this and documentation is a bit unclear - though at least it isnt IBM documentation (yet - Doh!)

Any clues greatfully recieved
bgs
Participant
Posts: 22
Joined: Sat Feb 05, 2005 9:43 pm

Post by bgs »

we also had a similar requirement.we read the records as a single column in a sequential file and depending one the record type we extracted the columns in the transformer.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use a filter stage to seperate and modify stage to change formats.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Import as a single varchar record.

Filter/Transform based on the first set of characters.

Column Export/Transform to split up the columns in a specific format.

Play on.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I would split them up into multiple files using grep.

grep "^1" file >newfile

The ^ matches the begining of a line the 1 is your record type.
Mamu Kim
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Post by benny.lbs »

That is a good way !!!
T42 wrote:Import as a single varchar record.

Filter/Transform based on the first set of characters.

Column Export/Transform to split up the columns in a specific format.

Play on.
Post Reply