Joined: 01 Feb 2007 Posts: 88 Location: Stockholm, Sweden
This is probably an RTFM answer but a colleague of mine today asked me if in TWS he could set (SETVAR?) a pool of 'global' varables which could be accessed by subsequent jobs.
He went on to refine this request realising that he only wanted members of the same (or selected) ADs to be able to see these variables.
Now, I will of course RTFM anyhow, but if anyone can shortcut this with an absolute "NO way José" or (better)"YES, easy, like this... " that would be a great help!?
An interesting question. Just to clarify, you want to use a set some variables in one job that are then available to later jobs in the same or different applications?
I think the short answer is no. The SETVAR statement sets variables that are used for that particular job, it does not store them for use in later jobs. If on the other hand we are talking about predefined variables (in the JCL variable table) then you can just point to the appropriate variable table on the run cycle for the application. Bear in mind also that you can define your own variables in the JCL variable table that can be set based on various criteria such as application name or time of day. You're not limited to using the TWS supplied variables.
If this doesn't suit your requirements, you're going to have to get a bit more creative. Two possibilities that spring to mind are using the PIF (Program Interface) to set variables in the JCL Variable Table that could then be referenced by other jobs or writing appropriate SET statement to a member in the EQQJBLIB concatenation that could then be included in subsequent jobs by use of the FETCH directive.