You need to define a parameter in the second job to hold the variable and then use 'DSSetParam' in your controlling batch before running the job. From the help:
Syntax
ErrCode = DSSetParam (JobHandle, ParamName, ParamValue)
Example
The following commands set the quarter parameter to 1 and the startdate parameter to 1/1/97 for the qsales job.
paramerr = DSSetParam (qsales_handle, "quarter", "1")
paramerr = DSSetParam (qsales_handle, "startdate", "1997-01-01")
(ParamValue can also be a variable)
-craig
Passing a variable between jobs
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If the one job is not the controlling job of the other, there is no means for passing a variable via job parameters, nor any other mechanism for making the same variable visible in both jobs. This is mainly because the separate jobs run in separate processes with separate memory spaces and symbol (variable) tables.
Writing one or more values into a text file in one job and having the second job read them from there is reasonably efficient, though you may experience synchronisation issues. Similarly, one job could write information into a named pipe and the other job could read from the named pipe.
Writing one or more values into a text file in one job and having the second job read them from there is reasonably efficient, though you may experience synchronisation issues. Similarly, one job could write information into a named pipe and the other job could read from the named pipe.