DQPARSETOKENGET Function

Returns a token from a parsed character value.

Valid in: DATA step, PROC SQL, and SCL
Restriction: Do not attempt to extract tokens from parsed values using any means other than the DQPARSETOKENGET function.
Requirement: If specified, the locale must be loaded into memory as part of the locale list.

Syntax

DQPARSETOKENGET(parsed-char, 'token', 'parse-definition' <,'locale'>)

Required Arguments

parsed-char

specifies a character constant, variable, or expression that contains the value that is the parsed character value from which the value of the specified token is returned.

To determine how the parse definition inserts delimiters, use the DQPARSEINFOGET function.

token

the name of the token that is returned from the parsed value. The token must be enabled by the specified parse definition

parse-definition

the name of the parse definition. The definition must exist in the locale that is used. The parse definition must be the same as the parse definition that originally parsed the PARSED-CHAR value.

Optional Argument

locale

specifies a character constant, variable, or expression that contains the locale name.

Default The default locale is the first locale in the locale list. If no value is specified, the default locale is used.

Details

The DQPARSETOKENGET function returns the value of the specified token from a previously parsed character value.

Example: DQPARSETOKENGET Function

The following example parses a character value with the DQPARSE function and extracts two of the tokens with the DQPARSETOKENGET function.
parsedValue=dqParse('Mrs. Sallie Mae Pravlik', 'NAME', 'ENUSA');
prefix=dqParseTokenGet(parsedValue, 'Name Prefix', 'NAME', 'ENUSA');
given=dqParseTokenGet(parsedValue, 'Given Name', 'NAME', 'ENUSA');
After these function calls, the value of prefix is Mrs. and the value of given is Sallie.