Contents
What's New in the 9.4 Base SAS Language Reference: Concepts . . . . . . . . . . . . . . . . . . xi
Accessibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
PART 1 SAS System Concepts 1
Chapter 1 • Essential Concepts of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
What Is SAS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Overview of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Components of the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Ways to Run Your SAS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Customizing Your SAS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Conceptual Information about Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 2 • SAS Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Definition of SAS Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Types of Input to a SAS Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
The DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
The PROC Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
SAS Processing Restrictions for Servers in a Locked-Down State . . . . . . . . . . . . . . . . 17
Chapter 3 • Rules for Words and Names in the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Words in the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Names in the SAS Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Chapter 4 • SAS Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Definition of SAS Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
SAS Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Ways to Create Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Variable Type Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Aligning Variable Values in SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Reordering Variables in SAS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Automatic Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
SAS Variable Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Dropping, Keeping, and Renaming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Encrypting Variable Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Numerical Accuracy in SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Chapter 5 • Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Definition of Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Creating Special Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Order of Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
When Variable Values Are Automatically Set to Missing by SAS . . . . . . . . . . . . . . . . 86
When Missing Values Are Generated by SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Working with Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Chapter 6 • Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Definitions for SAS Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
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
Chapter 14 • The SAS Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Introduction to the SAS Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Managing the SAS Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Configuring Your Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Chapter 15 • Printing with SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Configuring Universal Printing Using the Windowing Environment . . . . . . . . . . . . . 257
System Options That Control Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Managing Universal Printers Using the PRTDEF Procedure . . . . . . . . . . . . . . . . . . . . 276
Forms Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Using Fonts with Universal Printers and SAS/GRAPH Devices . . . . . . . . . . . . . . . . . 283
Creating EMF (Enhanced Metafile Format) Graphics Using Universal Printing . . . . 300
Creating GIF Images Using Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Creating PCL (Printer Command Language) Files Using Universal Printing . . . . . . . 305
Creating PDF Files Using Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Creating PNG (Portable Network Graphics) Files Using Universal Printing . . . . . . . 309
Creating PostScript Files Using Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing . . . . . . . . . 314
Creating TIFF Images Using Universal Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
Creating Animated GIF Images and SVG Documents . . . . . . . . . . . . . . . . . . . . . . . . . 343
PART 2 Windowing Environment Concepts 353
Chapter 16 • Introduction to the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . 355
What Is the SAS Windowing Environment? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Main Windows in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . 356
Navigating in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Getting Help in SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
List of SAS Windows and Window Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Chapter 17 • Managing Your Data in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . 375
Introduction to Managing Your Data in the SAS Windowing Environment . . . . . . . . 376
Managing Data with SAS Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Working with VIEWTABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Subsetting Data By Using the WHERE Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Exporting a Subset of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Importing Data into a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
PART 3 DATA Step Concepts 399
Chapter 18 • DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Why Use a DATA Step? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Overview of DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Processing a DATA Step: A Walk-through . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
About DATA Step Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
About Creating a SAS Data Set with a DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Writing a Report with a DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
The DATA Step and ODS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
DATA Step Processing Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Contents v
Chapter 19 • Reading Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Definition of Reading Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Ways to Read Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Types of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Sources of Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Reading Raw Data with the INPUT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
How SAS Handles Invalid Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Reading Missing Values in Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Reading Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
Reading Column-Binary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Chapter 20 • BY-Group Processing in the DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Definitions for BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Syntax for BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
Understanding BY Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Invoking BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
Determining Whether the Data Requires Preprocessing for BY-Group Processing . . . 453
Preprocessing Input Data for BY-Group Processing . . . . . . . . . . . . . . . . . . . . . . . . . . 453
How the DATA Step Identifies BY Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
Processing BY-Groups in the DATA Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Chapter 21 • Reading, Combining, and Modifying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . 465
Definitions for Reading, Combining, and Modifying SAS Data Sets . . . . . . . . . . . . . 465
Overview of Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Reading SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Combining SAS Data Sets: Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
Combining SAS Data Sets: Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Error Checking When Using Indexes to Randomly Access or Update Data . . . . . . . . 507
Chapter 22 • Using DATA Step Component Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Introduction to DATA Step Component Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Using the Hash Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Using the Hash Iterator Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Using the Java Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Chapter 23 • Array Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Definitions for Array Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
A Conceptual View of Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Syntax for Defining and Referencing an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Processing Simple Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Variations on Basic Array Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Multidimensional Arrays: Creating and Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Specifying Array Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Examples of Array Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
PART 4 SAS Files Concepts 573
Chapter 24 • SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Definition of a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Library Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Library Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Library Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Permanent and Temporary Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Definition of a Metadata-Bound Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
vi Contents
SAS System Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
Sequential Data Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Tools for Managing Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Chapter 25 • SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Definition of a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Descriptor Information for a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
Data Set Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Data Set Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Special SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Sorted Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Tools for Managing Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Viewing and Editing SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Chapter 26 • SAS Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Definition of a SAS Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Differences between Data Files and SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Understanding the Observation Count in a SAS Data File . . . . . . . . . . . . . . . . . . . . . . 608
Understanding an Audit Trail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Understanding Generation Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
Understanding Integrity Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
Understanding SAS Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Extended Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
Compressing Data Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
Extending the Observation Count for a 32-Bit SAS Data File . . . . . . . . . . . . . . . . . . . 662
Chapter 27 • SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Definition of SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Benefits of Using SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
When to Use SAS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
DATA Step Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
PROC SQL Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
Comparing DATA Step and PROC SQL Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
SAS/ACCESS Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Chapter 28 • Stored Compiled DATA Step Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Definition of a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . 679
Uses for Stored Compiled DATA Step Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Restrictions and Requirements for Stored Compiled DATA Step Programs . . . . . . . . 680
How SAS Processes Stored Compiled DATA Step Programs . . . . . . . . . . . . . . . . . . . 680
Creating a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
Executing a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
Differences between Stored Compiled DATA Step Programs and DATA Step Views 686
Example of DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
Chapter 29 • DICTIONARY Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
Definition of a DICTIONARY Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
How to View DICTIONARY Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Chapter 30 • SAS Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Definition of a SAS Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
SAS Catalog Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Tools for Managing SAS Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
Profile Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
Catalog Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
Contents vii
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.5.201