SAS Training Self-Assessment

SAS Enterprise Guide for Experienced SAS Programmers

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

  1. Which variable attribute is optional?

     a.   type
     b.   name
     c.   length
     d.   format


  2. What happens to a DATA step when it is compiled?

     a.   Data is read.
     b.   The program is saved.
     c.   Results are generated.
     d.   Variable attributes are assigned.


  3. Which statement in the DATA step selects variables (columns) to be included in the
    output data set?

     a.   VAR
     b.   KEEP
     c.   INCLUDE
     d.   COLUMNS


  4. Which statement selects observations (rows) to be processed in a SAS procedure?

     a.   OBS
     b.   ROWS
     c.   WHERE
     d.   SELECT


  5. Which procedure places data in ascending or descending order?

     a.   PROC SORT
     b.   PROC ORDER
     c.   PROC ARRANGE
     d.   PROC COMPARE


  6. Two tables are combined based on a common variable:

    data new;
       merge orion.payroll orion.bonus;
       <statement>
    run;
    Which statement completes the DATA step correctly?

     a.   ON
     b.   BY
     c.   KEY
     d.   INNER JOIN


  7. Which is a valid LIBNAME statement?

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


  8. Which is a valid FORMAT statement for the numeric variable Salary?

     a.   format Salary $14.2;
     b.   format Salary=$14(2);
     c.   format Salary dollar14.2;
     d.   format Salary dollar14(2);


  9. Consider the following program:

    <insert statement here>
       proc print data=customers;
       run;
    ods html close;
    Which statement correctly completes the program to create an HTML file?

     a.   ods open='myfile.html';
     b.   ods html='myfile.html';
     c.   ods open html 'myfile.html';
     d.   ods html file='myfile.html';


  10. The following program is submitted. Note that the variable Promo is not in the input data set.

    data orion.october_customers;
       set orion.allregions;
       if Region=1;
       if Store in(233,543,678) then Promo='5%';
       if Store in(495,040) then Promo='15%';
    run;
    How many bytes of storage are allocated for Promo?

     a.   1 byte
     b.   2 bytes
     c.   3 bytes
     d.   8 bytes


  11. The following program is submitted:

    data orion.october_customers;
       set orion.allregions;
       if Region=1;
       if Store in(233,543,678) then Promo='5%';
       if Store in(495,040) then Promo='15%';
    run;
    What happens to a row whose value of Region is 2?

     a.   The row is not output.
     b.   The row is output with error messages written to the log.
     c.   The row is output with a missing value for the variable Promo.
     d.   The row is output with a log warning that Region was not equal to 1.


  12. Consider the following DATA step:

    data orion.totpayroll;
       set orion.octpayroll;
       where month(pay_date)=10;
       Bonus=Salary*.05;
    run;
    Which statement should be added to the program to establish the location of the orion library?

     a.   DATA
     b.   OPTIONS
     c.   LIBNAME
     d.   FILENAME