Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which of the following
is not created during the compilation phase?
-
-
-
-
the _N_ and _ERROR_
automatic variables
-
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?
-
incorrect values and
formats
-
invalid options or variable
names
-
missing or invalid punctuation
-
missing or misspelled
keywords
-
Unless otherwise directed,
how does the DATA step execute?
-
once for each compilation
phase
-
once for each DATA step
statement
-
once for each record
in the input file
-
once for each variable
in the input file
-
At the beginning of
the execution phase, the value of _N_ is 1, the value of _ERROR_ is
0, and the values of the remaining variables are set to the following:
-
Suppose you run a program
that causes three DATA step errors. What is the value of the automatic
variable _ERROR_ when the observation that contains the third error
is processed?
-
Which of the following
actions occurs at the beginning of an iteration of the DATA step?
-
The automatic variables
_N_ and _ERROR_ are incremented by one.
-
The DATA step stops
execution.
-
The descriptor portion
of the data set is written.
-
The values of variables
created in programming statements are reset to missing in the program
data vector.
-
Consider the following
DATA step. Based on the INPUT statement, in what order are the variables
stored in the new data set?
data work.update;
infile invent;
input IDnum $ Item $ 1-13 Instock 21-22
BackOrd 24-25;
Total=instock+backord;
run;
-
IDnum Item InStock BackOrd Total
-
Item IDnum InStock BackOrd Total
-
Total IDnum Item InStock BackOrd
-
Total Item IDnum InStock BackOrd
-
What happens when SAS
cannot interpret syntax errors?
-
Data set variables contain
missing values.
-
The DATA step does not
compile.
-
The DATA step still
compiles, but it does not execute.
-
The DATA step still
compiles and executes.
-
What is wrong with this
program?
data work.update;
infile invent
input Item $ 1-13 IDnum $ 15-19 Instock 21-22
BackOrd 24-25;
total=instock+backord;
run;
-
There is a missing semicolon
on the second line.
-
There is a missing semicolon
on the third line.
-
The variables are in
incorrect order.
-
The variable type is
incorrect.
-
Consider 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 keyword was misspelled
in the DATA step.
-
A semicolon was missing
from the INFILE statement.
-
A variable was misspelled
in the INPUT statement.
-
A dollar sign was missing
in the INPUT statement.