P Code

The P code compares data to a specified pattern of numeric, alphabetic, alphanumeric, or literal characters. Patterns must be enclosed in parentheses and may be specified as outlined in the syntax description.

Format

P (pattern) [; (pattern)…]

Parameter(s)

pattern

Can be specified using any of the specifications below.

nA

Integer followed by the letter A, which tests for n alphabetic characters

nN

Integer followed by the letter N, which tests for n numeric characters.

nX

Integer followed by the letter X, which tests for n alphanumeric characters.

'string '

Literal string, which tests for that literal string. The string must be enclosed in single quotes. Single-character delimiters need not be treated as literal strings—that is, they need not be enclosed in quotation marks.

;

(semicolon) May be used to test for more than one pattern.

Example

For example, to test for telephone numbers of 7, 10, and 11 digits, use this P correlative:

P (3N-4N) ; (3N-3N-4N) ; (1N-3N-3N-4N)

In this example, the P correlative ensures that only Social Security numbers are included in INFO/ACCESS reports:

P (3N-2N-4N)

The preceding P code tests for strings of exactly three numbers, then a hyphen, then exactly two numbers, then a hyphen, then exactly four numbers.

See Also

Testing Data

L Code

R Code