SAS Institute. The Power to Know

SAS(R) Data Quality Server 9.2: Reference

Previous Page | Next Page

Functions and CALL Routines

DQPARSETOKENGET Function



Returns a token from a parsed character value.
Valid in: DATA step, PROC SQL, or SCL

Syntax
Details
Example
See Also

Syntax

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

parsed-char

is the parsed character value from which the value of the specified token will be returned. The parsed-char can be the name of a character variable, a character value in quotation marks, or an expression that evaluates to a variable name or a quoted value. The value must contain delimiters that are consistent with the specified parse definition. To determine how the parse definition inserts delimiters, use the DQPARSEINFOGET function.

token

specifies the name of the token that is returned from the parsed value.

Restriction: the token must be enabled by the specified parse definition.
parse-definition

specifies the name of the parse definition that will be used to obtain the value of the token. The parse definition must be the same as the parse definition that originally parsed the parsed-char value.

Restriction: the specified parse definition must exist in the specified locale
locale

(optional) specifies the name of the locale that contains the specified parse definition. The value can be a name in quotation marks, the name of a variable whose value is a locale name, or an expression that evaluates to a variable name or to a quoted locale name.

The specified locale must be loaded into memory as part of the locale list.

Default: the first locale in the locale list.
Restriction: if no value is specified, the default locale is used.
See: Load and Unload Locales.

Details

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

Note:   Do not attempt to extract tokens from parsed values using any means other than the DQPARSETOKENGET function.  [cautionend]


Example

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 the PREFIX variable is Mrs. and the value of the GIVEN variable is Sallie.


See Also

Previous Page | Next Page | Top of Page