Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which statement is false
regarding an ARRAY statement?
-
It is an executable
statement.
-
It can be used to create
variables.
-
It must contain either
all numeric or all character elements.
-
It must be used to define
an array before the array name can be referenced.
-
What belongs within
the braces of this ARRAY statement?
array contrib{?} qtr1-qtr4;
-
For the program below,
select an iterative DO statement to process all elements in the contrib
array.
data work.contrib;
array contrib{4} qtr1-qtr4;
...
contrib{i}=contrib{i}*1.25;
end;
run;
-
What is the value of
the index variable that references Jul in the statements below?
array quarter{4} Jan Apr Jul Oct;
do i=1 to 4;
yeargoal=quarter{i}*1.2;
end;
-
Which DO statement would
not process all the elements in the factors array shown below?
array factors{*} age height weight bloodpr;
-
Which statement below
is false regarding the use of arrays to create variables?
-
The variables are added
to the program data vector during the compilation of the DATA step.
-
You do not need to specify
the array elements in the ARRAY statement.
-
By default, all character
variables are assigned a length of eight.
-
Only character variables
can be created.
-
For the first observation,
what is the value of diff{i} at the end of the second iteration of
the DO loop?
array wt{*} weight1-weight10;
array diff{9};
do i=1 to 9;
diff{i}=wt{i+1}-wt{i};
end;
-
Finish the ARRAY statement
below to create temporary array elements that have initial values
of
9000
,
9300
,
9600
,
and
9900
.
array goal{4} ... ;
-
_temporary_ (9000 9300 9600 9900)
-
temporary (9000 9300 9600 9900)
-
_temporary_ 9000 9300 9600 9900
-
(temporary) 9000 9300 9600 9900