Hi
We have a sequence that execute a job. We want to use the job name that is being executed to make a lookup to retrieve parameter values from a file.
The question is: can we get the job name that is being executed from a sequence?
We have tried to name the Job Activity stage the same as the job being executed and used DSGetStageInfo(DSJ.ME, DSJ.ME, DSJ.STAGENAME) but it returns 'JobControl' and not the Job Activity name. We have also tried DSGetJobInfo(DSJ.ME, DSJ.JOBNAME) but it returns the name of the sequence name.
We dont want to hardcode the job name to retrieve the parameter values, it has to be done dynamically.
Hope that anybody has som good answers.
Get Job Name executed from sequence
Moderators: chulett, rschirm, roy
Unfortunately the DSGet... routines won't work with job sequences.
Do you want the job name in a sequence, or in another job? One way would be to get the list of running jobs and, for each one, find out it's controller - which will be the sequence name.
Do you want the job name in a sequence, or in another job? One way would be to get the list of running jobs and, for each one, find out it's controller - which will be the sequence name.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
If you look at the job control code generated by a job sequence you can see where you could add one line per job activity stage call to fill a parameter with the job name being called.
You cannot do this directly in a job sequence, but this code could be copied to a normal server job and inserted in the Job Control (without adding any stages) and you will have your solution.
You cannot do this directly in a job sequence, but this code could be copied to a normal server job and inserted in the Job Control (without adding any stages) and you will have your solution.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>