SAS Training Self-Assessment

SAS SQL 1: Essentials

Select the best answer for each question. When you are finished, click Submit Quiz.

  1. Which statement correctly describes a SAS data library?

     a.   A SAS data library contains a collection of SAS files.
     b.   The location of a SAS data library is defined in a LIBNAME statement.
     c.   Both a and b.
     d.   None of the above.

  2. The sales.csv file is a comma-delimited raw data file. Which INFILE statement correctly references the file?

     a.   infile 'sales.csv';
     b.   infile 'sales.csv' dlm=',';
     c.   infile 'sales.csv' (comma);
     d.   infile 'sales.csv' dlm=comma;

  3. Which statement successfully assigns a library reference to the SAS data library?

     a.   libname prg1data 'c:\myclass';
     b.   libname 'c:\myclass' prg1data;
     c.   libref prg1data = 'c:\myclass';
     d.   library 'c:\myclass'= prg1data;

  4. Which name is a valid SAS variable or data set name?

     a.   My_Monthly_Expenditures
     b.   My_Monthly#Expenditures
     c.   My_Monthly Expenditures
     d.   My_Monthly+Expenditures

  5. Which statement about a DATA step merge is true?

     a.   It is capable of sorting the data.
     b.   It returns only matching rows by default.
     c.   It uses the ORDER BY clause to sort the data.
     d.   It expects the data to be in sorted order or indexed according to the BY variable.

  6. Which of the following is a valid SAS data type?

     a.   float
     b.   integer
     c.   smallint
     d.   numeric

  7. Which statement specifies the columns to display in a PROC PRINT report?

     a.   BY
     b.   COL
     c.   VAR
     d.   SELECT

  8. Which FORMAT statement correctly assigns the MMDDYY10. format to the variable Hire_Date?

     a.   format Hire_Date(mmddyy10);
     b.   format Hire_Date mmddyy10.;
     c.   format Hire_Date*mmddyy10.;
     d.   format Hire_Date–mmddyy10.;

  9. Consider the following PROC SORT step:
    proc sort data=salaries;
       <insert statement here>;
    Which statement completes the step and arranges the values of Employee_ID in descending order?

     a.   by Employee_ID desc;
     b.   by descending Employee_ID;
     c.   by sortkey = desc Employee_ID;
     d.   by descending key = Employee_ID;

  10. Consider the following expression:


    What is the result of the expression given these values:

    Y=. (missing)

     a.   7
     b.   10
     c.   17
     d.   . (missing)

  11. Which assignment statement correctly creates a character variable?

     a.   Name=Ms. Lincoln;
     b.   Ms. Lincoln=Name;
     c.   'Ms. Lincoln'=Name;
     d.   Name='Ms. Lincoln';

  12. Which of the following is considered a standard numeric value by SAS?

     a.   3,700
     b.   37E5
     c.   37.0%
     d.   $3700

  13. What are the three primary windows in the SAS windowing environment?

     a.   Log, Graph, and Print
     b.   Log, PROC, and Editor
     c.   Log, Output, and Editor
     d.   Log, Output, and Graph

  14. Which option, when placed in the PROC PRINT statement, suppresses the printing of the default OBS column?

     a.   NOOBS
     b.   OBS=NO
     c.   NOLABEL
     d.   IDCOL=NO

  15. What are the components of a SAS data set?

     a.   row portion and column portion
     b.   value portion and format portion
     c.   data portion and descriptor portion
     d.   variable portion and observation portion

  16. Which statement is used in the DATA step to concatenate multiple data sets?

     a.   SET
     b.   MERGE
     c.   UPDATE
     d.   APPEND