Page 1 of 1

Conditional datastage job run

Posted: Mon Jun 21, 2004 2:22 pm
by vijay
Hello All:

Can you help me with a best practice to run a dependent job based on condition (e.g. record count in a particular table <= 200,000)? If the record count is > 200,000, then the job should not be run.

Thanks,
T.Vijay

Posted: Mon Jun 21, 2004 2:54 pm
by roy
Hi,
well here are some things for you to check out :
1. sequence job and nested condition.
2. Routines DSGetLinkInfo() DSGetJobInfo().
3. setting a user status for a job.
4. writing DS Basic code.
5. Building your own routine perhaps as a befor routine.

all you need is a search away here or in the DS docs you have.

IHTH,

Posted: Mon Jun 21, 2004 3:03 pm
by roy
Hi,
forgot about the table part, simply get the count(*) in any regular job.
set a user status to that job with this count (yes you still need to write your DS Routine for setting the user status something like:

Code: Select all

 $INCLUDE DSINCLUDE JOBCONTROL.H
 Call DSSetUserStatus (UserStatus)
)
now you could run this in a squence and use the nested condition to branch to the job or not hence running or not depending on the condition outcome.
if you want you can do several variations, how ever I think this is the most simple way to implement it.

Good Luck,

Posted: Wed Jun 23, 2004 1:53 pm
by vijay
Thanks so much Roy!