NET/MASTER Network Control Language (NCL) Reference Manual

Using PARSE and SEGMENT
Verb Syntax and Variable Access Methods
106126 Tandem Computers Incorporated 11–29
PARSE DELIM=":,-" ARGS DATA="AAA:BBB,$DDD*EEE-FFF;"
The results are:
&1 = AAA
&2 = BBB
&3 = $DDD*EEE
&4 = FFF;
Keeping a Remainder
You can use the PARSE verb with the REMSTR keyword to specify a variable to hold
any text unassigned to a variable after parsing. Here is an example:
PARSE VARS=(&A,&B,&C) REMSTR=&D DATA="This is a text message"
The results are:
&A = This
&B = is
&C = a
&D = text message
Handling Blanks and Nulls
You can use the OPT keyword (in the PARSE verb only) to specify what to do with
blanks and nulls.
OPT=ASIS causes leading and trailing blanks to be preserved when text is assigned
into target variables. If OPT=ASIS is not specified, leading and trailing blanks are
stripped from the parsed sections as they are placed into variables. In the following
example, which omits OPT=ASIS, blanks are stripped from the text as the text is
delimited and assigned into target variables:
PARSE DELIM="," ARGS DATA="123, 456,789, ABC"
The results are:
&1 = 123
&2 = 456
&3 = 789
&4 = ABC
However, in the following example, which specifies OPT=ASIS, blanks are preserved
in the text, as the text is delimited and assigned into target variables:
PARSE DELIM="," ARGS OPT=ASIS DATA="123, 456,789, ABC"
The results are:
&1 = 123
&2 = 456
&3 = 789
&4 = ABC