NET/MASTER Network Control Language (NCL) Reference Manual
PARSE
Verbs
3–144 106126 Tandem Computers Incorporated
PARSE The PARSE verb splits a data string into sections according to specified delimiters.
You use this verb to define the delimiters and variables for splitting a string and
capturing the different sections of it. A complete string can be parsed in one
operation.
The parse proceeds from left to right through the data until all text has been parsed or
all target variables have been assigned a value. Data remaining after all variables have
been assigned a value may (optionally) be assigned to a residual variable, specified by
the REMSTR operand of this verb.
Delimiter characters are never included in the resultant variables.
The second of multiple blanks is ignored if a blank has been specified as the delimiter.
Once two blanks are found, any further blanks are not recognized as delimiters until a
nonblank character is encountered.
On completion of the PARSE verb, the &SYS.VARCNT system variable is set to the
number of variables created or modified by the operation.
PARSE { [ ARGS [ RANGE=(
start
,
end
) ] [ SEGMENT=
n
] ] |
[ VARS={
input-vars-list
|
variable*
}
[ RANGE=(
start
,
end
) ] [ SEGMENT=
n
] ] }
[ DELIM=
text
]
[ OPT=
optlist
]
[ PARSE=NO | YES ]
[ REMSTR=
name
]
DATA=
rest-of-statement
optlist
= ASIS [, NONULLS ]
ARGS
specifies a range of generated variables for receiving the string. See “Frequently
Occurring Operands,” at the beginning of this section, for more information. If too
few variables are specified, data is missing. Excess variables are given no value—
they are set to the null string.
RANGE=(
start
,
end
)
determines the range of variables specified by the ARGS operand. See
“Frequently Occurring Operands,” at the beginning of this section, for more
information.
SEGMENT=
n
specifies the amount of data (in bytes) to be put into the variables specified.
See “Frequently Occurring Operands,” at the beginning of this section, for
more information.