multiple cobol record layouts in the single file

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
rgandra
Premium Member
Premium Member
Posts: 49
Joined: Mon Aug 02, 2004 9:31 am
Contact:

multiple cobol record layouts in the single file

Post by rgandra »

My extract file is the variable length file with two different cobol layouts. I have to choose the layout depends on the REC_TYPE column. File is in the binary format.

I have no idea how I could achieve this in the Data stage.

Any help is greatly appreciated.
Lotus26
Premium Member
Premium Member
Posts: 48
Joined: Tue Jul 13, 2004 2:09 pm

Re: multiple cobol record layouts in the single file

Post by Lotus26 »

rgandra wrote:My extract file is the variable length file with two different cobol layouts. I have to choose the layout depends on the REC_TYPE column. File is in the binary format.

I have no idea how I could achieve this in the Data stage.

Any help is greatly appreciated.

One option is ask your source to send the file as a Fixed width file. i.e the record which got maximum width. for the other record they have to fillup spaces for the remaining characters. Like if the record 1 is 100 characters and record 2 is 75 characters. Then the record 2 has fillup with 25 spaces.

In the transformer u have to differentiate with your REC_TYPE column.

Hope it helps a bit

Rgds
Lotus
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: multiple cobol record layouts in the single file

Post by rwierdsm »

Rganda,

I have just completed working on a project that does exactly what you are describing. We used the following approach:

- Read in the file using a single column (2000 wide in our case -> max record width plus 25% or so for future growth) to do preliminary validation such as header check, duplication check, file version check, delta processing, etc. Send the results to the next step.
- read the file in using a Complex Flat File stage (I'm assuming there is such a thing in EE, otherwise drop down to Server for this step)
- split the file up according to your record type indicator into the different record layouts. You will have to define the record layouts using a COBOL copy book format. Search the forum for more info on this.
- once the file is split into record types, perform mapping tranformations and then load to target.

Hope this helps!

Rob Wierdsma
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Post Reply