Previous Page | Next Page

Analyzing Your SAS Session with the SAS Log

Understanding the Log Structure


Detecting a Syntax Error

The following SAS program contains one DATA step and two PROC steps. However, the DATA statement has a syntax error- that is, it does not have a semicolon.

/* omitted semicolon */
   data out.sat_scores4
      infile 'your-input-file';
      input test $ 1-8 gender $ 18 year 20-23
            score 25-27;
   run;

   proc sort data = out.sat_scores4;
      by test;
   run;

   proc print data = out.sat_scores4;
      by test;
   run;

The following output shows the results. Although some variation occurs across operating environments and among methods of running SAS, the SAS log is a representative sample.

Analyzing a SAS Log with Error Messages

3    /* omitted semicolon */
4       data out.sat_scores41 
5       infile 'your-input-file';
6       input test $ 1-8 gender $ 18 year 20-23
7             scores 25-27;
8    run;

ERROR: No CARDS or INFILE statement. 2 
ERROR: The value YOUR-INPUT-FILE is not a valid SAS name.
NOTE: The SAS System stopped processing this step because of errors. 3 
WARNING: The data set OUT.SAT_SCORES4 may be incomplete.  When this step was
         stopped there were 0 observations and 4 variables.
WARNING: Data set OUT.SAT_SCORES4 was not replaced because this step was
         stopped.
WARNING: The data set WORK.INFILE may be incomplete.  When this step was
         stopped there were 0 observations and 4 variables.


9
10   proc sort data=out.sat_scores4; 1 
11      by test;
12   run;

NOTE: Input data set is empty.3 
NOTE: The data set OUT.SAT_SCORES4 has 0 observations and 4 variables. 4 


13
14   proc print data=out.sat_scores4; 1 
15      by test;
16   run;

NOTE: No observations in data set OUT.SAT_SCORES4. 

Examining the Components of a Log

The SAS log provides valuable information, especially if you have questions and need to contact your site's SAS Support Consultant or SAS Technical Support, because the contents of the log will help them diagnose your problem.

The following list corresponds to the numbered items in the preceding log:

[1] SAS statements for the DATA and PROC steps

[2] error messages

[3] notes, which might include warning messages.

[4] notes that contain the number of observations and variables for each data set that is created.

Previous Page | Next Page | Top of Page