O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 9.2 Determining the Type of a Variable's Content

Goal

Determine whether a character variable's value contains numeric data, alphabetic text, missing data, or nonalphanumeric characters. Save the values that are determined to be numeric in a numeric variable.

Example Features

Featured StepDATA step
Featured Step Options and StatementsCOMPRESS, INPUT with ?? format modifier, NOTALPHA, REVERSE, STRIP, SUBSTR, and UPCASE functions
A Closer LookUnderstanding Functions That Evaluate the Content of Variable Values

Input Data Set

Data set CHEMTEST contains preliminary results of 14 lab samples in character variable CHEM_PPB. The values of CHEM_PPB contain a mix of alphanumeric and other characters.

 CHEMTEST Obs sample chem_ppb 1 57175 1250.3 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required