Conditional datastage job run

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
vijay
Participant
Posts: 10
Joined: Tue Apr 15, 2003 10:32 am

Conditional datastage job run

Post 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
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
vijay
Participant
Posts: 10
Joined: Tue Apr 15, 2003 10:32 am

Post by vijay »

Thanks so much Roy!
Post Reply