How to check last link status or last stage status

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
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

How to check last link status or last stage status

Post 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]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Titto
Participant
Posts: 148
Joined: Tue Jun 21, 2005 7:49 am

Post by Titto »

Hi Ray,
Can you please provide any sample codes you are mentioning about Execute or routine activity..

Thanks in advance..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply