Before Job SubRoutine to set Job Parameter Values
Posted: Tue Sep 21, 2010 7:06 am
Hi,
Requirement: Before job subroutine (BASIC) to provide value (come from a shell script) to the Job Parameter of the same Job.
Job Parameter <-- Before Job Subroutine <-- Shell script
Solution so far: I can call the shell script and get its output value in a variable.
Call DSExecute("Unix", command, Ans, SystemReturnCode)
Where
command = shell script name with full path with proper arguments (works fine)
However, I am not able to assign it to the Job Parameter.
ErrCode = DSSetParam(JobHandle, "pEtlJobRunId", Ans)
Where
JobHandle=DSJ.ME
pEtlJobRunId= job parameter name
Ans = output from a shell script
Here the ErrCode = -1
meaning DSJE.BADHANDLE Invalid JobHandle. So, I come to a conclusion that I cannot attach the same job to set the job parameters (not even using DSAttachJob, job hangs for 1800 seconds and than errors out saying same job cannot be attached).
Is there a work around to this? So I can Set the job parameter values from the before job subroutine (for the same job).
Thanks in advance.
Requirement: Before job subroutine (BASIC) to provide value (come from a shell script) to the Job Parameter of the same Job.
Job Parameter <-- Before Job Subroutine <-- Shell script
Solution so far: I can call the shell script and get its output value in a variable.
Call DSExecute("Unix", command, Ans, SystemReturnCode)
Where
command = shell script name with full path with proper arguments (works fine)
However, I am not able to assign it to the Job Parameter.
ErrCode = DSSetParam(JobHandle, "pEtlJobRunId", Ans)
Where
JobHandle=DSJ.ME
pEtlJobRunId= job parameter name
Ans = output from a shell script
Here the ErrCode = -1
meaning DSJE.BADHANDLE Invalid JobHandle. So, I come to a conclusion that I cannot attach the same job to set the job parameters (not even using DSAttachJob, job hangs for 1800 seconds and than errors out saying same job cannot be attached).
Is there a work around to this? So I can Set the job parameter values from the before job subroutine (for the same job).
Thanks in advance.