Page 1 of 1

How to check last link status or last stage status

Posted: Wed Jun 22, 2005 2:21 pm
by Titto
I have job where I am triggering JOB1 using UtilityRunJob Transform -1 stage then Trigger JOB2 in another Transform-2 stage. I want to trigger JOB2 only when Transformer-1 status is successful.
I tried using DSLinkLastErr = 0 and DSStageLastErr = 0 in both transformer stage, but could not achieve what i am want.
Am i doing right? Any thoughts/Info appriciated.
Here is job flow:-

SeqFile--------->Xfrm-1--------->Xfrm-2
| |
| |
V V
Job-1 Job-2


Titto[/img]

Posted: Wed Jun 22, 2005 6:01 pm
by ray.wurlod
When a link is from one active stage Xfm1 to another active stage Xfm2 there will never be any error.
Therefore you need a different technique, probably an output constraint on Xfm1.
But do you really want to trigger Job1 and - possibly - Job2 for every row in the text file? This is what your job design suggests. Possibly there is a better solution involving a job sequence.

Posted: Wed Jun 22, 2005 9:33 pm
by Titto
Hi Ray,

Input Seq file contains only one record with 3 values separated by a delimeter, i need to get those values as a parameters to the next JOB-1 and JOB-2 , so right now i am reading those values in Xfm-1 , stage variable area and passing using pipe to job paramters by invoking UtilityRunJob from Xfm1 and JOB2 from Xfm2.
While i am doing testing i forced to abend JOB-1 (to test), but it is executing JOB-2. My requirement is, if JOB-1 successfull then only run JOB-2.

For that I can seperate them in to 2 different jobs, but can it be done in only JOB by forcing some constraints??
Or are there any other ways I can achieve this.

Basically i need to read a parameter seq file and use those values as a Job paramers.

Thanks in Advance..
Titto

Posted: Wed Jun 22, 2005 11:45 pm
by ray.wurlod
If you execute Job1 from a stage variable in Xfm1, then you can use the return value (its exit status) to constrain the output from Xfm1 so that Xfm2 is only triggered if the value is 1 (finished OK) for example.

It's a cumbersome method, though, one that would be so much easier using a job sequence, where the trigger is directly fed by the job's exit status. Reading the file to get the three parameter values is also quite easy, with either an Execute Command activity (or three) or a Routine activity.

Posted: Thu Jun 23, 2005 8:03 am
by Titto
Hi Ray,
Can you please provide any sample codes you are mentioning about Execute or routine activity..

Thanks in advance..

Posted: Thu Jun 23, 2005 5:45 pm
by ray.wurlod
Something like

Code: Select all

cat filename | cut -d',' -f1 
to extract the first parameter. The result is available when setting the value of a job parameter in a subsequent Job Activity.