Preventing Translation Of Input To Uppercase; Exercises - Using The Arg Instruction - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

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.

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
1. 115 -23 66 5.8
2. .2 0 569 2E6
3. 13 13 13 13
4. Weber Joe 91
5. Baker Amanda Marie 95
6. Callahan Eunice 88 62
ANSWERS
1. first = 115, second = -23, third = 66 5.8
2. first = .2, second = 0, third = 569, fourth = 2E6
EXEC rexx.exec(add) '42 21 10' exec
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'.'
Passing Information to an Exec
Variables Receiving Input
ARG first second third
ARG first second third fourth
ARG first second third fourth fifth
ARG lastname firstname score
PARSE ARG lastname firstname score
PARSE ARG lastname firstname score
Chapter 2. Writing and Running a REXX Exec
*/
*/
*/
23

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents