EasyManua.ls Logo

IBM TSO/E REXX - Number; String; Variable

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
Loading...
A period in a template acts as a place holder. The data that corresponds to the
period is not assigned to a variable name. You can use a period as a "dummy
variable" within a group of variables or at the end of a template to collect unwanted
information.
PARSE VALUE 'Value with Periods in it.' WITH pattern . type .
/* pattern contains 'Value' */
/* type contains 'Periods' */
/* the periods replace the words "with" and "in it." */
String
You can use a string in a template to separate data as long as the data includes the
string as well. The string becomes the point of separation and is not included as
data.
phrase = 'To be, or not to be?' /* phrase containing comma */
PARSE VAR phrase part1 ',' part2 /* template containing comma */
/* as string separator */
/* part1 contains 'To be' */
/* part2 contains ' or not to be?' */
In this example, notice that the comma is not included with To be because the
comma is the string separator.
Variable
When you do not know in advance what string to specify as separator in a
template, you can use a variable enclosed in parentheses. The variable value must
be included in the data.
separator = ','
phrase = 'To be, or not to be?'
PARSE VAR phrase part1 (separator) part2
/* part1 contains 'To be' */
/* part2 contains ' or not to be?' */
Again, in this example, notice that the comma is not included with To be because
the comma is the string separator.
Number
You can use numbers in a template to indicate the column at which to separate
data. An unsigned integer indicates an absolute column position and a signed
integer indicates a relative column position.
v Absolute column position
An unsigned integer or an integer prefixed with an equal sign (=) in a template
separates the data according to absolute column position. The first segment
starts at column 1 and goes up to, but does not include, the information in the
column number specified. The subsequent segments start at the column
numbers specified.
quote = 'Ignorance is bliss.'
....+....1....+....2
PARSE VAR quote part1 5 part2
/* part1 contains 'Igno' */
/* part2 contains 'rance is bliss.' */
This example could have also been coded as follows. Note the explicit use of the
column 1 indicator prior to part1 that was implied in the previous example and
the use of the =5 part2 to indicate the absolute position, column 5.
quote = 'Ignorance is bliss.'
....+....1....+....2
Parsing Data
90
z/OS V1R1.0 TSO/E REXX Users Guide

Table of Contents

Related product manuals