Appending timestamp to filename
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am
Appending timestamp to filename
Building some simple enough extracts, but need to append filename. I have a sequence job, in which I have a user variable activity. I have used DSJObStartTimestamp. Then used this on the parameter at Job Activity calling the parallel job. No compilation or validation errors. But the job gets aborted on run time. Any suggestions? I want to avoid post unix scripting, as I think DataStage should be able to handle this.
You didn't provide any messages from Director, so this is a guess: is the file being written to a Unix server or a Windows server? If Windows, your timestamp format might violate Windows file name restrictions.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
you can just do this in the user variable stage..
'filename':CurrentTimestampMS()
or
variable:CurrentTimestampMS()
if the format is not acceptable for your filesystem, you can to a replacement of the offending characters ( : is probably the issue, replace that with - or something), or run the timestamp with a formatting string
'filename':CurrentTimestampMS()
or
variable:CurrentTimestampMS()
if the format is not acceptable for your filesystem, you can to a replacement of the offending characters ( : is probably the issue, replace that with - or something), or run the timestamp with a formatting string
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am
You may not need to pass in the timestamp, the DSJobStarttime macro should be able to be used directly in the parallel job as part of the filename in the connector stage. Unless you need to reformat it, as noted, then that would need to happen in the sequence job before passing it to the job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am
-
- Participant
- Posts: 22
- Joined: Tue May 09, 2017 8:46 am