User-defined AutoEdit variables are classified as either Local variables or Global variables.
Thus far, all the user-defined variables that you have used in this chapter have been Local variables. A characteristic of Local variables is that values given to them by a job do not carry beyond that job—those values cannot be accessed or changed by a different job.
By contrast, Global variables are stored in the IOA Global Variable database and can be accessed and updated by other jobs.
Shortly, you will create Global variables and demonstrate their global nature. Before doing that, however, you should observe the local nature of the Local variables.
SET VAR %%LOC1=111
SET VAR %%BRANCH01_TAPE=222222
//* TAPE ID PROVIDED: %%TAPEID
//* %%LIBSYM CTM.TEST.AUTOEDIT %%MEMSYM IDTAPE
//* BRANCH01_TAPE HAS THE VALUE: %%BRANCH01_TAPE
//* LET’S SEE IF THIS RESOLVES: %%LOC1
The log indicates that IDJOB7 was not submitted because variable %%LOC1 could not be resolved. Since IDJOB6, which successfully executed, defined a value for %%LOC1, it is clear that IDJOB7 has no access to this value. This is because %%LOC1 is a local variable.
//* LET’S SEE IF THIS RESOLVES: %%LOC1
The job order line appears as follows in the Active Environment screen:
IDJOB7 ID 020201 M21 /08316 JOB Ended "OK" (Run 2)
Prior Run: Not Submitted
%%BRANCH01_TAPE resolved to the original value from %%MEMSYM member, 5554444, not the value set by the SET VAR statement in IDJOB6:
//* BRANCH01_TAPE HAS THE VALUE: 5554444
Clearly, the SET VAR statement in IDJOB6 did not impact the value in the external member, which indicates that %%BRANCH01_TAPE is a local variable.
Now that you’ve seen the limitations of Local variables, take a look at Global Variables.
Parent Topic |