SAS Chapter 6 Understanding Data Step Processing

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 784 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. 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;

Explanation

A semicolon is missing from the second line. It will cause an error because the INPUT statement will be interpreted as invalid INFILE statement options.

Submit
Please wait...
About This Quiz
SAS Quizzes & Trivia

This quiz assesses understanding of SAS DATA Step Processing, focusing on the compilation and execution phases. It evaluates knowledge of syntax errors, variable initialization, and error handling in... see moreSAS programming, essential for data analysts and statisticians. see less

2. Which of the following is not created during the compilation phase?

Explanation

At the beginning of the compilation phase, the program data vector is created. The porogram data vector includes the two automatic variables _N_ and _ERROR_. The descriptor portion of the new SAS data set is created at the end of the compilation phase. The descriptor portion includes the name of the data set, the number of observations and variables, and the names and attributes of the variables. Observations are not written until the execution phase.

Submit
3. 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;

Explanation

The order in which variables are defined in the DATA step determines the order in which the variables are stored in the data set.

Submit
4. 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?

Explanation

The default value of _ERROR_ is 0, which means that there is no error. When an error occurs, whether one error or multiple errors, the value is set to 1.

Submit
5. 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:

Explanation

The remaining variables are initialized to missing. Missing numeric values are represented by periods, and missing character values are represented by blanks.

Submit
6. 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?

Explanation

Syntax checking can detect many common errors, but it cannot verify the values of variables or the correctness of formats.

Submit
7. Unless otherwise directed, the DATA step executes...

Explanation

The DATA step executes once for each record in the input file, unless otherwise directed.

Submit
8. 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

Explanation

The third line of the log displays the values for IDnum, which are clearly character values. The fourth line displays the values in the program data vector and shows that the values for IDnum are missing, even though the values are correctly assigned. Thus, it appears that numeric values were expected for IDnum. A dollar sign, to indicate character values, must be missing from the INPUT statement.

Submit
9. If SAS cannot interpret syntax errors, then...

Explanation

When SAS can't interpret syntax errors, the DATA step compiles, but it does not execute.

Submit
10. Which of the following actions occurs at the end of an iteration of the DATA step?

Explanation

By default, at the end of the DATA step, the values in the program data vector are written to the data set as an observation, the value of the automatic variable _N_ is incremented by one, control returns to the top of the DATA step, and the values of variables created in programming statements are re-set to missing. The automatic variable _ERROR_ retains its value.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 19, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What is wrong with this program?...
Which of the following is not created during the compilation phase?
Look carefully at the DATA step shown below.  Based on...
Suppose you run a program that causes three DATA step erros....
At the beginning of the execution phase, the value of _N_ is 1, the...
During the compilation phase, SAS scans each statement in the DATA...
Unless otherwise directed, the DATA step executes...
Look carefully at this section of a SAS session log.  Based on...
If SAS cannot interpret syntax errors, then...
Which of the following actions occurs at the end of an iteration of...
Alert!

Advertisement