Page 1 of 1

Job Sequencer

Posted: Wed Nov 20, 2002 3:44 am
by vbalacts
Hi All,

I have some doubts in Job sequencing.

1. We want to store the parameters in a common place and all the jobs in a Particular project has to read the values from this common place. We already wrote a program to read from flat file but the requirement is to achieve this without any coding part. I know about parameter management tool. Is it possible to achieve this without this tool? Please send your suggestions soon.

2. In Job sequencer, there are some triggers like OK - (Conditional), Failed - (Conditional), Custom - (Conditional).
Can anyone explain about this Custom - (Conditional) Trigger? It is asking for an expression <LHS> = <RHS>. can you please explain this with an example?

Thanks
Bala

Posted: Wed Nov 20, 2002 3:59 pm
by ray.wurlod
1. There is no way to do this without either coding or the Parameter Manager tool. That is, DataStage does not have global parameters. This is why the tool came about!

2. A Conditional link expression is rather like a contraint expression within a job; it must evaluate to a true or false value. For example, you may have been waiting for a file to appear, but don't want to start the job if it's after 3:00am. The conditional expression might be Time() < 10800. (3:00am is 10800 seconds after midnight.)

Posted: Wed Nov 20, 2002 6:19 pm
by vmcburney
Here are some more examples.
You can use a conditional trigger to read a job parameter that affects the sequence path. (You don't need to enclose parameters in # marks) Eg.
DoLoadLookups=-1
DoLoadLookups=0
The first trigger reads the value of the job parameter DoLoadLookups and if it is true it moves down a path that runs a job to load a set of lookup tables. If it is false it goes down another path that skips that step.
I have also used triggers to read a value returned by a routine stage. I believe the syntax is Stagename.ReturnedValue. Eg.
PublicHolidayCheck.ReturnedValue = 0
The stage PublicHolidayCheck runs a routine that determines whether the current day is a public holiday and returns a true or false flag. The job sequence only continues on non public holidays. Note that this PublicHolidayCheck.returnedvalue is available to all subsequent stages in your sequence path so you can keep using it in trigger code on multiple stages.

There is a minor trap with the supplied triggers of OK and Failed. If you do an OK output trigger and a Failed output trigger you will not have anything to trap a job that succeeds with warnings. I've found it easier to use a Failed trigger and an Otherwise trigger on most jobs. You can also write your own using the Custom trigger to combine the OK and Warning return codes into a single trigger.