Conditionally (not) executing a stage in a job?

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
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Conditionally (not) executing a stage in a job?

Post by sbass1 »

Sorry if this has been discussed before. I did search before posting.

I have a job like so:

SEQ1 --> XFM1 --> SEQ2 --> (more downstream XFM's -->)

With the volume of data in SEQ1, plus the code that's running in XFM1, the red bit takes a long time to execute.

In development, when I'm changing the downstream code a lot, this time lag can be onerous. For various reasons, I have to test the downstream code using a full data feed, i.e. not limit the number of rows.

Is there a way to conditionally execute a transform stage. In pseudocode:

If JobParm_SkipStage1 = "YES" then call DSTransformStop() (in XFM1 stage variable)

It so happens the SEQ2 target uses a job parameter for the directory of the output file, so if I just redirect that to /tmp the output from the previous run will be preserved, and the downstream stages will use that as input. I just don't know how to stop the transform without aborting the job. To me, this is just manually coding a restart point within a job.

Hope this is clear.

Thanks,
Scott
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, not really. The only 'conditional execution' of this kind that you have control over is at the link level via constraints. However, when a constraint equates to false such that nothing is passed out the link, the derivations in the link columns do not 'fire' as well, so perhaps you could leverage that in your specific job if the writing of the sequential data can indeed be redirected separately from the reading of the data on the other side. Somewhat equivalent, it seems.

Or just run the red part once and then cut those stages out of the job to a scratch job. Add them back in once all of the 'downstream' work is done. This is the approach I would take in your shoes, FWIW.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply