p (pattern match)

p (pattern match)


o (sort values ascending) Index Level pattern matching
Syntax p(matchstring){;(matchstring)...}
Category Processing Codes
Type Processing Code
Description tests a value and determines if it matches a pre-determined pattern "matchstring" composed of alphabetic, numeric or literal characters.

The "matchstring" may be a composite of literals and/or match operators, appended to length specifications. To be accepted for processing, the value must be the exact length of the length parameter. If the data does not match, null is returned.

The "p" processing code may be used as an output-conversion or input-conversion. As an input-conversion, the "p" code verifies input.

Match operators:

na   "n" alphabetic characters only.
mn   "m" numeric characters only.
nx   "n" alphanumeric characters.
"text"  any quoted text string. If a literal is specified, the "p" code tests for an exact match to that literal.

In all of the above cases which support a number, the exact number must be met or found to accept the data. "0" (zero) as the number allows for any number, including zero, to be accepted.

Multiple matchstring parameters will accept the data if any of the matchstrings are met. Pattern match operators must be separated by semicolons.  

If the data matches the pattern exactly, the data is returned. If the data does not match, null is returned.

The "p" code can be used as an output-conversion or input-conversion. As an input-conversion, the "p" code verifies input. Multiple pattern match.strings must be separated by semicolons.
Options
See Also u0070 input-conversion MATCH pattern matching Processing Codes
Example
Warnings
Compatibility D3 7.0 AP R83
o (sort values ascending) Index Level pattern matching