|Structure of the Log|
The SAS log is a record of everything you do in your SAS session or with your SAS program. Original program statements are identified by line numbers. Interspersed with SAS statements are messages from SAS. These messages may begin with the words NOTE, INFO, WARNING, ERROR, or an error number, and they may refer to a SAS statement by its line number in the log.
For example, in the following output, the number 1 prints to the left of the OPTIONS statement. This means that it is the first line in the program. In interactive mode, SAS continues with the sequence of line numbering until you end your session. If you submit the program again (or submit other programs in your current SAS session), the first program line number will be the next consecutive number.
Operating Environment Information: The SAS log appears differently depending on your operating environment. See the SAS documentation for your operating environment.
Sample SAS Log
NOTE: Copyright (c) 1999 by SAS Institute Inc., Cary, NC, USA.  NOTE: SAS (r) Proprietary Software Version 8 (TS00.00P1D06081999)  Licensed to SAS Institute Inc., Site 0000000001.  NOTE: This session is executing on the HP-UX B.10.20 platform.  NOTE: Running on HP Model 9000/782 Serial Number 2011922219.  NOTE: SAS initialization used: real time 4.20 seconds cpu time 1.18 seconds 1 options pagesize=24 linesize=64 nodate;  2 3 data logsample;  4 infile '/u/abcdef/testdir/sampledata.dat'; 5 input LastName $ 1-12 ID $ Gender $ Birth : date7.  5 ! score1 score2 score3 6 score 6 ! 4 score5 score6; 7 format Birth mmddyy8.; 8 run; NOTE: The infile '/u/abcdef/testdir/sampledata.dat' is:  File Name=/u/abcdef/testdir/sampledata.dat, Owner Name=abcdef,Group Name=pubs, Access Permission=rw-r--r--, File Size (bytes)=296 NOTE: 5 records were read from the infile  '/u/abcdef/testdir/sampledata.dat'. The minimum record length was 58. The maximum record length was 59. NOTE: The data set WORK.LOGSAMPLE has 5 observations and 10 variables.  NOTE: DATA statement used: real time 0.44 seconds cpu time 0.13 seconds 9 10 proc sort data=logsample;  11 by LastName; 12 NOTE: There were 5 observations read from the dataset WORK.LOGSAMPLE. NOTE: The data set WORK.LOGSAMPLE has 5 observations and 10 variables.  NOTE: PROCEDURE SORT used: real time 0.16 seconds cpu time 0.03 seconds 13 proc print data=logsample;  14 by LastName; 15 run; NOTE: There were 5 observations read from the dataset WORK.LOGSAMPLE. NOTE: PROCEDURE PRINT used: real time 0.31 seconds cpu time 0.05 seconds
The following list corresponds to the bracketed numbers in the SAS log shown above:
| copyright information.|
| SAS system release used to run this program.|
| name and site number of the computer installation where the program ran.|
| platform used to run the program.|
| hardware used to run the program.|
| OPTIONS statement. This statement uses SAS system options to set a page size of 24 and a line size of 64, and to suppress the date in the output.|
| SAS statements that make up the program (if the SAS system option SOURCE is enabled).|
| long statement continued to the next line. Note that the continuation line is preceded by an exclamation point (!), and that the line number does not change.|
| input file information-notes or warning messages about the raw data and where they were obtained (if the SAS system option NOTES is enabled).|
| the number and record length of records read from the input file (if the SAS system option NOTES is enabled).|
| SAS data set that your program created; notes that contain the number of observations and variables for each data set created (if the SAS system option NOTES is enabled).|
| procedure that sorts your data set|
| note about the sorted SAS data set|
| procedure that prints your data set.|
|Writing to the Log|
You can instruct SAS to write additional information to the log by using the following statements:
Use the PUT, LIST, and ERROR statements in combination with conditional processing to debug DATA steps by writing selected information to the log.
|Customizing the Log|
When you have large SAS production programs or an application that you run on a regular basis without changes, you might want to suppress part of the log. SAS system options enable you to suppress SAS statements and system messages, as well as to limit the number of error messages. Note that all SAS system options remain in effect for the duration of your session or until you change the options. You should not suppress log messages until you have successfully executed the program without errors.
The following list describes some of the SAS system options that you can use to alter the contents of the log:
For more information about how to use these and other SAS system options, see "SAS System Options" in SAS Language Reference: Dictionary.
Operating Environment Information: See the documentation for your operating environment
for other options that affect log output.
The following SAS statements and SAS system options enable you to customize the log. Customizing the log is helpful when you use the log for report writing or for creating a permanent record.
|DATE system option||controls whether the date and time that the SAS job began are printed at the top of each page of the SAS log and any print file created by SAS.|
|FILE statement||enables you to write the results of PUT statements
to an external file. You can use the following two options in the FILE statement
to customize the log for that report.
Note: FILE statement options apply only to the output specified
in the FILE statement, whereas the LINESIZE= and PAGESIZE= SAS system options
apply to all subsequent listings.
|LINESIZE= system option||specifies the line size (printer line width) for the SAS log and the SAS procedure output file that are used by the DATA step and procedures.|
|MISSING= system option||specifies the character to be printed for missing numeric variable values.|
|NUMBER system option||controls whether the page number prints on the first title line of each page of printed output.|
|PAGE statement||skips to a new page in the SAS log and continues printing from there.|
|PAGESIZE= system option||specifies the number of lines that you can print per page of SAS output.|
|SKIP statement||skips a specified number of lines in the SAS log.|
Operating Environment Information: The range of values for the FILE statement and for SAS system options depends on your operating environment. See the SAS documentation for your operating environment for more information.
For more information about how to use these and other SAS system options and statements, see "SAS System Options" and "Statements" in SAS Language Reference: Dictionary.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.