DQPATTERN Function

Returns a pattern analysis from an input character value.
Valid in: DATA step and SCL
Requirement: If specified, the locale must be loaded into memory as part of the locale list.

Syntax

DQPATTERN ('char' , 'pattern-analysis-definition' <,'locale'> )

Required Arguments

char
specifies a character constant, variable, or expression that contains the value that is the name of the input character value that is analyzed.
pattern-analysis-definition
the name of the pattern analysis definition. The definition must exist in the locale that is used.

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 DQPATTERN function returns a pattern analysis from an input character value. DQPATTERN identifies words or characters in the input value as numeric, alphabetic, non-alphanumeric, or mixed. The choice of pattern analysis definition determines the nature of the analysis as follows:
*
non-alphanumeric, such as punctuation marks or symbols
A
alphabetic
M
mixture of alphabetic, numeric, and non-alphanumeric
N
numeric

Example: DQPATTERN Function

The following example analyzes the words in the input character value. The results are written to the SAS log using the PUT statement.
pattern=dqPattern('WIDGETS 5','32CT','WORD','ENUSA');
put pattern;
The DQPATTERN function returns A N* M. Using the CHARACTER pattern analysis definition returns AAAAAAA N* NNAA.