Retrive a vlaue from one job and use that in a different job

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Retrive a vlaue from one job and use that in a different job

Post by hi_manoj »

Retrive a vlaue from one job and use that in a different job while reading from source, In detail

I am reading from a table (oracle) and writing to a dataset (or if suggested can be a seqential file). From table i am select just one column for a max(vlaue) in the where condition and it is retrieving 1 row. so just one value is getting written to the dataset

I want to use that value in a different job while reading from a table. Like when querying the source table in the other job i want to use it in where condition.

select .... where column=<value>

I know we can do this with lookup stage and UNIX script but i want to know is there any why to do this with parameter.

Please suggest.
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put the value in a flat file. In a Sequence job, read the file for that value and pass it as a job parameter to the job that needs it. Use it in your where clause enclosed in hash tags. Or use a Server job for the first task, save the value in USERSTATUS and then use that mechanism to pass the value to the next job (saves an intermediate step).
-craig

"You can never have too many knives" -- Logan Nine Fingers
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post by arvind_ds »

Put both the jobs in a job sequence. Store the value of the max column in a sequential file in your first job and then read the sequential file by using a execute command and store the previously read value in a variable activity stage.Then place your second job here in the sequence and pass the value of the variable activity stage to the next job which should be parameterised for desired value.

HTH
Arvind
Post Reply