Meta Search
search across all the following databases:
Data Catalog
Data and documentation
KnowledgeBase
Common questions and answers.
Resources
Entire collection of data resources.
Lessons from North of the Border
Nerd Alert: Dictionary of Numbers
There are two ways to define numeric data in SAS input statements.
If you are reading numeric data (numbered values only) that are space delimited, and you are reading the variables sequentially, in your input statement, list the variable names one after the other.
data couple; infile /usr/shared/sb/marriage.dat; *input type hhid state sex race marstat occupation; if marstat=0 then ...
If you need to read only certain variables out of a numeric dataset, the input statement looks very similar except for column locations identifying where variables reside.
data couple; infile /usr/shared/sb/marriage.dat; *input hhid 2-7 state 8-9 race 12-13 occupation 17-19; if state=26 then ...
NOTE: There are certain instances when a numeral variable should be read as alpha-numeric. See note from "Reading alpha-numeric data" for details.