Issuing TSO/E Commands from an Exec
Like a CLIST, a REXX exec can contain TSO/E commands to be executed when
the exec runs. An exec can consist of nothing but TSO/E commands, such as an
exec that sets up a user’s terminal environment by allocating the appropriate
libraries of data sets, or the exec can contain commands intermixed with REXX
language instructions.
Using Quotations Marks in Commands
Generally, to differentiate commands from other types of instructions, enclose the
command within single or double quotation marks. When issuing TSO/E commands
in an exec, it is recommended that you enclose them in double quotation marks. If
the command is not enclosed within quotation marks, it will be processed as an
expression and might end in error. For example, a word immediately followed by a
left parenthesis is processed by the language processor as a function call. Several
TSO/E commands, one of which is ALLOCATE, require keywords followed by
parentheses.
"ALLOC DA(NEW.DATA) LIKE(OLD.DATA) NEW"
If the ALLOCATE command in the example above was not enclosed in quotation
marks, the parentheses would indicate to the language processor that DA and LIKE
were function calls, and the command would end in an error.
Many TSO/E commands use single quotation marks within the command. For
example, the EXEC command encloses an argument within single quotation marks,
and other commands, such as ALLOCATE, require single quotation marks around
fully-qualified data set names.
EXEC myrexx.exec(add) '25 78 33' exec
ALLOC DA('USERID.MYREXX.EXEC') F(SYSEXEC) SHR REUSE
As REXX instructions, these commands can be entirely enclosed in double
quotation marks and still retain the single quotation marks for the specific
information within the command. For this reason, it is recommended that, as a
matter of course, you enclose TSO/E commands with double quotation marks.
"EXEC myrexx.exec(add) '25 78 33' exec"
"ALLOC DA('USERID.MYREXX.EXEC') F(SYSEXEC) SHR REUSE"
Remember that data set names beginning with your prefix (usually your user ID)
can be specified without the prefix and without quotation marks.
"ALLOC DA(MYREXX.EXEC) F(SYSEXEC) SHR REUSE"
More about data sets names and when to enclose them in quotation marks is
covered in the next topic.
Passing Data Set Names as Arguments
How you pass a data set name as an argument depends on the way you specify
the data set name and whether you invoke the exec explicitly or implicitly.
Ways to specify the data set name are controlled by the TSO/E naming
conventions, which define fully-qualified and non fully-qualified data sets. A
fully-qualified data set name specifies all three qualifiers including the prefix and
must appear within a set of quotation marks.
'userid.myrexx.exec'
Issuing TSO/E Commands from an Exec
98
z/OS V1R1.0 TSO/E REXX User’s Guide