Put date in file name when write out

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
lsnovick
Participant
Posts: 80
Joined: Fri May 25, 2007 7:24 am
Location: Troy

Put date in file name when write out

Post by lsnovick »

Does anyone know how to put the SYSDATE in the file name of a sequential file?
BillB
Premium Member
Premium Member
Posts: 48
Joined: Tue Nov 13, 2007 6:44 pm

Post by BillB »

As long as a Sequence Job is involved, then build your date string in a UserVariables Activity. It can then be used downstream in whatever you are using to create or rename your file.
vivekgadwal
Premium Member
Premium Member
Posts: 457
Joined: Tue Sep 25, 2007 4:05 pm

Post by vivekgadwal »

BillB wrote:As long as a Sequence Job is involved, then build your date string in a UserVariables Activity. It can then be used downstream in whatever you are using to create or rename your file.
The file name portion of the Sequential File stage accepts job parameters, the same way as you write it elsewhere (using # signs). As Bill pointed out, once you figure out the SYSDATE from somewhere in a Sequence, you can use it as a parameter to your job.
Vivek Gadwal

Experience is what you get when you didn't get what you wanted
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Another common technique is to write it out with a static name and then rename it 'after job' using O/S commands to include the date and time if required.
-craig

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