Discover if a sequence was called by another

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
yserrano
Premium Member
Premium Member
Posts: 52
Joined: Thu Jan 31, 2008 1:23 pm
Location: Santo Domingo

Discover if a sequence was called by another

Post by yserrano »

I am trying to determine at the beggining of a sequence if it was started by another sequence, a parent. (I hope you'll understand what I am trying to tell).

I believe it is possible to do it using a parameter, right? Apart from that, Is there a different solution available? Using, for example, a Routine Activity stage?

How?

Thanks in advance for your help.
(I searched the archives for a previous post, but I am probably using the wrong keywords, because could not find a similar situation).
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A Routine activity in which the routine invokes the DSGetJobInfo() function with DSJ.ME as the job handle and DSJ.JOBCONTROLLER as the InfoType argument should do this for you. If there is no controller this returns a zero-length string.

Or you could use a User Variable whose value is set via the equivalent DataStage macro (from memory DSJobController).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... not sure if there's an easier way, but the DSJobController macro (or DSGetJobInfo with the DSJ.JOBCONTROLLER InfoType) will give you the name of the controlling job. You could then take that job name to the repository and query for the job type.
-craig

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