Using Variables In Commands - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

A non fully-qualified data set name can eliminate the prefix and is not enclosed
within quotation marks.
myrexx.exec
If you use the EXEC command to explicitly invoke an exec, the EXEC command
processor requires a set of single quotation marks around the argument. When
passing a non fully-qualified data set name as an argument, you need not add
additional quotation marks. The following EXEC command is issued at the READY
prompt and passes the data set name REXX.INPUT as an argument to the exec
contained in MYREXX.EXEC(TEST2). Both data sets are specified as non
fully-qualified data set names.
READY
When passing a fully-qualified data set name as an argument with the EXEC
command, you must include more than one set of quotation marks; one to indicate
it is a fully-qualified data set and one to indicate it is the argument to be passed.
Because TSO/E commands process two sets of single quotation marks as one and
do not recognize double quotation marks as does the language processor, you must
use three sets of single quotation marks. The following EXEC command passes
USERID.REXX.INPUT as an argument expressed as a fully-qualified data set
name.
READY
When passing a non fully-qualified data set name as an argument while implicitly
invoking the exec, you need no quotation marks.
READY
To pass a fully-qualified data set name as an argument while implicitly invoking an
exec, enclose the data set name in a single set of quotation marks.
READY

Using Variables in Commands

When a variable is used in a TSO/E command, the variable cannot be within
quotation marks if its value is to be substituted. Only variables outside quotation
marks are processed by the language processor. For example, the variable name is
assigned the data set name MYREXX.EXEC. When name is used in a LISTDS
command, it must remain outside the quotation marks placed around the command.
name = myrexx.exec
"LISTDS" name "STATUS"
When a variable represents a fully-qualified data set name, the name must be
enclosed in two sets of quotation marks to ensure that one set of quotation marks
remains as part of the value.
name = "'project.rel1.new'"
"LISTDS" name "STATUS"
Another way to ensure that quotation marks appear around a fully-qualified data set
name when it appears as a variable is to include them as follows:
name = project.rel1.new
"LISTDS '"name"' STATUS"
EXEC myrexx.exec(test2) 'rexx.input' exec
EXEC myrexx.exec(test2) 'userid.rexx.input'' exec
test2 rexx.input
test2 'userid.rexx.input'
Issuing TSO/E Commands from an Exec
Chapter 8. Entering Commands from an Exec
99

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents