Appending record count at the end of the file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
yaminids
Premium Member
Premium Member
Posts: 387
Joined: Mon Oct 18, 2004 1:04 pm

Appending record count at the end of the file

Post by yaminids »

Friends,

I am working on a small project which requires me to generate some flat files with the data selected from an Oracle db. I am generating one file per table by selecting all the records.
The main requirement is to append the record count at the end of the file.

Is there a way to accomplish this task in DataStage?

Thanks a bunch in advance
Yamini
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure! :D

You can open the file in Append mode and write the record to it. Or capture the count in a separate file (with a link to an Aggregator, for instance) and then concatenate it in append mode to the main file after job. I'm sure there are other techniques.

Code: Select all

cat record_file >> detail_file
Have you tried either way? What issues are you having?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply