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.3 Determining Whether a Variable Is Character or Numeric

Goal

Determine whether a variable is character or numeric to ensure that you have the right type of data for your application.

Example Features

Featured StepDATA step
Featured Step Options and StatementsATTRN, CLOSE, INDEX, OPEN, UPCASE, VARNAME, and VARTYPE functions CALL SYMPUTX routine Open code macro variables
Related TechniquePROC SQL, DICTIONARY.COLUMNS table, INTO clause to create a macro variable, INDEX and UPCASE functions
A Closer LookUsing the SAS File I/O Functions Specifying Variable Lists

Input Data Set

Data set ENTRANCE_EXAM stores exam results for 15 applicants to an academic program. The results are saved in a mix of character and numeric variables.

 ENTRANCE_EXAM ...

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