EasyManuals Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #106 background imageLoading...
Page #106 background image
Instructions that Parse
There are several REXX instructions and variations of instructions that parse data.
PULL Instruction
In earlier chapters PULL was described as an instruction that reads input from the
terminal and assigns it to one or more variables. If however, the data stack contains
information, the PULL instruction takes information from the data stack; and when
the data stack is empty, PULL takes information from the terminal. For information
about the data stack, see Chapter 11. Storing Information in the Data Stack on
page 135. PULL changes character information to uppercase and assigns it to one
or more variable names. When PULL is followed by more than one variable, it
parses the information into the available variables.
SAY 'What is the quote for the day?' /* user enters "Knowledge */
/* is power." */
PULL word1 word2 word3
/* word1 contains 'KNOWLEDGE' */
/* word2 contains 'IS' */
/* word3 contains 'POWER.' */
The PARSE PULL instruction assigns information, without altering it, to variable
names.
SAY 'What is the quote for the day?' /* user enters "Knowledge */
/* is power." */
PARSE PULL word1 word2 word3
/* word1 contains 'Knowledge' */
/* word2 contains 'is' */
/* word3 contains 'power.' */
PARSE UPPER PULL causes the same result as PULL in that it changes character
information to uppercase before assigning it to one or more variables.
ARG Instruction
The ARG instruction takes information passed as arguments to an exec, function, or
subroutine, and puts it into one or more variable names. Before character
information is put into a variable name, ARG changes it to uppercase. When ARG is
followed by more than one variable name, it parses the information into the
available variable names. For example, if an exec named
USERID.REXX.EXEC(QUOTE) can receive arguments, you can invoke the exec
with the EXEC command and the three arguments as follows:
EXEC rexx.exec(quote) 'Knowledge is power.' exec
The exec receives the arguments with the ARG instruction as follows:
ARG word1 word2 word3
/* word1 contains 'KNOWLEDGE' */
/* word2 contains 'IS' */
/* word3 contains 'POWER.' */
The PARSE ARG instruction assigns information, without altering it, to variable
names.
PARSE ARG word1 word2 word3
/* word1 contains 'Knowledge' */
/* word2 contains 'is' */
/* word3 contains 'power.' */
PARSE UPPER ARG causes the same result as ARG in that it changes character
information to uppercase before assigning it to one or more variables.
Parsing Data
88
z/OS V1R1.0 TSO/E REXX Users Guide

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals