jhmckeever wrote:If your concern with the Unix option is that you don't want another 'asset' to have to manage outside the DataStage environment then couldn't you just supply the 'script' in the filename specification?
I've been working in a purely PX environment for quite some time and don't remember if this will work in server - so apologies in advance if it's not appropriate to your environment.
John.
Hi,
We tried this method to create the file with date appended to the filename. But, the output filename we got was a string without the actual date. The output we got was,
MyFilename_'date +%Y%m%d'.txt
The date function did not return the actual date. But, instead 'date' as such was part of the filename. Our server is Linux. We tried manually executing the command "date +%Y%m%d" in command line and this correctly returns the date.
Could you please tell us what kind of change that we have to do to get the date from the format that is mentioned.
I changed it to 'back tick' and ran and still its not working. I tried creating the file using this through command line and that worked. But when I give this expression within the stage in DS, it does not work. Any idea...
That can't be used in directly in the stage AFAIK. You'd need to create a fixed filename and then use that 'after job' via ExecSH to rename the file to include the date.
-craig
"You can never have too many knives" -- Logan Nine Fingers
What are the criteria for incrementing the version number? Every job run? If so, you could store the value in an environment variable and use a before-Job ExecSH to increment it ...
chulett wrote:That can't be used in directly in the stage AFAIK. You'd need to create a fixed filename and then use that 'after job' via ExecSH to rename the file to include the date. ...
can you please give me the code which i can put it in after job routine.
Since you hijacked this thread instead of starting your own, we have no idea what O/S you have. For UNIX, it's just the "mv" command with the date added as already shown.
-craig
"You can never have too many knives" -- Logan Nine Fingers