| Functions and CALL Routines |
| Valid in: | DATA step, PROC SQL, or SCL |
| Syntax | |
| Details | |
| Example | |
| See Also |
Syntax |
| DQPARSETOKENGET(parsed-char, 'token', 'parse-definition' <, 'locale'>) |
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.
specifies the name of the token that is returned from the parsed value.
| Restriction: | the token must be enabled by the specified 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 |
(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.
| 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 |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.