How to pass stage variable onto after-stage subroutine

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
Joshi.H
Participant
Posts: 2
Joined: Mon Dec 15, 2003 9:04 am

How to pass stage variable onto after-stage subroutine

Post by Joshi.H »

Hello,

I'm new to DataStage. I have a job, which compares to values in a Transformer and writes the result to a stage variable. I would like to pass this stage variable (meaning the value in it) onto a after-stage routine where a Call DSLogWarn is performed, if the value in the stage variable is not equal 0.

What do I have to put in the field "Input Value" where I select "After-Stage subroutine". The name of the stage variable is "Arg1".

Regards,

Joshi.
raju_chvr
Premium Member
Premium Member
Posts: 165
Joined: Sat Sep 27, 2003 9:19 am
Location: USA

Re: How to pass stage variable onto after-stage subroutine

Post by raju_chvr »

One way can be is write the Stage variable to a file and you can use that file as an input in the next stage.
Joshi.H
Participant
Posts: 2
Joined: Mon Dec 15, 2003 9:04 am

Re: How to pass stage variable onto after-stage subroutine

Post by Joshi.H »

Well, I simply would like to compare the number of rows which should have been transfered and the number of rows which have been transfered and if there is a difference I would like to write a Warning to the Log and make the Job stop. I do not want to use the variable in the next job, but the value of the variable in a routine where I would like to work with it.

Let me add something: I would like to pass the stage variable as an argument onto the routine.

Joshi.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Put another output link to a hash file, sending the result of the stage variable everytime to the same row in the hash file. Use write-delay cache so there's no effort by the job. When the transformer finishes, the last row is written to hash file. The hash file contains one and only one row, your results. Draw a link out of the hash file to another transformer and then to a sequential text file. In that transformer do whatever you need to do, and output any error or exception reporting to the sequential text file.

There is no ability to communicate a stage variable to after transformer or job routines without a lot of work, using COMMONs and such, which may not be allowable in your job type.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply