If a variable is linked to a job variable, the contents of the declared variable are stored in the job variable. In this case, the scope with which the variable was declared makes no difference.
Linking is accomplished by means of the operand CONTAINER = *JV(jvname) with jvname as the name of the job variable.
Job variables are cataloged like files. When job variables are accessed, the same conditions apply as when files are accessed, including password protection. For information on job variables, see the “Job Variables” manual [5].
Password protection for job variables is retained in its entirety. Password-protected job variables can then be accessed by means of their linked S variables only if the relevant password was already entered in the task’s password table using the ADD-PASSWORD command.
The definition of a job variable as a variable container has no effect on variable lifetime. However, the job variable to which it is linked is not automatically deleted. It must be deleted explicitly, using the FREE-VARIABLE command with the DESTROY-CONTAINER operand.
The following restrictions apply when variables that are linked to job variables are declared:
the variable must have the data type STRING
the variable contents must be no more than 256 bytes long
Reason: a data type attribute is not maintained in job variables and a maximum of 256 bytes are provided for the job variable value.
The variable is created just as it is declared in the DECLARE-VARIABLE command. However, the variable contents are not stored in class 5 memory; instead, they are stored in the job variable. Consequently, when the variable is accessed, the job variable is also accessed.
In the case of job variables, it is not possible to distinguish between uninitialized job variables (= “no value assigned”) and job variables with the contents “null string” (= string with the length 0, C’’). For this reason, the “uninitialized” state is currently defined as follows: a job variable is not initialized if it contains the string 256 X’EE’. For this reason, variables that are linked to job variables must not be assigned this string as a normal text string.