how to dynamically create sequential files from the source?

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
Revathy
Participant
Posts: 1
Joined: Fri Oct 14, 2016 7:06 am

how to dynamically create sequential files from the source?

Post by Revathy »

depending upon the number of rows in the source how to create files dynamically?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you expand a wee bit on your question, please?
-craig

"You can never have too many knives" -- Logan Nine Fingers
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Assuming you mean that you need to create separate sequential files based on row counts, I have used two methods in the past.

1) a Post-Job UNIX script that counts rows and cuts the file into separate pieces.
2) Have the job count the rows and add a key column that changes every time you need to change file names. Then in the sequential file stage change the Write method to Generate Multiple Files, and add the Key property (with your key column name). You'll need to set your path and any file prefix in the Root File String property. You'll still need to strip out the key column from your data in a post job command.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Post Reply