SAS Training Self-Assessment

SAS Programming 2: Data Manipulation Techniques

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

  1. 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


  2. What are the required attributes of a column?

     a.   name, type, and length
     b.   name, type, and format
     c.   name, label, and length
     d.   name, label, and format


  3. Which of the following is a SAS syntax requirement?

     a.   Column names are case sensitive.
     b.   Put only one statement on each line.
     c.   Separate each step with a line space.
     d.   End each statement with a semicolon.


  4. Which statement about SAS dates is false?

     a.   A SAS date is one of three of SAS column types: numeric, character, and date.
     b.   SAS dates represent the number of days from January 1, 1960.
     c.   SAS date values can be positive or negative.
     d.   SAS date values can be used in calculations.


  5. A comma-delimited (CSV) file can be used as an input table in a PROC PRINT step.

     a.   True
     b.   False


  6. Which DATA step statement selects columns to include in the output table?

     a.   VAR
     b.   KEEP
     c.   SELECT
     d.   WHERE


  7. Which of the following statements selects from a table only those rows where the value of the Style column is RANCH,SPLIT, or TWOSTORY?

     a.   where Style='RANCH' or 'SPLIT' or 'TWOSTORY';
     b.   where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
     c.   where Style in (RANCH, SPLIT, TWOSTORY);
     d.   where Style in ('RANCH', 'SPLIT', 'TWOSTORY');


  8. Which is a valid LIBNAME statement?

     a.   libname 'c:\sasfiles' mylib;
     b.   libname mylib 'c:\sasfiles';
     c.   libname libref=mylib 'c:\sasfiles';
     d.   libname 'c:\sasfiles' libref=mylib;


  9. Which of the following tables is available at the beginning of a new SAS session?

     a.   sales
     b.   work.newsalesemps
     c.   sashelp.class


  10. Which statement reads a SAS data set?

     a.   SET
     b.   READ
     c.   INPUT
     d.   INFILE


  11. Consider the following program:
    <insert statement here>
       proc print data=customers;
       run;
    ods pdf close;
    Which statement correctly starts the capture of PDF output and names an PDF result file?

     a.   ods pdf;
     b.   ods pdf open;
     c.   ods pdf file='myfile.pdf';
     d.   ods pdf data='myfile.pdf’;


  12. Which statement clears all titles?

     a.   title;
     b.   title clear;
     c.   clear_titles;
     d.   clear all_titles;


  13. Which statement correctly calculates Total as the sum of Qtr1, Qtr2, and Qtr3?

     a.   Total = sum(Qtr1 Qtr2 Qtr3);
     b.   Total = sum(Qtr1, Qtr2, Qtr3);
     c.   sum(Total) = (Qtr1, Qtr2, Qtr3);
     d.   Total = sum of (Qtr1 Qtr2 Qtr3);


  14. If you have a table that includes flower sales to all your retail outlets. You want to see the distinct values of Flower_Type with a count and percentage for each. Which procedure would you use?

     a.   PRINT
     b.   MEANS
     c.   UNIVARIATE
     d.   FREQ


  15. Which statement in a PROC MEANS step enables you to specify the numeric columns to analyze?

     a.   TABLES
     b.   SELECT
     c.   VAR
     d.   KEEP=