| Functions and CALL Routines |
| Valid in: | DATA step, PROC SQL, and SCL |
| Syntax | |
| Details | |
| Example |
Syntax |
| DQPATTERN(char, `pattern-analysis-definition' <, `locale'>); |
is the name of the value that will be analyzed. The value can be a character variable, a character value in quotation marks, or an expression that evaluates to a variable name or a quoted value.
specifies the name of the definition that will be referenced during the creation of the pattern analysis. The definition must exist in the specified locale.
(optional) specifies the name of the locale that contains the specified pattern analysis 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. If no value is specified, the default locale is used. The default locale is the first locale in the locale list. For information on the locale list, see Load and Unload Locales.
| Details |
The pattern analysis that is returned by the DQPATTERN function 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.
Available return values are defined as follows:
| * |
non-alphanumeric, such as punctuation marks or symbols. |
| A |
alphabetic |
| M |
mixture of alphabetic, numeric, and non-alphanumeric. |
| N |
numeric |
| Example |
The following example analyzes the words in an input character value and displays the results in the SAS log:
pattern=dqPattern('WIDGETS 5" 32CT', 'WORD', 'ENUSA'); put pattern;
The value of the PATTERN variable after this function call would be A N* M. Using the CHARACTER pattern analysis definition returns the value AAAAAAA N* NNAA.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.