Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which SAS statement
correctly specifies the array Sales as illustrated in the following
table?
Table Representation
of Sales Array
-
-
-
array {3,4} Sales m1-m12;
-
array {4,12} Sales m1-m12;
-
Which of the following
statements creates temporary array elements?
-
array new {*} _temporary_;
-
array new {6} _temporary_;
-
array new {*} _temporary_ Jan Feb Mar Apr May Jun;
-
array _temporary_ new {6} Jan Feb Mar Apr May Jun;
-
Which DO statement processes
all of the elements in the Yearx array?
array Yearx{12} Jan--Dec;
-
Given the following
program, what is the value of Points in the fifth observation in the
data set Work.Results?
SAS Data Set Work.Contest
|
data work.results;
array score{2,4} _temporary_
(40,50,60,70,40,50,60,70);
set work.contest;
Points=score{week,finish};
run;
|
|
-
Array values should
be stored in a SAS data set when which of the following is true?
-
There are too many values
to initialize easily in an array.
-
The values change frequently.
-
The same values are
used in many programs.
-
-
Given the following
program, which statement is not true?
data work.lookup1;
array Targets{1997:1999,12} _temporary_;
if _n_=1 then do i= 1 to 3;
set sasuser.ctargets;
array Mnth{*} Jan--Dec;
do j=1 to dim(mnth);
targets{year,j}=mnth{j};
end;
end;
set sasuser.monthsum(keep=salemon revcargo monthno);
year=input(substr(salemon,4),4.);
Ctarget=targets{year,monthno};
run;
-
The IF-THEN statement
specifies that the Targets array is loaded once.
-
During the first iteration
of the DATA step, the outer DO loop executes three times.
-
After the first iteration
of the DO loop, the pointer drops down to the second SET statement.
-
During the second iteration
of the DATA step, the condition _N_=1 is false. So, the DO loop does
not execute.
-
Given the following
program, which variable names will appear in the data set Work.New?
SAS Data Set Work.Revenue
|
proc transpose
data=work.revenue
out=work.new;
run;
|
|
-
-
-
-
_NAME_, Jan, Feb, Mar, Apr
-
Which program creates
the output data set Work.Temp2?
SAS Data Set Work.Temp
|
SAS Data Set Work.Temp2
|
|
|
-
proc transpose data=work.temp
out=work.temp2
prefix=Quarter;
run;
-
proc transpose data=work.temp
out=work.temp2
name=Month
prefix=Quarter;
run;
-
proc transpose data=work.temp
out=work.temp2
prefix=Month
name=Quarter;
run;
-
proc transpose data=work.temp
out=work.temp2
prefix=Month
index=Quarter;
run;
-
Which version of the
data set Work.Sales2 is created by the following program?
SAS Data Set Work.Sales
|
proc transpose data=work.sales
out=work.sales2
name=Week;
by employee;
run;
|
|
-
Which program creates
the data set Work.Fishsize?
SAS Data Set Work.Fishdata
SAS Data Set Work.Fishsize
-
proc transpose data=work.fishdata
out=work.fishsize
prefix=Measurement;
run;
-
proc transpose data=work.fishdata
out=work.fishsize
prefix=Measurement;
by location;
run;
-
proc transpose data=work.fishdata
out=work.fishsize
prefix=Measurement;
by date;
run;
-
proc transpose data=work.fishdata
out=work.fishsize
prefix=Measurement;
by location date;
run;