Capturing Invocation Id

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
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Capturing Invocation Id

Post by sumitgulati »

Hi All,

I have a multiple instance sequencer Job that calls various other multiple instance jobs. Whenever I run a serquencer job I give an Invocation id.
Now is there any was to capture this invocation id within the sequencer job and pass it to the other multiple instance jobs that the sequencer is calling?

Regards,
-Sumit
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How do you "give" the invocation ID? Surely you can simply "give" the same invocation ID to the other jobs in the sequence in exactly the same way.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Post by sumitgulati »

When I schedule the main sequencer job I type the invocation id. Now when this main sequencer calls the other jobs I need following two things:

1) It should pass the sequencer invocation id to the invocation id of the called jobs.
I can achieve this by using the following code in the Invocation Id expression box in the Job Activity stage of the sequencer

Code: Select all

DSGetJobInfo (DSJ.ME, DSJ.JOBINVOCATIONID)
2) It should also pass the sequencer invocation id to one of the parameters of the called jobs.
I can not use the same expression here because the parameter value expression box in Job Activity stage of the sequencer does not accept this.

Regards,
-Sumit
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no method that I'm aware of to automatically pass a parent invocation id downstream to child jobs. :?

You could put your code into a routine and then executing that routine (via the Routine Actitivy stage) as one of the first things in your job sequence. Pass out the invocation id as the 'answer' generated by your routine and then use StageName.$ReturnValue in the Invocation Id for your child jobs. Haven't tried this myself, but I believe it should work.

Make sure you know that you can't use routines like this in conjunction with the new 'automatically handle' activities that fail - routines that return a non-zero code are considered to have failed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you not use expressions of the kind Sumitgali postulated in version 7.5? That is, use DSGetJobInfo(DSJ.ME, DSJ.JOBINVOCATIONID) in the derivation for the invocation ID?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

The easiest way to have a child job inherent the same invocation id as the parent sequence job is to us the macro DSJobInvocationID in the expression for the child job's invocation id.

Mike
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't believe that expressions are allowed, perhaps in 7.5 (I'll have to take a ride through the docs). I was wondering about a macro, but a quick search in the 7.0.1 docs that we have installed right now didn't turn one up, so I didn't mention it.

Mike's right, that would be the easiest way to do that. :wink: Anyone know of any version restrictions on it? Does it exist back to the beginning of multi-instance jobs?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Post by sumitgulati »

Thanks guys for the suggestions. The macro DSJobInvocationId solved all the issues.

Thanks again
-Sumit
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I used this method extensively with 6.0r3 running on Solaris. I haven't tried it on any other version yet.

Mike
Post Reply