Page 1 of 1

Posted: Wed Sep 18, 2002 2:04 pm
by chulett
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

Posted: Tue Sep 24, 2002 7:06 pm
by ray.wurlod
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.