Previous Page | Next Page

Analyzing Your SAS Session with the SAS Log

Understanding the SAS Log


Understanding the Role of the SAS Log

The SAS log results from executing a SAS program, and in that sense it is output. The SAS log provides a record of everything that you do in your SAS session or with your SAS program, from the names of the data sets that you have created to the number of observations and variables in those data sets. This record can tell you what statements were executed, how much time the DATA and PROC steps required, and whether your program contains errors.

As with SAS output, the destination of the SAS log varies depending on your method of running SAS and on your operating environment. The content of the SAS log varies according to the DATA and PROC steps that are executed and the options that are used.

The sample log in the following output was generated by a SAS program that contains two PROC steps.(footnote 1) Another typical log is described in detail later in the section.

A Sample SAS Log

NOTE: Libref OUT was successfully assigned as follows: 
      Engine:        V8 
      Physical Name: YOUR-DATA-LIBRARY
57   options linesize=120;
58   
59   proc sort data=out.sat_scores;
60      by test;
61   run;
62   
63   proc plot data=out.sat_scores;
64      by test;
65      label SATscore='SAT score';
66      plot SATscore*year / haxis= 1972 1975 1978 1981 1984 1987 1990 1993 1996 1999;
67      title1 'SAT Scores by Year, 1972-1999';
68      title3 'Separate statistics by Test Type';
69   run;
NOTE: There were 108 observations read from the data set OUT.SAT_SCORES.

Resolving Errors with the Log

The SAS program that generated the log in the previous example ran without errors. If the program had contained errors, then those errors would have been reflected, as part of the session, in the log. SAS generates messages for data errors, syntax errors, and programming errors. You can browse those messages, make necessary changes to your program, and then rerun it successfully.


FOOTNOTE 1:   The DATA step that created this data set is shown in the Appendix. The data set is stored in a SAS data library referenced by the libref OUT throughout the rest of this section. For examples in which raw data is read, the raw data is shown in the Appendix. [arrow]

Previous Page | Next Page | Top of Page