Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
What is true for the
double trailing at-sign (@@)?
-
It enables the next
INPUT statement to read from the current record across multiple iterations
of the DATA step.
-
It must be the last
item specified in the INPUT statement.
-
It is released when
the input pointer moves past the end of the record.
-
-
A record that is being
held by a single trailing at-sign (@) is automatically released when
one of the following actions occurs.
-
The input pointer moves
past the end of the record.
-
The next iteration of
the DATA step begins.
-
Another INPUT statement
that has an @ executes.
-
Another value is read
from the observation.
-
Which SAS program correctly
creates a separate observation for each block of data?
-
data perm.produce;
infile fruit;
input Item $ Variety : $10.;
run;
-
data perm.produce;
infile fruit;
input Item $ Variety : $10. @;
run;
-
data perm.produce;
infile fruit;
input Item $ Variety : $10. @@;
run;
-
data perm.produce;
infile fruit @@;
input Item $ Variety : $10.;
run;
-
Which SAS program reads
the values for ID and holds the record for each value of Quantity,
so that three observations are created for each record?
-
data work.sales;
infile unitsold;
input ID $;
do week=1 to 3;
input Quantity : comma.;
output;
end;
run;
-
data work.sales;
infile unitsold;
input ID $ @@;
do week=1 to 3;
input Quantity : comma.;
output;
end;
run;
-
data work.sales;
infile unitsold;
input ID $ @;
do week=1 to 3;
input Quantity : comma.;
output;
end;
run;
-
data work.sales;
infile unitsold;
input ID $ @;
do week=1 to 3;
input Quantity : comma. @;
output;
end;
run;
-
Which SAS statement
repetitively executes several statements when the value of an index
variable named Count ranges from 1 to 50, incremented by 5?
-
-
do while count=1 to 50 by 5;
-
-
do while (count=1 to 50 + 5);
-
Which option below,
when used in a DATA step, writes an observation to the data set after
each value for Activity has been read?
-
do choice=1 to 3;
input Activity : $10. @;
output;
end;
run;
-
do choice=1 to 3;
input Activity : $10. @;
end;
output;
run;
-
do choice=1 to 3;
input Activity : $10. @;
end;
run;
-
-
Which SAS statement
repetitively executes several statements while the value of Cholesterol
is greater than 200?
-
-
-
do while (cholesterol > 200);
-
do while cholesterol > 200;
-
Which choice below is
an example of a sum statement?
-
Which program creates
the SAS data set Perm.Topstore from the raw data file shown below?
-
data perm.topstores;
infile sales98 missover;
input Store Sales : comma. @;
do while (sales ne .);
month + 1;
output;
input sales : comma. @;
end;
run;
-
data perm.topstores;
infile sales98 missover;
input Store Sales : comma. @;
do while (sales ne .);
Month=0;
month + 1;
output;
input sales : comma. @;
end;
run;
-
data perm.topstores;
infile sales98 missover;
input Store Sales : comma.
Month @;
do while (sales ne .);
month + 1;
input sales : comma. @;
end;
output;
run;
-
data perm.topstores;
infile sales98 missover;
input Store Sales : comma. @;
Month=0;
do while (sales ne .);
month + 1;
output;
input sales : comma. @;
end;
run;
-
How many observations
are produced by the DATA step that reads this external file?
data perm.choices;
infile icecream missover;
input Day $ Flavor : $10. @;
do while (flavor ne ' ');
output; input flavor : $10. @;
end;
run;