Advanced Topics In Parsing; Parsing Multiple Strings - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

When total=7 then new='purple'
When total=9 then new='orange'
When total=10 then new='green'
Otherwise new=var1
END
Say new; exit
Err:
say 'Input error--color is not "red" or "blue" or "yellow"'; exit
ARG converts alphabetic characters to uppercase before parsing. An example of ARG with the arguments
in the CALL to a subroutine is in section "Parsing Multiple Strings."
PARSE ARG works the same as ARG except that PARSE ARG does not convert alphabetic characters to
uppercase before parsing.
PARSE EXTERNAL
Say "Enter Yes or No =====> "
parse upper external answer 2 .
If answer='Y'
then say "You said 'Yes'!"
else say "You said 'No'!"
PARSE NUMERIC
parse numeric digits fuzz form
say digits fuzz form
PARSE PULL
PUSH '80 7'
parse pull fourscore seven /* Assigns: fourscore='80'; seven='7' */
SAY fourscore+seven
PARSE SOURCE
parse source sysname .
Say sysname
PARSE VALUE example is on page 203.
PARSE VAR examples are throughout the chapter, starting on page 204.
PARSE VERSION
parse version . level .
say level
PULL works the same as PARSE PULL except that PULL converts alphabetic characters to uppercase
before parsing.

Advanced Topics in Parsing

This section includes parsing multiple strings and flow charts depicting a conceptual view of parsing.

Parsing Multiple Strings

Only ARG and PARSE ARG can have more than one source string. To parse multiple strings, you can
specify multiple comma-separated templates. Here is an example:
parse arg template1, template2, template3
/* entered duplicates */
/* Displays: "purple" */
/* Displays: '9 0 SCIENTIFIC'
/* (if defaults are in effect)
/* Puts data on queue
/* Displays: "87"
/* Displays:
/* Displays: "3.48" */
*/
*/
*/
*/
"CICS"
*/
Parsing
211
Chapter 15. Parsing

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents