How to pass data value to next PX job parameter?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
srini.dw
Premium Member
Premium Member
Posts: 186
Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai

How to pass data value to next PX job parameter?

Post by srini.dw »

Hi,

I am looking for a way to pass ouput value out of a PX job to be used as value in parameter of another PX job.

Job 1
Row Generate -> Transformer((CurrentTimestamp())) -> Sequentail File (Seq.txt)
Output "2013-11-18 13:13:50"

Job 2
DataSets -> Transformer -> Oracle

I have an UPDATE_TM field in target table, I need to use the CurrentTimestamp value of that Seq.txt in Job 2 job.

Note : Cannot use derivation in UPDATE_TM column in Job 2, because we need to use exact value fetched from Job 1 in many jobs.

Any thoughts on this.

Please help

Thank you,
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

If you are using sequence then instead of creating a file you can store datetime in userstatus function in basic transformer or design server job and then pass it as a parameter in downstram sequence job activities using Job.userstatus,by doing this you can avoid creating file instead it is stored in memory.
srini.dw
Premium Member
Premium Member
Posts: 186
Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai

Post by srini.dw »

Thank you for the reply.

We are not using sequence in our jobs, we are having other scheduler.

Any other options.

Thanks,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You've written it to a file. Use a sequence job to read the file and pass in the parameter and then schedule the sequence job. Or use a script and schedule the script.
-craig

"You can never have too many knives" -- Logan Nine Fingers
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

Since you are not using sequence for passing down the parameter value, you can try doing something like this :-

1) In job 1, define a dummy column and set its value to 1 for all records.
2) In job 2, in the transformer stage - Use a dummy column and set its value to 1. Use a look up stage (just before the target stage) and reference the timestamp value from the sequential file by joining the input and reference link on the dummy column.

Cheers
KD
srini.dw
Premium Member
Premium Member
Posts: 186
Joined: Fri Aug 18, 2006 1:59 am
Location: Chennai

Post by srini.dw »

Thanks for the replies.
nagadastagirireddy
Participant
Posts: 15
Joined: Fri Jan 22, 2010 4:35 am
Location: India

Post by nagadastagirireddy »

If you are running the two jobs in same sequence you can do it in this way.

Sequence : UservariableStage-->Job1-->Job2
In the user variable stage get the current timestamp first and then use it in both the jobs by passing as parameter.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

True... if both jobs need the same parameter. The question here, however, was how can the first job (which generates a value) pass that value to the second job. With the User Variables stage, the first job could be dropped from the process but (as you noted) would require the use of a Sequence job, something the OP said they were not using.
-craig

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