SAS Training Self-Assessment

SAS Macro Language 1: Essentials

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

  1. What are the phases of DATA step processing?

     a.   output and execution
     b.   initialization and output
     c.   compilation and execution
     d.   initialization and compilation


  2. Which DATA step phase assigns variable attributes?

     a.   output
     b.   execution
     c.   compilation
     d.   initialization


  3. Which DATA step phase assigns variable values?

     a.   output
     b.   execution
     c.   compilation
     d.   initialization


  4. By default, what happens at the top of the DATA step?

     a.   output
     b.   execution
     c.   compilation
     d.   initialization


  5. By default, what happens at the bottom of the DATA step?

     a.   output
     b.   execution
     c.   compilation
     d.   initialization


  6. Which DATA step statement selects variables?

     a.   VAR
     b.   KEEP
     c.   SELECT
     d.   subsetting IF


  7. Which DATA step statement selects observations?

     a.   VAR
     b.   KEEP
     c.   SELECT
     d.   subsetting IF


  8. What does the program data vector (PDV) contain?

     a.   SAS code
     b.   a raw data file
     c.   input instructions
     d.   a SAS observation


  9. What does the automatic variable named _N_ represent?

     a.   the input observation number
     b.   the current observation number
     c.   the number of times that the DATA step has iterated
     d.   the number of data errors that have occurred during input


  10. Which statement writes the current observation to the SAS data set being created?

     a.   SEND
     b.   WRITE
     c.   CREATE
     d.   OUTPUT


  11. Which statement prevents a variable from being re-initialized with each iteration of the DATA step?

     a.   KEEP
     b.   NOINIT
     c.   RETAIN
     d.   SELECT


  12. What can FIRST. and LAST. variables detect?

     a.   BY-group changes
     b.   matching observations
     c.   the first and last observations of the input data set
     d.   the first and last observations of the output data set


  13. Which SET statement option detects end of file?

     a.   END=
     b.   EOF=
     c.   NOBS=
     d.   POINT=


  14. Which function converts a value from numeric to character?

     a.   PUT
     b.   INPUT
     c.   CONVERTC
     d.   CONVERTN


  15. Which function converts a value from character to numeric?

     a.   PUT
     b.   INPUT
     c.   CONVERTC
     d.   CONVERTN


  16. Which function extracts characters?

     a.   SCAN
     b.   INDEX
     c.   SUBSTR
     d.   EXTRACT


  17. Which function extracts words?

     a.   SCAN
     b.   INDEX
     c.   SUBSTR
     d.   EXTRACT


  18. Which function searches for specific characters?

     a.   SCAN
     b.   INDEX
     c.   SUBSTR
     d.   EXTRACT


  19. Which DO statement iterates 10 times?

     a.   do i=1-10;
     b.   do i=1 to 10;
     c.   do until (i=10);
     d.   do while (i<=10);