Parsing instructions summary, Parsing instructions examples – IBM SC34-5764-01 User Manual

Page 232

Advertising
background image

Converts alphabetic characters to uppercase
before parsing

Maintains alphabetic characters in case entered

ARG

PARSE UPPER ARG

PARSE ARG

PARSE UPPER EXTERNAL

PARSE EXTERNAL

PARSE UPPER NUMERIC

PARSE NUMERIC

PULL

PARSE UPPER PULL

PARSE PULL

PARSE UPPER SOURCE

PARSE SOURCE

PARSE UPPER VALUE

PARSE VALUE

PARSE UPPER VAR

PARSE VAR

PARSE UPPER VERSION

PARSE VERSION

The ARG instruction is simply a short form of PARSE UPPER ARG. The PULL instruction is simply a short
form of PARSE UPPER PULL. If you do not desire uppercase translation, use PARSE ARG (instead of
ARG or PARSE UPPER ARG) and use PARSE PULL (instead of PULL or PARSE UPPER PULL).

Parsing Instructions Summary

Remember: All parsing instructions assign parts of the source string into the variables named in the
template. The following table summarizes where the source string comes from.

Instruction

Where the source string comes from

ARG

PARSE ARG

Arguments you list when you call the program or arguments in the call to a
subroutine or function.

PARSE EXTERNAL

Next line from terminal input buffer

PARSE NUMERIC

Numeric control information (from NUMERIC instruction).

PULL

PARSE PULL

The string at the head of the external data queue. (If queue empty, uses default
input, typically the terminal.)

PARSE SOURCE

System-supplied string giving information about the executing program.

PARSE VALUE

Expression between the keyword VALUE and the keyword WITH in the instruction.

PARSE VAR name

Parses the value of name.

PARSE VERSION

System-supplied string specifying the language, language level, and (three-word)
date.

Parsing Instructions Examples

All examples in this section parse source strings into words.

ARG

/* ARG with source string named in REXX program invocation

*/

/*

Program name is PALETTE.

Specify 2 primary colors (yellow,

*/

/*

red, blue) on call.

Assume call is: palette red blue

*/

arg var1 var2

/* Assigns: var1='RED'; var2='BLUE' */

If var1<>'RED' & var1<>'YELLOW' & var1<>'BLUE' then signal err
If var2<>'RED' & var2<>'YELLOW' & var2<>'BLUE' then signal err
total=length(var1)+length(var2)
SELECT;

Parsing

210

CICS TS for VSE/ESA: REXX Guide

Advertising