The following program
contains a syntax error:
data work.admitfee; /*#1*/
set cert.admit;
run;
proc prin data=work.admitfee; /*#2*/
var id name actlevel fee; /*#3*/
run;
1 |
The DATA step creates a new SAS
data set named Work.Admitfee from the Cert.Admit data set.
|
2 |
The SAS keyword PRINT in PROC PRINT
is spelled incorrectly. As a result, the PROC step fails.
|
3 |
The VAR statement prints the values
for the following variables only: ID, Name, ActLevel, and Fee.
|
When the program is
submitted, messages in the SAS log indicate
that the procedure PRIN was not found and that SAS stopped processing
the PROC step because of errors. No output is produced by the PRINT
procedure, because the second step fails to execute.
Here is an explanation
of the following log.
-
The ERROR keyword is the notification
of the error.
-
The PRIN keyword in the SAS log
is the possible location of the error in the statement.
-
The error explanation is not
found
.
Log 5.1 SAS Log
265 proc prin data=work.admitfee;
ERROR: Procedure PRIN not found.
268 var id name actlevel fee;
267 run;
NOTE: The SAS System stopped processing this step because of errors.
Tip
Errors in your statements
or data might not be evident when you look at results in the
Results viewer.
Review the messages in the
SAS log each time
you submit a SAS program.
In addition to correcting spelling
mistakes, you might need to resolve other common syntax errors such
as these:
-
-
-
unbalanced quotation mark
You might also need
to correct a semantic error such as this: