Hi
Is there anyway that I can save my target seq file as TimeStamp.
thanks
rcil
save as TimeStamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Can you be more specific?
I am guessing that you want to tag the file name with a timestamp of some kind. There are two approaches to this problem, searching the Forum will yield detailed solutions in each case.
I am guessing that you want to tag the file name with a timestamp of some kind. There are two approaches to this problem, searching the Forum will yield detailed solutions in each case.
- Write to an untagged file and change its name using mv (and `date`) subsequently.
Create job control code to generate the name of the file with a tag, and deliver this via job parameter to the job that writes to the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks for your response Ray. Yes you are correct, I want my target sequential file to be saved as a Timestamp.extension(ex: txt,dat etc).
According to your first solution do I have to use the mv 'date' in after job routine?
Please can you be more specific to your second solution? and on what do I have to search to get my solution in this forum because I searched in couple of ways but I didn't get any.
thanks
rcil
According to your first solution do I have to use the mv 'date' in after job routine?
Please can you be more specific to your second solution? and on what do I have to search to get my solution in this forum because I searched in couple of ways but I didn't get any.
thanks
rcil
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could use mv in an after-job subroutine, or in a job (or job sequence) that controls this job. Use back quotes to capture that part of the date command's output that you require. For example (from AIX; use -f5 for Solaris, etc):
If you're using a controlling job, generate the output file name with intrinsic functions (and, possibly, system variables) then pass this generated name to the controlled job. For example (omitting error handling for clarity):
Perhaps a search for "DSSetParam" and "timestamp" will help you to find other posts.
Code: Select all
mv `date +"%c%m%d_%H%M%S" | cut -d' ' -f6`
Code: Select all
OutputFile = "filename_" : Oconv(Date(),"DYMD":@VM:"MCN")
OutputFile := "_" : Oconv(Time(),"MTS":@VM:"MCN")
hJob = DSAttachJob("MyJob", DSJ.ERRNONE)
ErrCode = DSSetParam(hJob, "TargetFileName", OutputFile)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
I have a very good solution on this:
We had a requirement of creating a file with a timestamp.
1.Store the timestamp value in a table.
2.Write a job which would hold this timestamp value
3.This job would call a routine which would call a second job
4.The second job would take this value as "Job Parameter"
5.This "Job Parameter" can be given as the target file name (between ##)
Regards
We had a requirement of creating a file with a timestamp.
1.Store the timestamp value in a table.
2.Write a job which would hold this timestamp value
3.This job would call a routine which would call a second job
4.The second job would take this value as "Job Parameter"
5.This "Job Parameter" can be given as the target file name (between ##)
Regards