SAS Chapter 6 Understanding Data Step Processing

10 Questions | Attempts: 665
Share

SettingsSettingsSettings
SAS Quizzes & Trivia

Practice for the basic SAS certification exam.


Questions and Answers
  • 1. 
    Which of the following is not created during the compilation phase?
    • A. 

      The data set descriptor

    • B. 

      The first observation

    • C. 

      The program data vector

    • D. 

      The _N_ and _ERROR_ automatic variables

  • 2. 
    During the compilation phase, SAS scans each statement in the DATA step, looking for syntax errors.  Which of the following is not considered a syntax error?
    • A. 

      Incorrect values and formats

    • B. 

      Invalid options or variable names

    • C. 

      Missing or invalid punctuation

    • D. 

      Missing or misspelled keywords

  • 3. 
    Unless otherwise directed, the DATA step executes...
    • A. 

      Once for each compilation phase.

    • B. 

      Once for each DATA step statement.

    • C. 

      Once for each record in the input file.

    • D. 

      Once for each variable in the input file.

  • 4. 
    At the beginning of the execution phase, the value of _N_ is 1, the value of _ERROR_ is o, and the value variables are set to:
    • A. 

      0

    • B. 

      1

    • C. 

      Undefined

    • D. 

      Missing

  • 5. 
    Suppose you run a program that causes three DATA step erros.  What is the value of the automatic variable _ERROR_ when the observation that contains the third error is processed?
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      3

  • 6. 
    Which of the following actions occurs at the end of an iteration of the DATA step?
    • A. 

      The automatic variables _N_ and _ERROR_ are incremented by one.

    • B. 

      The DATA step stops execution.

    • C. 

      The descriptor portion of the data set is written.

    • D. 

      The values of variables created in programming statements are re-set to missing in the program data vector.

  • 7. 
    Look carefully at the DATA step shown below.  Based on the INPUT statement, in what order will the variables be stored in the new data set? data perm.update;      infile invent;      input IDnum $ Item $ 1-13 Instock 21-22            BackOrd 24-25;      Total=instock+backord; run;
    • A. 

      IDnum Item InStock BackOrd Total

    • B. 

      Item IDnum InStock BackOrd Total

    • C. 

      Total IDnum Item InStock BackOrd

    • D. 

      Total Item IDnum InStock BackOrd

  • 8. 
    If SAS cannot interpret syntax errors, then...
    • A. 

      Data set variables will contain missing values.

    • B. 

      The DATA step does not compile.

    • C. 

      The DATA step still compiles, but it does not execute.

    • D. 

      The DATA step still compiles and executes.

  • 9. 
    What is wrong with this program? data perm.update;      infile invent      input Item $ 1-13 IDnum $ 15-19 Instock 21-22           BackOrd 24-25;      total=instock+backord; run;
    • A. 

      Missing semicolon on the second line

    • B. 

      Missing semicolon on the third line

    • C. 

      Incorrect order of variables

    • D. 

      Incorrect variable type

  • 10. 
    Look carefully at this section of a SAS session log.  Based on the note, what was the most likely problem with the DATA step? NOTE: Invalid data for IDnum in line 7 15-19. RULE: ----+----1----+----2----+----3----+----4 7       Bird Feeder LG088 3 20 Item=Bird Feeder IDnum=. InStock=3 BackOrd=20 Total=23 _ERROR_=1 _N_=1
    • A. 

      A keyword was misspelled in the DATA step.

    • B. 

      A semicolon was missing from the INFILE statement.

    • C. 

      A variable was misspelled in the INPUT statement.

    • D. 

      A dollar sign was missing in the INPUT statement.

Related Topics

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.