Trigger the next activity based on the output of routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Trigger the next activity based on the output of routine

Post by suja.somu »

The requirement is to pass the output value of the routine to the next activity, based on the value of the output.

Routine calculates the link count of a particular link of a job. I calculate through an after job subroutine( after job successfully completes).

I have to execute the job based on the link count.

If the linkcount =0 then execute the job
Else if link count > 0 then stop the sequence flow.

how to do this in Sequencer?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What does the after-job subroutine do with the result? Simply have the sequence read it from there. Ideally the subroutine will write the result into the job's User Status area.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi Suja,

Below could be a Sequence design of your requriment:-

JobActivity----->Nested Condition ---------> Job
-----------> Stop seq flow


In nested condition you should calculates the link count of a particular link of a jobActivity. Write below Expression in nested condition:-

LinkStopSeq=Routinename(Jobactivity.Jobname,"StageName","linkName")>0
LinkExeJob=Otherwise

I hope this will work.
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Post by suja.somu »

Do I need to use the nested activity? Can the logic be acheived as below.

Job activity1 ------------------------------> Job activity 2


In the triggers of the Job activity can I directly call the DSGetLinkInfo routine

1) LinkStopSeq: Custom( conditional) :
DSGetLinkInfo(Validation_Job,'Stage name', 'linkname', DSJ.LINKROWCOUNT) >0

2) LinkExeJob:Otherwise :


Just a thought, Will this work ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Nested Condition activity is one that has no body, only triggers. There is nothing special about its triggers; the same triggers can be used on other kinds of activity as well.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Post by suja.somu »

In the sequence job

Job activity1 ------------------------------> Job activity 2


In the triggers of the Job activity I call the DSGetLinkInfo routine

1) LinkExecSeq: Custom( conditional) :
DSGetLinkInfo(Validation_Job,'Stage name', 'linkname', DSJ.LINKROWCOUNT) =0

2) LinkExeJob:Otherwise : Email notification

the link count is zero, still the job2 is nto triggered. instead the email job is triggered .

Can anyone explain why the condition is not getting executed.? where is the issue
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not a big fan of using routines like that directly in triggers, prefer the Routine Activity stage.

That routine requires a job handle, not a job name, hence the need for a wrapper routine to establish it, get the link count, detach from the job and then pass back the result.
-craig

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