Communication between Jobs using env variables

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
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Communication between Jobs using env variables

Post by saikrishna »

Hi

By using of environment variables, can we change the values in one job and use those changed values in other job...like the way global variables in languages?

Thanks
Sai
DS_SUPPORT
Premium Member
Premium Member
Posts: 232
Joined: Fri Aug 04, 2006 1:20 am
Location: Bangalore

Post by DS_SUPPORT »

If you want to pass values from job1 to job2, then specify a job parameter in job2, and pass the value from job1.

For passing the values, you can consider writing the value to userstatus in job1 or write it to a hashed file and retrive it in job2.

For doing this, you might require to use sequence job, and call the required jobs.

There might be other ways also, and our DS masters will help you.
Last edited by DS_SUPPORT on Mon Jul 14, 2008 7:29 am, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, not directly in the manner you are thinking. They are ephemeral, transient things which do not survive the tragic heat death of their specific process.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, you'd need to persist it... file, USERSTATUS, etc.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Another possibility, depending on precisely what you want to do, is to run Job2 from Job1 using the UtilityRunJob() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jtsoong
Participant
Posts: 29
Joined: Mon Oct 22, 2007 11:52 pm

another option

Post by jtsoong »

another option could be to investigate Sequence Jobs
jtsoong
Participant
Posts: 29
Joined: Mon Oct 22, 2007 11:52 pm

another option

Post by jtsoong »

another option could be to investigate Sequence Jobs
saikrishna
Participant
Posts: 158
Joined: Tue Mar 15, 2005 3:16 am

Post by saikrishna »

I am not calling job2 from job1 or vice versa.

My main intention is to use the value in job2 that is modified by job1...
Is this possible in DataStage?

Thanks
Sai
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, using the techniques that have been discussed in this thread. But you will need some mechanism, whether it be a job sequence, a shell script or anything else, to collect the value modified by Job1 and feed it as a parameter value before requesting a run of Job2.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply