Page 1 of 1

Communication between Jobs using env variables

Posted: Mon Jul 14, 2008 6:24 am
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

Posted: Mon Jul 14, 2008 7:27 am
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.

Posted: Mon Jul 14, 2008 7:27 am
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.

Posted: Mon Jul 14, 2008 7:29 am
by chulett
In other words, you'd need to persist it... file, USERSTATUS, etc.

Posted: Mon Jul 14, 2008 3:35 pm
by ray.wurlod
Another possibility, depending on precisely what you want to do, is to run Job2 from Job1 using the UtilityRunJob() function.

another option

Posted: Mon Jul 14, 2008 8:32 pm
by jtsoong
another option could be to investigate Sequence Jobs

another option

Posted: Mon Jul 14, 2008 8:33 pm
by jtsoong
another option could be to investigate Sequence Jobs

Posted: Tue Jul 15, 2008 2:59 am
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

Posted: Tue Jul 15, 2008 3:27 am
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.