Quiz:
Creating
Variables
Select the best answer for each question and click Score My Quiz.
-
Suppose you need to create a variable,
MaxValue , that is equal to Units times the
maximum of PriceApril , PriceMay , and PriceJune .
Which assignment statement will do this?
-
The assignment statement is one
of the few SAS statements that does not:
-
Consider the small data set and
program shown below. What is the value of
Count after
the fourth observation is read?
SAS Data Set Work.Numbers
|
data work.newnums;
set work.numbers;
Count+tens;
run;
|
-
For the observation shown below, what is the result of the IF-THEN statement?
Status |
Type |
Count |
Condition |
Control |
ok |
3 |
12 |
E |
Go |
if status='OK' and type=3
then count+1;
if status='S' or condition='E'
then control='Stop';
-
Consider the IF-THEN statement
shown below. When the statement is run, which expression is evaluated
first?
if mean(MidTerm,FinalExam)>=95
and (ResearchPaper='A' or
(Project='A' and Presentation='A'))
then grade='A+';
-
Which set of statements is equivalent
to the code shown below?
if code='1' then Type='Fixed';
if code='2' then Type='Variable';
if code^='1' and code^='2' then Type='Unknown';
-
Which of the following does
not determine the length of a new variable?
-
What is the length of the variable
Type , as created in the DATA step below?
data finance.newloan;
set finance.records;
TotLoan+payment;
if code='1' then Type='Fixed';
else Type='Variable';
length Type $ 10;
run;
-
Which set of statements is equivalent
to the code shown below?
length Type $ 14;
if code='1' and months=360 then
type='Fixed Mortgage';
else if code='1'
then type='Fixed Other';
else type='Variable';
-
Which version of the code will
run correctly?
|