Page 1 of 1

How to pass data value to next PX job parameter?

Posted: Mon Nov 18, 2013 5:01 am
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,

Posted: Mon Nov 18, 2013 6:43 am
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.

Posted: Mon Nov 18, 2013 6:49 am
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,

Posted: Mon Nov 18, 2013 8:36 am
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.

Posted: Tue Nov 19, 2013 1:06 am
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

Posted: Tue Nov 19, 2013 2:14 am
by srini.dw
Thanks for the replies.

Posted: Fri Nov 29, 2013 1:55 am
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.

Posted: Fri Nov 29, 2013 9:02 am
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.