
3. first = 13, second = 13, third = 13, fourth = 13, fifth =
null
4. lastname = WEBER, firstname = JOE, score = 91
5. lastname = Baker, firstname = Amanda, score = Marie 95
6. lastname = Callahan, firstname = Eunice, score = 88
Passing Arguments
Values passed to an exec are usually called arguments. Arguments can consist of
one word or a string of words. Words within an argument are separated by blanks.
The number of arguments passed depends on how the exec is invoked.
Passing Arguments Using the CALL Instruction or REXX
Function Call
When you invoke a REXX exec using either the CALL instruction or a REXX
function call, you can pass up to 20 arguments to an exec. Each argument must be
separated by a comma.
Passing Arguments Using the EXEC Command
When you invoke a REXX exec either implicitly or explicitly using the EXEC
command, you can pass either one or no arguments to the exec. Thus the ARG
instruction in the preceding examples received only one argument. One argument
can consist of many words. The argument, if present, will appear as a single string.
If you plan to use commas within the argument string when invoking a REXX exec
using the EXEC command, special consideration must be given. For example, if
you specify:
GETARG 1,2
or
ex 'sam.rexx.exec(getarg)' '1,2'
the exec receives a single argument string consisting of
″
1,2
″
. The exec could then
use a PARSE ARG instruction to break the argument string into the
comma-separated values like the following:
PARSE ARG A ',' B
SAY 'A is ' A
/* Will say 'A is 1' */
SAY 'B is ' B
/* Will say 'B is 2' */
However, because commas are treated as separator characters in TSO/E, you
cannot pass an argument string that contains a leading comma using the implicit
form of the EXEC command. That is, if you invoke the exec using:
GETARG ,2
the exec is invoked with an argument string consisting of
″
2
″
. The leading comma
separator is removed before the exec receives control. If you need to pass an
argument string separated by commas and the leading argument is null (that is,
contains a leading comma), you must use the explicit form of the EXEC command.
For example:
ex 'sam.rexx.exec(getarg)' ',2'
In this case, the exec is invoked with an argument string consisting of
″
,2
″
.
For more information about functions and subroutines, see “Chapter 6. Writing
Subroutines and Functions” on page 69. For more information about arguments, see
“Parsing Multiple Strings as Arguments” on page 92.
Passing Information to an Exec
24
z/OS V1R1.0 TSO/E REXX User’s Guide
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......