By admin | July 27, 2009

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.

8 comments | Add One

  1. SAS Tutor - 08/5/2009 at 3:17 pm

    B

  2. cnu - 06/2/2011 at 6:27 am

    D because syntax error

  3. Ash - 10/7/2011 at 5:43 am

    Its not a Syntax error. Since proc print refers to work library’s dataset which doesn’t exist.

  4. kalpana - 04/1/2012 at 2:24 pm

    Answer is B.
    Because that particular dataset is in sasdata but not in temporary libname

  5. xyz - 04/24/2012 at 11:48 pm

    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

  6. Deblaiso - 05/24/2012 at 1:31 pm

    C is correct, the print report was expected to be: proc print data= sasdata.sales; run;

  7. Arthur - 12/9/2012 at 2:55 am

    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.

  8. Nik - 03/11/2013 at 12:30 pm

    The datastep creates the dataset sasdata.sales, but the proc step tries to access work.sales which does not exist. Answer B

Leave a Comment

Leave a Reply

Your email address will not be published.