I have a process currently in SQL server that runs a query and outputs a string of date time information into a batch file. Then I run the batch file to rename a load file. I am moving away from sql server and using DataStage as my data processing tool of choice. Is there a way for data stage to dynamicaly produce a name for a file and rename it?
Jim
spracht wrote:A couple of weeks ago, Michael Hester pointed out that you can use DS makros just like job parameters, surrounded by hashes, to achieve that.
How would I search to find that post so that I can figure it out?
What was the tipc subject?
Jim
To rename a file you can use a similar synatax in an after- job subroutine, like (how was this in Windows?): ren file file_#DSJobStartDate#.txt. In Unix, I would probably use the OS to create the new filename, like:
spracht wrote:To rename a file you can use a similar synatax in an after- job subroutine, like (how was this in Windows?): ren file file_#DSJobStartDate#.txt. In Unix, I would probably use the OS to create the new filename, like:
mv file file_$(date '+%Y%m%d').txt
Im testing that now..Ill let you know whats happening
Jim