Hi, I need to pass or get from system to create a filename
called "filename"_yyyymmdd.txt
However, I have problem passing in the paramter from jobs
and also triming the "-" or "/" based on the Oconv or Iconv.
Any extract(position,xxx) or Trim(xxx) function in DS.
I also have problem putting a leading zero fields on trailer record otherwise my first DS job is done.
Thanks for all.
filename - Filename_yyyymmdd.txt
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can use a job parameter set in a controlling job. The controlling job (or job sequence) would generate the file name, perhaps using a Routine, then set a parameter containing that file name that the real job could use. If you were writing your own controlling job, it would look something like this:
Code: Select all
TheFileName = "/usr/data/myfile" : Oconv(@DATE,"DYMD[4,2,2]":@VM:"MCN")
hJob1 = DSAttachJob("MyJob", DSJ.ERRNONE)
ErrCode = DSSetParam(hJob1, "FileName", TheFileName)
If Not(ErrCode Matches "'-'1N")
Then
RunReqCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
WaitCode = DSWaitForJob(hJob1)
JobStatus = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
Call DSLogInfo("Exit status of controlled job is " : JobStatus, "Control")
End
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.