1
SECTION 1 DATA Step Programming
CHAPTERS
1 Inputting Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
2 Reading and Writing from External Files . . . . . . . . . . . . . . . . . . . . . .15
3 Using Logical Structures: IF-THEN/ELSE, WHERE,
and SELECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
4 Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
5 Using Numerical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
6 Using Character Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
7 Working with Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
8 Using Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
9 Looking Back and Ahead Across Observations . . . . . . . . . . . . . . . . .57
10 Working with Longitudinal Data: Multiple Observations
per Subject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
11 Writing Simple DATA Step Reports . . . . . . . . . . . . . . . . . . . . . . . . . .69
2

Get The SAS Workbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.