Functions and CALL Routines |
Returns a parsed character value.
Requirement: |
If specified, the locale must be loaded
into memory as part of the locale list.
|
Restriction: |
Always use the DQPARSETOKENGET function
to extract tokens from parsed values. To extract tokens from values that do
not contain delimiters, use the DQTOKEN function.
|
Valid in: |
DATA step, PROC SQL, and SCL
|
DQPARSE ( 'parse-definition','parse-string',<,'locale'>)
|
- parse-definition
-
is the name of the parse definition. The definition must
exist in the locale that is used.
- parse-string
-
is the value that is parsed according to the specified parse
definition. The value must be the name of a character variable, or a character
value in quotation marks. Also valid, an expression that evaluates to a variable
name or quoted value.
- 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. |
The DQPARSE function returns a parsed character value.
The return value contains delimiters that identify the elements in the value
that correspond to the tokens that are enabled by the parse definition. The
delimiters in the value allow functions such as DQPARSETOKENGET to access
the elements in the value based on specified token names.
The following example parses the name of an individual. Then the DQPARSETOKENGET
function returns the values of two of the tokens.
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.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.