Passing values fron one job to other

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
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Passing values fron one job to other

Post by vinaymanchinila »

Hi,
I have a requirement, where my First job gives me a time stamp. Now I need to pass this on to the Second job , where it wuill be used in the ORA stage Query .

How do we go about this, thanks :roll:
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Either store it in a file and retrieve later or use status and sequencer to pass the values to next job.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

In my second job I am using an Oracle stage and it needs this date for the Join condition.

How do I do it in a seq?

Thanks for your time.
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Hi
Any help!
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Re: Passing values fron one job to other

Post by sumitgulati »

vinaymanchinila wrote:Hi,
I have a requirement, where my First job gives me a time stamp. Now I need to pass this on to the Second job , where it wuill be used in the ORA stage Query .

How do we go about this, thanks :roll:
Hi Vinay,

Two ways to do it:

1) Store the date in a hash file in first job. Read the hash in the sequencer using UtilityHashLookUp and pass the date to the second job.
2) From a Transformer Stage of the first job call the second job using UtilityRunJob and pass the date parameter value.

Hope this helps
-Sumit
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

hi,
Thanks a lot, going with the first option, and have stored the date in the hash file.

1)Now how do I use the UtilityHashLookUp(HashName,'Value',1) in the seq

2) How do I pass this value to the second job activity.

I was planning on writing a routine which reads this hash file, I have only 1 value in the hash file.
sumitgulati
Participant
Posts: 197
Joined: Mon Feb 17, 2003 11:20 pm
Location: India

Post by sumitgulati »

vinaymanchinila wrote: 1)Now how do I use the UtilityHashLookUp(HashName,'Value',1) in the seq
In the hash file define two colums DummyKey and Date. In Job 1 hardcode the value of Dummy Key to 1 and pass your date value to column Date. In the sequencer Call UtilityHashLookUp using RoutineActivity Stage. It asks for three arguments values. Use the following:
Arg1 - your hash file name within quotes
Arg2 - 1
Arg3 - 1

The output of the routine activity stage would be the date value. Now call Job 2 from the sequencer passing the return value from the Routine Activity Stage to the job.
2) How do I pass this value to the second job activity.
You can read help about this routine. As far as I remember you can pass the values to the parameters using pipe (|) delimited string.

Regards,
-Sumit
vinaymanchinila
Premium Member
Premium Member
Posts: 353
Joined: Wed Apr 06, 2005 8:45 am

Post by vinaymanchinila »

Got it with this routine

Thanks!
Post Reply