1 Checking Values of Character Variables

Introduction

Using PROC FREQ to List Values

Description of the Raw Data File PATIENTS.TXT

Using a DATA Step to Check for Invalid Values

Describing the VERIFY, TRIM, MISSING, and NOTDIGIT Functions

Using PROC PRINT with a WHERE Statement to List Invalid Values

Using Formats to Check for Invalid Values

Using Informats to Remove Invalid Values

Introduction

There are some basic operations that need to be routinely performed when dealing with character data values. You may have a character variable that can take on only certain allowable values, such as ‘M’ and ‘F’ for gender. You may also have a character variable that can take on numerous values but the values must fit a certain pattern, such as a single ...

Get Cody's Data Cleaning Techniques Using SAS, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.