Page 1 of 1

Design job flow based on tgt table row count.

Posted: Tue Nov 13, 2007 11:57 am
by sspreethi
Hi All,

I have a requirement where based on tgt table rowcount in a job, I have to branch my sequencer flow. Please let me know if there is a way to acheive this from Sequencers.


JobA -> JobB (if tgtrows of JobA=0) -> JobD (if tgtrows of JobB=1) -> JobE, etc...

-> Jobc (if tgtrows of JobA=1)

After JobA, if tgt rows of JobA is 0 Then run JobB else run JobC. After JobB, if tgt rows of JobB is 1 then run JobD

Preethi

Re: Design job flow based on tgt table row count.

Posted: Tue Nov 13, 2007 1:01 pm
by gateleys
How are you counting the rows to target? If you are writing the count to a file in each job, then you will have to use a Execute Command stage after each job to return the count, and then set the Triggers as follows -
JobA Trigger (to JobB) : ExecuteCommand_A.$ReturnValue = 0
JobA Trigger (to JobC): ExecuteCommand_A.$ReturnValue = 1

JobB Trigger (to JobD) : ExecuteCommand_B.$ReturnValue = 1

You may handle other ReturnValues accordingly.

Posted: Tue Nov 13, 2007 1:09 pm
by richdhan
Hi Preethi,

This can be done but you have to create a basic routine which should contain Basic code something like this and return the record count

JobHandle = DSAttachJob(jobname,DSJ.ERRWARN)
rowcount = DSGetLinkInfo(JobHandle,stagename,linkname,DSJ.LINKROWCOUNT)

Do a search on Server Forum. It has many samples.

Use the Routine Activity after each Job Activity and call the custom routine to find the rowcount. Then you can branch out based on the output.

HTH
--Rich

Posted: Tue Nov 13, 2007 3:28 pm
by sspreethi
Thanks a lot Rich & Gateleys.
I tried the second one & it worked perfect...