Page 1 of 1

Branching logic without a sequence

Posted: Sun Mar 25, 2007 5:33 pm
by takyn
Long time reader, first time poster :)

I need to check if a dataset in order to elect whether to run a database load job. If the dataset is empty (i.e. 0 rows) we skip the job, otherwise we run it*.

From the sequence i'd run an Execute Command invoking the 'dsrecords' command and branch based on the output. However what I'd like to be able to do is have the same logic embedded within the job itself (i'm thinking something in the before-job subroutine or dependencies?)**.

Any help would be much appreciated.



*why? 1) performance - this job is run a LOT 2) we sometimes get a weird DB2 load hang that seems correlated to zero row dataset loads - any help on this one would also help

**why? we have lots of sequences that use this one job (generic RCP DB2 load) - a lot less effort and a lot less room for missing one is we embed the logic at the job level.

Posted: Sun Mar 25, 2007 7:49 pm
by DSguru2B
I cant think of a graceful way of doing this within a single job. Its better to keep it in a sequence job. You can have a shell script that is fired as a stand alone that runs the dsrecords orch command and depending upon the output, decides whether to run the job or not. Otherwise stick to a sequence job.