How to output different group of records to different 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
vskr72
Premium Member
Premium Member
Posts: 128
Joined: Wed Apr 28, 2004 9:36 pm

How to output different group of records to different files?

Post by vskr72 »

Hi, everyone, I got a problem about records output to unknown number files.

For example, I wanna output the file:

"abc","1","10"
"def","4","40"
"def","5","50"
"ghi","9","90"
"ghi","10","100"
"ghi","12","120"
........
........
........

to different files which are respectively like

file1:
"abc","1","10",

file2:
"def","4","40"
"def","5","50"

file3:
"ghi","9","90"
"ghi","10","100"
"ghi","12","120"

file4:
........
........
........

The record and file number is "Unknown", but the output file should be created base on record. Can someone tell me the soluation logic on dataStage? Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Take some time to spell out your algorithm. For example it might be as simple as (for each new value of Column 1 begin a new file).

It is probably easier to write out a single sorted file then to use a UNIX utility such as csplit or awk to divide it up.

Please try to use professional standards of writing here on DSXchange. English is not everyone's first language, and slang words such as "wanna" are not as easily understood by those who have only learned formal English.
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