Example 9.19 Validating and Standardizing Complex Character Data

Goal

Validate character data values that can be stored in multiple patterns. When valid, reformat values to conform to one pattern.

Example Features

Featured StepDATA step
Featured Step Options and StatementsRegular expressions and associated functions: PRXCHANGE, PRXMATCH, PRXPARSE, and PRXPOSN CATS function
A Closer LookUnderstanding the Regular Expressions Defined in This Example

Input Data Sets

Data set NEWCONTACTS contains contact information about eight people. The values for each variable are not uniformly specified.

                                NEWCONTACTS

 Obs     contactname       contactphone   contactemail 1 Young Wilson, Karen (315) 555- 3210 karen.young.wilson@big-agency.gov 2 Denise M. Morris (607)555-0123 ...

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.