Commands
expression;The expression is evaluated, resulting in a character string (which can be the null string), which is then prepared as appropriate and submitted to the host command environment. Any part of the expression not to be evaluated should be enclosed in quotation marks.
The environment then processes the command, which might have side-effects. It eventually returns control to the language processor, after setting a return code. A return code is a string, typically a number, that returns some information about the command that has been processed. A return code usually indicates if a command was successful or not but can also represent other information. The language processor places this return code in the REXX special variable RC. See Special variables.
In addition to setting a return code, the underlying
system might also indicate to the language processor if an error or
failure occurred. An error is a condition raised by a command
for which a
program that uses that command would usually be expected to be prepared.
(For example, a locate command to an editing system might report requested
string not found as an error.) A failure is a condition
raised by a command for which a program
that uses that command would not usually be expected to recover
(for example, a command that is not executable or cannot be found).
Errors and failures in commands can affect REXX processing if a
condition trap for ERROR or FAILURE is ON (see Conditions and condition traps). They might also cause the command
to be traced if TRACE E or TRACE F is
set. TRACE Normal is the same as TRACE F and
is the default—see TRACE.
mydata = "PROGA.LOAD"
"FREE DATASET("mydata")" would result in the string FREE
DATASET(PROGA.LOAD) being submitted to TSO/E. Of course,
the simpler expression: "FREE DATASET(PROGA.LOAD)" would
have the same effect in this case.Recommendation: Whenever you use a host command in a REXX program, enclose the command in double quotation marks. See z/OS TSO/E REXX User's Guide for a description of using single and double quotation marks in commands.
On return, the return code from the FREE command is placed in the REXX special variable RC. The return code in RC is ‘0’ if the FREE command processor successfully freed the data set or ‘12’ if it did not. Whenever a host command is processed, the return code from the command is placed in the REXX special variable RC.
Remember that the expression is evaluated before it is passed to the environment. Enclose in quotation marks any part of the expression that is not to be evaluated.