Chapter 23
Analyzing Your SAS Session with
the SAS Log
Introduction to Analyzing Your SAS Session with the SAS Log . . . . . . . . . . . . . . 366
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Understanding the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Understanding the Role of the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Resolving Errors with the Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Locating the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Understanding the Log Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
The Components of a SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Messages in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Notes in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Warning Messages in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Error Messages in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Detecting a Syntax Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Writing to the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Default Output to the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Writing Messages to the SAS Log: The PUT Statement . . . . . . . . . . . . . . . . . . . . 375
Writing the Contents of an Input Record: The LIST Statement . . . . . . . . . . . . . . . 377
Writing Messages to the SAS Log: The %PUT Macro Statement . . . . . . . . . . . . . 380
Suppressing Information in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Using SAS System Options to Suppress Log Output . . . . . . . . . . . . . . . . . . . . . . . 382
Suppressing SAS Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Suppressing System Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Limiting the Number of Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Controlling the Level of Detail in the SAS Log . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Suppressing SAS Statements, Notes, and Error Messages . . . . . . . . . . . . . . . . . . . 384
Changing the Appearance of the Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
System Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Learning More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
365

Get Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.