Using Stage variables in After Stage 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
dwscblr
Participant
Posts: 19
Joined: Tue May 18, 2004 12:39 am

Using Stage variables in After Stage job

Post by dwscblr »

Is it possible to pass stage variables used in a Transformer Stage as a parameter to the shell script I am calling in the After Stage job? If not, are there any alternatives?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... no. Or at least not directly. A couple of alternatives off the top of my head:

Pass the Stage Variable out of the job using DSSetUserStatus. Write a routine to 'wrapper' the call to the function and other to execute your shell script and have the value it needs passed in as an argument. Use a Sequencer job to automate the connection between the two - a Job Activity stage and then a Routine Activity stage that takes its input argument from the $UserStatus area of the previous job. I generally like this more 'modular' approach, each piece can be tested (and run) seperately if desired. More restartable that way, too.

You could also look into the @USER0 thru @USER4 system variables. Values can be 'parked' there and then picked up in later routines. You'd still need your routine, but it could be run after job.

I'm sure there are other ways. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

There are utility to read and write to hash files. I would always use these. Hash files exist between jobs, stages or whatever.
Mamu Kim
Post Reply