SAS Quality Knowledge Base for Contact Information 27

Phone (Validation)

Identification Analysis Definition

Phone (Validation)
Description The Phone (Validation) identification analysis definition determines whether a string represents a valid phone number.
Possible Outputs VALID
INVALID
Examples Input Output
(514) 444-4444 VALID
(511) 444-4444 INVALID
(014) 444-4444 INVALID
(514) 411-4444 INVALID
333-3333 VALID
311-3333 INVALID
055-5555 INVALID
(514) 444-4444 x9 VALID
(514) 444-44449 INVALID
444-4444 x9 VALID
444-44449 INVALID
+51-4-444-444 VALID
+1 555 555 1212 INVALID
232 787 4477 INVALID
(777)777-7777 INVALID
(249)777-7777 VALID
514 728 4421 1234 VALID
Remarks

Requirements for validity:

  • The domestic area code must be within the range [2-9].
  • The second two digits of the domestic area code must not both be 1.
  • The area code must be a valid domestic area code.
  • The first digit of the base number must be within the range [2-9].
  • The second two digits of the base number must not both be 1.
  • In the absence of explicit indicators for extensions or country codes, the number of digits in the input cannot exceed or be less than 7 (if no area code is in the input), or 10 (if the area code is in the input).
  • A number cannot consist of 10 of the same digits.
  • If any or all of these rules fail, INVALID is returned.