Output File Name - Dynamic

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
yuva010
Participant
Posts: 36
Joined: Thu Apr 24, 2008 7:12 pm

Output File Name - Dynamic

Post by yuva010 »

Hi,

I need to assign output file name at runtime(with date at postfix).
In this forum with 'search' I found solution as below -

Use of, ProcessName_#DSJobStartDate#_#DSJobStartTime#.txt
in Sequestial File stage.

It is applicable for DS Server.

Will the same be applicable for Parallel?
Or for Parallel, is there any simplified method?
Thanks,
Yuva.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It works the same for PX AFAIK. Those, however, are job macros who's formats may not be exactly what you are looking for. You can always generate the date in your desired format and specifically pass it into the job in question as a job parameter. Those would be used in the same manner.

Or create a fixed filename in job and then 'rename' it via O/S commands to add the date/time stamp after job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
tsn
Participant
Posts: 51
Joined: Wed Jan 10, 2007 1:32 am

Post by tsn »

You can pass on the filename as a parameter to the job and get the run date and time you can format it according your format. concatenate those filename and run date and time, you can get the dynamic filename.
with regards,
tsn
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

As Craig said, you can use a sequence to generate your timestamps and pass it into the job as job parameters.

In case you really want the exact job run time (in microseconds) you can again use the sequencer to rename the file after the job has completed (after capturing the actual job run time)
Post Reply