Page 1 of 1

Dynamic filename for sequential file

Posted: Fri Jul 16, 2004 1:04 am
by onkie
Hi,

I like to dynamically create a name for the outputfile for a sequential file stage. The form must be like "d:\datastage\output\file_YYYYMMDD.csv" where YYYYMMDD has to be the current date. How can I accomplish this? I tried with a user defined routine, but that's not working (either because I'm calling it the wrong way or because it ain't possible).

Thanks in advance,
Aart

Posted: Fri Jul 16, 2004 1:11 am
by rasi
Assign a parameter in your job (FileDateName) and before running the job pass the current date to the parameter and start your job. In the sequential stage put the parameter after the file("d:\datastage\output\file_#FileDateName#.csv

Thanks
Siva

Posted: Fri Jul 16, 2004 5:05 am
by ray.wurlod
Alternatively, always write to the same, standard, file name and use an after-stage or after-job subroutine to compute the dynamic file name and rename the file.
(This is much easier on UNIX, where the output of the date command can be captured within the mv command, but I note that you are on Windows.)

Posted: Mon Jul 19, 2004 11:51 pm
by onkie
Thanks for the replies. For the moment I'm gonna use the variables variant Siva suggested.

Aart

Posted: Tue Jul 20, 2004 9:44 am
by s_boyapati
ray.wurlod suggestion is good. It not only works for the files with dates but also for your client/project file/parameter naming standards. By creating one routine, all team members can use. I use the same.