EXEC rexx.exec(add) '42 21 10' exec
The first variable following the ARG instruction,
number1
, is assigned the value 42.
The second variable gets both '21 10'. In this situation, the exec ends with an error
when it tries to add the two variables. In other situations, the exec might not end in
error.
To prevent the last variable from getting the remaining values, use a period (.) at
the end of the PULL or ARG instruction.
ARG number1 number2 .
The period acts as a "dummy variable" to collect unwanted extra information. If
there is no extra information, the period is ignored. You can also use a period as a
place holder within the PULL or ARG instruction as follows:
ARG . number1 number2
In this case, the first value, 42, is discarded and
number1
and
number2
get the next
two values, 21 and 10.
Preventing Translation of Input to Uppercase
Like the PULL instruction, the ARG instruction changes alphabetic characters to
uppercase. To prevent translation to uppercase, precede ARG with PARSE as
demonstrated in the following example.
Example of an Exec that Uses PARSE ARG
/**************************** REXX *********************************/
/* This exec receives the last name, first name, and score of
*/
/* a student and displays a sentence reporting the name and
*/
/* score.
*/
/*******************************************************************/
PARSE ARG lastname firstname score
SAY firstname lastname 'received a score of' score'.'
Exercises - Using the ARG Instruction
The left column shows the input values sent to an exec. The right column is the
ARG statement within the exec that receives the input. What value does each
variable assume?
Input
Variables Receiving Input
1. 115 -23 66 5.8
ARG first second third
2. .2 0 569 2E6
ARG first second third fourth
3. 13 13 13 13
ARG first second third fourth fifth
4. Weber Joe 91
ARG lastname firstname score
5. Baker Amanda Marie 95
PARSE ARG lastname firstname score
6. Callahan Eunice 88 62
PARSE ARG lastname firstname score
ANSWERS
1. first = 115, second = -23, third = 66 5.8
2. first = .2, second = 0, third = 569, fourth = 2E6
Passing Information to an Exec
Chapter 2. Writing and Running a REXX Exec
23
Содержание 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: ......