Examples of SAS Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
SAS Constants in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
SAS Variables in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
SAS Functions in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
SAS Operators in Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Chapter 7 • Dates, Times, and Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
About SAS Date, Time, and Datetime Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
About Date and Time Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Chapter 8 • Error Processing and Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Types of Errors in SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Error Processing in SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Debugging Logic Errors in the DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Chapter 9 • SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Definitions for SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Routing and Customizing SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Sample SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
The SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Chapter 10 • By-Group Processing in SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Definition of BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
References for BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Chapter 11 • WHERE-Expression Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Definition of WHERE-Expression Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Where to Use a WHERE Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Syntax of WHERE Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Combining Expressions By Using Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . 188
Improving Performance of WHERE Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Processing a Segment of Data That Is Conditionally Selected . . . . . . . . . . . . . . . . . . . 190
Deciding Whether to Use a WHERE Expression or a Subsetting IF Statement . . . . . 193
Chapter 12 • Optimizing System Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Definitions for Optimizing System Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Collecting and Interpreting Performance Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Techniques for Optimizing I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Techniques for Optimizing Memory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Techniques for Optimizing CPU Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Calculating Data Set Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Chapter 13 • Support for Parallel Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
What Is Threading Technology in SAS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
How Is Threading Controlled in SAS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Threading in Base SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
SAS/ACCESS Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
SAS Scalable Performance Data Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
SAS Intelligence Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
SAS High-Performance Analytics Portfolio of Products . . . . . . . . . . . . . . . . . . . . . . . 214
SAS Grid Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
SAS In-Database Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
SAS In-Memory Analytics Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
SAS High-Performance Analytics Product Integration . . . . . . . . . . . . . . . . . . . . . . . . 217
iv Contents