NET/MASTER Network Control Language (NCL) Reference Manual

Using PARSE and SEGMENT
Verb Syntax and Variable Access Methods
11–28 106126 Tandem Computers Incorporated
PARSE VARS=&A* PARSE=NO SEGMENT=1 DATA="Some - text."
The results are:
&A1 = S
&A2 = o
&A3 = m
&A4 = e
&A5 = space
&A6 = -
&A7 = space
&A8 = t
&A9 = e
&A10 = x
&A11 = t
&A12 = .
Specifying the Text to Delimit
You use the PARSE verb with the DATA keyword to specify the text to delimit. This
keyword must be the last because the text is treated as the rest of the statement.
You can supply any text on the DATA keyword (including null text or a variable
specification).
Specifying the Delimiter
You can use the DELIM keyword in the PARSE verb to specify a delimiter character or
a number of delimiter characters. When a string is being parsed, the delimiter
character(s) are used to delimit the end of a section of the string. The section, without
the delimiter character(s), is placed in the next target variable and the parsing process
continues. Delimiter characters are not placed into a target variable.
The default delimiter is a blank. Multiple blanks are compressed into a single blank.
You can only use the DELIM keyword if you specify PARSE=YES (to split the string
into words). The DELIM keyword is mutually exclusive with PARSE=NO (since you
cannot specify a delimiter character if the string is split into bytes).
The following examples show how a string is split by using different delimiters:
PARSE DELIM="," ARGS DATA="123,456,789"
The results are:
&1 = 123
&2 = 456
&3 = 789