Differences between REXX variables and substitution variables

A summary of the differences between REXX variables and substitution variables in procedures with logic.

The following table shows the differences between REXX variables and substitution variables. It also shows how each is used in a procedure with logic.

Table 1. REXX variables versus substitution variables in a procedure with logic
REXX variables Substitution variables
Name is made up of alphanumeric characters in lower case or upper case. For example:

what_2_do

Name must begin with an ampersand (&), followed by alphanumeric or special characters. For example:
&DEPARTMENT
Can be used in REXX statements. For example:
if progname = '' then
Can be used in QMF commands. For example:
"RUN QUERY MYQUERY (FORM =
&FORMNAME"
Can be given a value on the RUN PROC command using the QMF ARG parameter and the REXX ARG parameter. For example:
RUN PROC MYPROC (ARG=MONDAY
 
arg whichday
Can be given a value on the RUN PROC command. For example:
"RUN PROC MYPROC (&&FORMNAME =
MYFORM"
Can be given a value using a QMF global variable and the QMF GET GLOBAL command. For example:
"GET GLOBAL (WHO_IS_IT =
DSQAO_CONNECT_ID"
Automatically assigned a value by QMF at the time the command is run if a global variable by that name has been set (if the substitution variable has not already been given a value).
Can be used to set a global variable value using the QMF SET GLOBAL command. For example:
"SET GLOBAL (JOBTYPE =" JOBVAR
Cannot be used to set a global variable value.