Table Of ContentStep-by-Step Programming with
Base SAS 9.4
®
Second Edition
SAS® Documentation
The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2016. Step-by-Step Programming
with Base SAS® 9.4, Second Edition. Cary, NC: SAS Institute Inc.
Step-by-Step Programming with Base SAS® 9.4, Second Edition
Copyright © 2016, SAS Institute Inc., Cary, NC, USA
ISBN 978-1-62959-894-9 (Hard copy)
ISBN 978-1-62960-806-8 (PDF)
All Rights Reserved. Produced in the United States of America.
For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission
of the publisher, SAS Institute Inc.
For a web download or e-book: Your use of this publication shall be governed by the terms established by the
vendor at the time you acquire this publication.
The scanning, uploading, and distribution of this book via the Internet or any other means without the permission of
the publisher is illegal and punishable by law. Please purchase only authorized electronic editions and do not
participate in or encourage electronic piracy of copyrighted materials. Your support of others’ rights is appreciated.
U.S. Government License Rights; Restricted Rights: The Software and its documentation is commercial computer
software developed at private expense and is provided with RESTRICTED RIGHTS to the United States
Government. Use, duplication, or disclosure of the Software by the United States Government is subject
to the license terms of this Agreement pursuant to, as applicable, FAR 12.212, DFAR 227.7202-1(a), DFAR
227.7202-3(a), and DFAR 227.7202-4, and, to the extent required under U.S. federal law, the minimum restricted
rights as set out in FAR 52.227-19 (DEC 2007). If FAR 52.227-19 is applicable, this provision serves as notice under
clause (c) thereof and no other notice is required to be affixed to the Software or documentation. The Government’s
rights in Software and documentation shall be only those set forth in this Agreement.
SAS Institute Inc., SAS Campus Drive, Cary, NC 27513-2414
November 2016
SAS® and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS
Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are trademarks of their respective companies.
SAS software may be provided with certain third-party software, including but not limited to open-source software,
which is licensed under its applicable third-party software license agreement. For license information about third-
party software distributed with SAS software, refer to http://support.sas.com/thirdpartylicenses.
9.4-P2:basess
Contents
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
What’s New in Step-by-Step Programming with Base SAS 9.4 . . . . . . . . . . . . . . . . . . . xix
Accessibility Features of Step-by-Step Programming with Base SAS 9.4 . . . . . . . . . . . xxi
Introduction to the SAS System
PART 1 1
Chapter 1 • What is the SAS System? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Introduction to the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Components of Base SAS Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Output Produced by the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Ways to Run SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Running Programs in the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . 13
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2 • Working with Output Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Working with Output Defaults Starting in SAS 9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Getting Your Data into Shape
PART 2 25
Chapter 3 • Introduction to DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Introduction to DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The SAS Data Set: Your Key to the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
How the DATA Step Works: A Basic Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Supplying Information to Create a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Chapter 4 • Starting with Raw Data: The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Introduction to Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Examine the Structure of the Raw Data: Factors to Consider . . . . . . . . . . . . . . . . . . . . 52
Reading Unaligned Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Reading Data That Is Aligned in Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Reading Data That Requires Special Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Reading Unaligned Data with More Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Mixing Styles of Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Chapter 5 • Starting with Raw Data: Beyond the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Introduction to Beyond the Basics with Raw Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Testing a Condition Before Creating an Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Creating Multiple Observations from a Single Record . . . . . . . . . . . . . . . . . . . . . . . . . 73
Reading Multiple Records to Create a Single Observation . . . . . . . . . . . . . . . . . . . . . . 77
iv Contents
Problem Solving: When an Input Record Unexpectedly Does Not
Have Enough Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Chapter 6 • Starting with SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Introduction to Starting with SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Understanding the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Reading Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Reading Selected Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Creating More Than One Data Set in a Single DATA Step . . . . . . . . . . . . . . . . . . . . . . 99
Using the DROP= and KEEP= Data Set Options for Efficiency . . . . . . . . . . . . . . . . . 101
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Basic Programming
PART 3 105
Chapter 7 • Understanding DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Overview of DATA Step Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Adding Information to a SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Defining Enough Storage Space for Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Conditionally Deleting an Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Chapter 8 • Working with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Introduction to Working with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
About Numeric Variables in SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Calculating with Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Comparing Numeric Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Storing Numeric Variables Efficiently . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Chapter 9 • Working with Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Introduction to Working with Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Identifying Character Variables and Expressing Character Values . . . . . . . . . . . . . . . 131
Setting the Length of Character Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Creating New Character Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Saving Storage Space by Treating Numbers as Characters . . . . . . . . . . . . . . . . . . . . . 142
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Chapter 10 • Acting on Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Introduction to Acting on Selected Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Selecting Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Constructing Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Comparing Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Contents v
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Chapter 11 • Creating Subsets of Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Introduction to Creating Subsets of Observations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Selecting Observations for a New SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Conditionally Writing Observations to One or More SAS Data Sets . . . . . . . . . . . . . . 175
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Chapter 12 • Working with Grouped or Sorted Observations . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Introduction to Working with Grouped or Sorted Observations . . . . . . . . . . . . . . . . . . 183
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Working with Grouped Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Working with Sorted Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Chapter 13 • Using More Than One Observation in a Calculation . . . . . . . . . . . . . . . . . . . . . . . 199
Introduction to Using More Than One Observation in a Calculation . . . . . . . . . . . . . 199
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Accumulating a Total for an Entire Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Obtaining a Total for Each BY Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Writing to Separate Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Using a Value in a Later Observation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Chapter 14 • Finding Shortcuts in Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Introduction to Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Input File and SAS Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Performing More Than One Action in an IF-THEN Statement . . . . . . . . . . . . . . . . . . 217
Performing the Same Action for a Series of Variables . . . . . . . . . . . . . . . . . . . . . . . . . 219
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Chapter 15 • Working with Dates in the SAS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Introduction to Working with Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Understanding How SAS Handles Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Entering Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Displaying Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Using Dates in Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Using SAS Date Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Comparing Durations and SAS Date Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Combining SAS Data Sets
PART 4 247
Chapter 16 • Methods of Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Introduction to Combining SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Definition of Concatenating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
vi Contents
Definition of Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Definition of Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Definition of Updating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Definition of Modifying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Comparing Modifying, Merging, and Updating Data Sets . . . . . . . . . . . . . . . . . . . . . . 254
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Chapter 17 • Concatenating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Introduction to Concatenating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Concatenating Data Sets with the SET Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Concatenating Data Sets By Using the APPEND Procedure . . . . . . . . . . . . . . . . . . . . 274
Choosing between the SET Statement and the APPEND Procedure . . . . . . . . . . . . . . 278
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Chapter 18 • Interleaving SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Introduction to Interleaving SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Understanding BY-Group Processing Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Interleaving Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Chapter 19 • Merging SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Introduction to Merging SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Understanding the MERGE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
One-to-One Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Match-Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Choosing between One-to-One Merging and Match-Merging . . . . . . . . . . . . . . . . . . . 310
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Chapter 20 • Updating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Introduction to Updating SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Understanding the UPDATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Understanding How to Select BY Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Updating a Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Updating with Incremental Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
Understanding the Differences between Updating and Merging . . . . . . . . . . . . . . . . . 326
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Chapter 21 • Modifying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Introduction to Modifying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
Modifying a SAS Data Set: The Simplest Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Modifying a Master Data Set with Observations from a Transaction Data Set . . . . . . 338
Understanding How Duplicate BY Variables Affect File Update . . . . . . . . . . . . . . . . 343
Handling Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Chapter 22 • Conditionally Processing Observations from Multiple SAS Data Sets . . . . . . . . 349
Introduction to Conditional Processing from Multiple SAS Data Sets . . . . . . . . . . . . 349
Input SAS Data Sets for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Determining Which Data Set Contributed the Observation . . . . . . . . . . . . . . . . . . . . . 353
Contents vii
Combining Selected Observations from Multiple Data Sets . . . . . . . . . . . . . . . . . . . . 358
Performing a Calculation Based on the Last Observation . . . . . . . . . . . . . . . . . . . . . . 359
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Debugging SAS Programs
PART 5 363
Chapter 23 • Analyzing Your SAS Session with the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Introduction to Analyzing Your SAS Session with the SAS Log . . . . . . . . . . . . . . . . . 366
Understanding the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Locating the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Understanding the Log Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Writing to the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Suppressing Information in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Changing the Appearance of the Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Chapter 24 • Directing SAS Output and the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Introduction to Directing SAS Output and the SAS Log . . . . . . . . . . . . . . . . . . . . . . . 391
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
Routing the Output and the SAS Log with PROC PRINTTO . . . . . . . . . . . . . . . . . . . 393
Storing the Output and the SAS Log in the SAS Windowing Environment . . . . . . . . 395
Redefining the Default Destination in a Batch or Noninteractive Environment . . . . . 396
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Chapter 25 • Diagnosing and Avoiding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Introduction to Diagnosing and Avoiding Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Understanding How the SAS Supervisor Checks a Job . . . . . . . . . . . . . . . . . . . . . . . . 400
Understanding How SAS Processes Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Distinguishing Types of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Diagnosing Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Using a Quality Control Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Chapter 26 • Finding Logic Errors in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Finding Logic Errors in Your Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Using the DATA Step Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Basic Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Using the Macro Facility with the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Producing Reports
PART 6 431
Chapter 27 • Producing Detail Reports with the PRINT Procedure . . . . . . . . . . . . . . . . . . . . . . 433
Introduction to Producing Reports with the PRINT Procedure . . . . . . . . . . . . . . . . . . 434
Input File and SAS Data Sets for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
Creating Simple Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Creating Enhanced Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Creating Customized Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
viii Contents
Making Your Reports Easy to Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Chapter 28 • Creating Summary Tables with the TABULATE Procedure . . . . . . . . . . . . . . . . . 473
Introduction to Creating Summary Tables with the TABULATE Procedure . . . . . . . . 474
Understanding Summary Table Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Understanding the Basics of the TABULATE Procedure . . . . . . . . . . . . . . . . . . . . . . . 476
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Creating Simple Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Creating More Sophisticated Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Chapter 29 • Creating Detail and Summary Reports with the REPORT Procedure . . . . . . . . . 501
Introduction to Creating Detail and Summary Reports with the REPORT Procedure . 501
Understanding How to Construct a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Creating Simple Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Creating More Sophisticated Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Producing Plots and Charts
PART 7 529
Chapter 30 • Plotting the Relationship between Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Introduction to Plotting the Relationship between Variables . . . . . . . . . . . . . . . . . . . . 531
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Plotting One Set of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Enhancing the Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Plotting Multiple Sets of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Chapter 31 • Producing Charts to Summarize Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Introduction to Producing Charts to Summarize Variables . . . . . . . . . . . . . . . . . . . . . 552
Understanding the Charting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Input File and SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Charting Frequencies with the CHART Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Customizing Frequency Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
Creating High-Resolution Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Designing Your Own Output
PART 8 593
Chapter 32 • Writing Lines to the SAS Log or to an Output File . . . . . . . . . . . . . . . . . . . . . . . . 595
Introduction to Writing Lines to the SAS Log or to an Output File . . . . . . . . . . . . . . . 595
Understanding the PUT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Writing Output without Creating a Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Writing Simple Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
Contents ix
Writing a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Chapter 33 • Understanding and Customizing SAS Output: The Basics . . . . . . . . . . . . . . . . . 613
Introduction to the Basics of Understanding and Customizing SAS Output . . . . . . . . 614
Understanding Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Input SAS Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Locating Procedure Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Making Output Informative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Controlling Output Appearance of Listing Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Controlling the Appearance of Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
Representing Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
Chapter 34 • Understanding and Customizing SAS Output: The Output
Delivery System (ODS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
Introduction to Customizing SAS Output By Using the Output Delivery System . . . . 644
Input Data Set for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
Understanding ODS Output Formats and Destinations . . . . . . . . . . . . . . . . . . . . . . . . 645
Selecting an Output Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
Creating Formatted Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
Selecting the Output That You Want to Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
Customizing ODS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Storing Links to ODS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
Storing and Managing Data in SAS Files
PART 9 685
Chapter 35 • Understanding SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
Introduction to Understanding SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
What Is a SAS Library? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Accessing a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Storing Files in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Referencing SAS Data Sets in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
Chapter 36 • Managing SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Introduction to Managing SAS Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Choosing Your Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
Understanding the DATASETS Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
Looking at a PROC DATASETS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
Chapter 37 • Getting Information about Your SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
Introduction to Getting Information about Your SAS Data Sets . . . . . . . . . . . . . . . . . 701
Input Data Library for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Requesting a Directory Listing for a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
Requesting Contents Information about SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . 704
Requesting Contents Information in Different Formats . . . . . . . . . . . . . . . . . . . . . . . . 708
x Contents
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
Chapter 38 • Modifying SAS Data Set Names and Variable Attributes . . . . . . . . . . . . . . . . . . . 713
Introduction to Modifying SAS Data Set Names and Variable Attributes . . . . . . . . . . 713
Input Data Library for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Renaming SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
Modifying Variable Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
Chapter 39 • Copying, Moving, and Deleting SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
Introduction to Copying, Moving, and Deleting SAS Data Sets . . . . . . . . . . . . . . . . . 725
Input Data Libraries for Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
Copying SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
Copying Specific SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
Moving SAS Libraries and SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Deleting SAS Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
Deleting All Files in a SAS Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Understanding Your SAS Environment
PART 10 739
Chapter 40 • Introducing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Introduction to the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
Starting a SAS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Selecting a SAS Processing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
Chapter 41 • Using the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
Introduction to Using the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . 754
Getting Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
Finding Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Using SAS Windowing Environment Command Types . . . . . . . . . . . . . . . . . . . . . . . . 758
Working with SAS Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Working with Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Working with Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
Working with SAS Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
Working with Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
Chapter 42 • Customizing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
Introduction to Customizing the SAS Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
Customizing Your Current Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
Customizing Session-to-Session Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
Customizing the SAS Windowing Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809