Page 1 of 1

filename - Filename_yyyymmdd.txt

Posted: Sun May 09, 2004 12:39 pm
by newkid
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.

Posted: Sun May 09, 2004 4:24 pm
by ray.wurlod
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

Posted: Wed May 12, 2004 6:28 am
by thirupri
Here is the another solution if you create the server job.

If you use the DataStage Seq File control in the File Path area you can specify like this “C:\Test\File_NAME#BUSDATE#.TXT”

Where BUSDATE is a Job Parameter with type String.

Regards,
Thiruma Valavan