Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which of the following
is not written to the output 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 incremental 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 sample input file below, in what order are
the variables stored in the new SAS data set?
data work.fin2;
set cert.finance;
if Salary>25000 then Raise=0.03;
else Raise=0.05;
NewSalary=(Salary*Raise)+Salary;
run;
-
SSN Name Salary Date Raise NewSalary
-
Raise NewSalary SSN Name Salary Date
-
NewSalary Raise SSN Name Salary Date
-
SSN Name Date Salary Raise NewSalary
-
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.fin2;
set cert.finance;
length Raise $9;
if Salary>25000 then Raise='3 Percent';
else Raise='5 Percent';
if Salary>25000 then NewSalary=(25000*0.03)+Salary;
else NewSalary=(Salary*0.05)+Salary;
length Bonus $5;
Bonus=Raise*0.02;
run;
-
There is a missing semicolon
on the second line.
-
There is a missing semicolon
on the third line.
-
The variables Bonus
and Raise have the incorrect length.
-
The variable type for
Bonus is incorrect.
-
Which procedure produces
distinct values of variables and can be used to clean your data?
-
At the start of DATA
step processing, during the compilation phase, variables are created
in the program data vector (PDV), and observations are set to which
of the following:
-
-
-
-
there are no observations.