SAS Certified Base Programmer 50 Questions (5)
The following SAS program is submitted at the start of a new SAS session:
libname sasdata 'SAS-data-library'; data sasdata.sales; set sasdata.salesdata; profit=expenses-revenues; run; proc print data=sales; run;
The SAS data set Sasdata.Salesdata has ten observations. Which one of the following explains why a report fails to generate?
a. The DATA step fails execution.
b. The SAS data set Sales does not exist.
c. The SAS data set Sales has no observations.
d. The PRINT procedure contains a syntax error.
Topics:
SAS Base Questions |
8 Comments »
B
D because syntax error
Its not a Syntax error. Since proc print refers to work library’s dataset which doesn’t exist.
Answer is B.
Because that particular dataset is in sasdata but not in temporary libname
B , because proc print procedure will use work library to search for sales data while it is not present in work library , so answer will be B ) SAS data set does not exists , it is not syntax error because all syntax are correct and compilation and execution will be done without any error
C is correct, the print report was expected to be: proc print data= sasdata.sales; run;
CĀ“mon cnu.
The right answer is B.
Why?
Because is not a syntaxis error.
Syntaxis error:Syntax errors occur when program statements do not conform to the rules of the SAS language.
official source: http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000993446.htm.
The datastep creates the dataset sasdata.sales, but the proc step tries to access work.sales which does not exist. Answer B