Pass Invocation ID as a param to a job.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ramnishgupta
Participant
Posts: 13
Joined: Tue Nov 08, 2005 9:43 am

Pass Invocation ID as a param to a job.

Post by ramnishgupta »

I have a multiple instance Sequencer S1 that has 3 jobs J1, J2 and J3 in it. How do i pass the invocation Id that was used when launching the S1 as a Parameter to jobs J1, J2 and J3.

Thanks
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

There is a special macro DSJobInvocationID that can be used in any multiple instance job just like a job parameter. It's likely that if you sequence is multiple instance than your J1, J2 and J3 jobs will be as well so when you pass them an invocation ID you can use DSJobInvocationID and inside the parallel/server job you can use #DSJobInvocationID# anywhere that a job parameter is accepted such as transformers, file paths and file names and database user-defined SQL.
ramnishgupta
Participant
Posts: 13
Joined: Tue Nov 08, 2005 9:43 am

Post by ramnishgupta »

In Sequencer S1 before i call jobs J1, J2 and J3 i have a routine that i use to lookup the parameters from a file for jobs J1, J2 and J3. In my Job parameters i use <<Routine Name>>.$ReturnValue to get the value of the param returned from the routine.

I need the Instance number as an argument for the routine to lookup the correct param. When i use #DSJobInvocationId# as an argument to the routine it does not substitute it with the invocation ID that was used to lauch the sequencer.
ramnishgupta
Participant
Posts: 13
Joined: Tue Nov 08, 2005 9:43 am

Post by ramnishgupta »

Got it, Passed DSJobInvocationId to the routine argument instead of #DSJobInvocationId# and it works.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Excellent. Please mark the post as Resolved using the button at the top of the page.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply