Page 1 of 1

Pass Invocation ID as a param to a job.

Posted: Wed Nov 19, 2008 5:05 pm
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

Posted: Wed Nov 19, 2008 5:22 pm
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.

Posted: Thu Nov 20, 2008 9:54 am
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.

Posted: Thu Nov 20, 2008 10:08 am
by ramnishgupta
Got it, Passed DSJobInvocationId to the routine argument instead of #DSJobInvocationId# and it works.

Posted: Thu Nov 20, 2008 10:45 am
by chulett
Excellent. Please mark the post as Resolved using the button at the top of the page.