Page 1 of 1

Discover if a sequence was called by another

Posted: Tue Oct 21, 2008 3:06 pm
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).

Posted: Tue Oct 21, 2008 3:10 pm
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).

Posted: Tue Oct 21, 2008 3:14 pm
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.