I am trying to pass parameter which I get from a file to the batch job.
The output of unix command is correct I check it using DSLogInfo before the DSSetParam step. But the value is not passed to the Parameter. I dont understand why. Here's the code
Code: Select all
Cmd = "cat /clocal/ivp/dvlp/tmp/Param.txt":"|cut -c2-5"
Call DSExecute("UNIX", Cmd, Output, SystemReturnCode)
Ans = Output
* Setup Test7Job, run it, wait for it to finish, and test for success
hJob1 = DSAttachJob("Test7Job", DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: Test7Job", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "$ivpDirParm", "$ENV")
ErrCode = DSSetParam(hJob1, "$ivpDB2User", "$ENV")
ErrCode = DSSetParam(hJob1, "$ivpDB2Passwd", "$ENV")
ErrCode = DSSetParam(hJob1, "$ivpDB2DBStg", "$ENV")
ErrCode = DSSetParam(hJob1, "$ivpDirTmp", "$ENV")
Call DSLogInfo('Output = ': Output, 'Msg') /*Output=PH02*/
ErrCode = DSSetParam(hJob1, "PHID",Output) /*here PHID=''*/
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: Test7Job", "JobControl")
End
Thanks
Sumeet