Get Job Name executed from sequence

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
peterbaun
Premium Member
Premium Member
Posts: 93
Joined: Thu Jul 10, 2003 5:27 am
Location: Denmark
Contact:

Get Job Name executed from sequence

Post by peterbaun »

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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
peterbaun
Premium Member
Premium Member
Posts: 93
Joined: Thu Jul 10, 2003 5:27 am
Location: Denmark
Contact:

Post by peterbaun »

Thanks for the answer

We want to pass parameter values to the job that the sequence is executing. We are planning on doing that by making a lookup in a file with the job name of the job being executed by the sequence. We were hoping to make this dynamically but it seems like you can't the job name.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

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.
peterbaun
Premium Member
Premium Member
Posts: 93
Joined: Thu Jul 10, 2003 5:27 am
Location: Denmark
Contact:

Post by peterbaun »

Thanks ArndW

We were hoping that we could get the Job name from the Job activity stage but apperently we can't. Our plan is to use sequences so we will get the parameter values in different way, haven't figured it out yet.

Thanks again for your quick and precise answers

Regards

Peter Baun
Post Reply