Example 9.3 Determining Whether a Variable Is Character or Numeric


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.


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.