SAS Institute. The Power to Know

SAS(R) Data Quality Server 9.2: Reference

Previous Page | Next Page

Functions and CALL Routines

DQPARSE CALL Routine



Returns a parsed character value and a status flag.
Valid in: DATA step, PROC SQL, or SCL

Syntax
Details
Example
See Also

Syntax

CALL DQPARSE(parse-string, 'parse-definition', 'parse-result' , 'parse-return-code' ,<, ' locale'>)

parse-string

is the input value that is parsed according to the specified parse definition. The value 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.

parse-definition

specifies the name of the parse definition.

parse-result

is an output character variable that receives the result of the parse operation.

parse-return-code

is an output numeric variable that returns 1.0 when the parse operation is successful. Otherwise, this variable receives a 0.

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 DQPARSE CALL routine returns a parsed character value and a return code into separate variables. The parsed character 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.

Note:   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.  [cautionend]


Example

The following example parses the name of an individual.

data a;
    length parsename $ 40;
    call dqparse (name, 'Name', parsename, solution);
    if solution = 1 then
      put 'found solution';
    else
      put 'no solution';
run;


See Also

Previous Page | Next Page | Top of Page