Concatenation of 4 fixed width files into one 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
vimali balakrishnan
Participant
Posts: 60
Joined: Mon Dec 27, 2004 3:38 am

Concatenation of 4 fixed width files into one file

Post by vimali balakrishnan »

Hi,
We have a job which reads a record from a source file(csv), splits that single record into 4 records. These four records are populated to four different fixed width files. Each record has a different metadata. that is the number of columns vary between the 4 records, whereas the record length is fixed which is 255.

These 4 records which are written seperately to four files needs to arranged in the following order and written to a single output file.

for 1st record in source --> rec1
-->rec2
-->rec3
-->rec4
then the for second record in source the same order...

Basically a record from source need to be split into four records to fit to the metadata definition required for that particular record, then these four records needs to be arranged next to each for a source record and written to a single output file.

We have designed a job to spilt the source record and write it to four different fixed width files.

we are trying to arrive at a single file with the four records for a single source record arranged next to each other. We tried using funnel stage, but we could not guarantee on the order.. Is this possible only in server jobs through link collector and a transformer?

Could you please suggest a solution for this?
dhanashreepanse
Participant
Posts: 25
Joined: Fri Jan 11, 2008 12:49 am
Location: Pune, India

Post by dhanashreepanse »

Hi

Rather than splitting the record and putting them in 4 files and again concatenating it, can you use the substring function & concatenation function and achieve the result in a single transformer ?

-Dhanashree
Ramani
Participant
Posts: 58
Joined: Mon Oct 08, 2007 1:51 am

Post by Ramani »

when splitting into 4 files, concat all columns into one column with a required delimiter comma or something.

Then all the 4 files will have only one column with the concatinated values with a delimiter.

Then use funnel stage to gather one by one, so finally you get one required output.
Thanks
Post Reply