Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which of the following
can you use to position the input pointer on a specific record?
-
Which pointer control
is used to read multiple records sequentially?
-
Which pointer control
can be used to read records non-sequentially?
-
Which SAS statement
correctly reads the values for Fname, Lname, Address, City, State,
and Zip in order?
-
input Fname $ Lname $ /
Address $20. /
City $ State $ Zip $;
-
input Fname $ Lname $ /;
Address $20. /;
City $ State $ Zip $;
-
input / Fname $ Lname $
/ Address $20.
City $ State $ Zip $;
-
input / Fname $ Lname $;
/ Address $20.;
City $ State $ Zip $;
-
Which INPUT statement
correctly reads the values for ID in the fourth record, and then returns
to the first record to read the values for Fname and Lname?
-
input #4 ID $5.
#1 Fname $ Lname $;
-
input #4 ID $ 1-5
#1 Fname $ Lname $;
-
input #4 ID $
#1 Fname $ Lname $;
-
-
How many records are
read for each execution of the following DATA step?
data spring.sportswr;
infile newitems;
input #1 Item $ Color $
#3 @8 Price comma6.
#2 Fabric $
#3 SKU $ 1-6;
run;
-
Which INPUT statement
correctly reads the values for City, State, and Zip?
-
input #3 City $ State $ Zip $;
-
input #3 City & $11. State $ Zip $;
-
input #3 City $11. +2 State $2. + 2 Zip $5.;
-
-
Which program does not
read the values in the first record as a variable named Item and the
values in the second record as two variables named Inventory and Type?
-
data perm.supplies;
infile instock pad;
input Item & $16. /
Inventory 2. Type $8.;
run;
-
data perm.supplies;
infile instock pad;
input Item & $16.
/ Inventory 2. Type $8.;
run;
-
data perm.supplies;
infile instock pad;
input #1 Item & $16.
Inventory 2. Type $8.;
run;
-
data perm.supplies;
infile instock pad;
input Item & $16.
#2 Inventory 2. Type $8.;
run;
-
Which INPUT statement
reads the values for Lname, Fname, Department, and Salary (in that
order)?
-
input #1 Lname $ Fname $ /
Department $12. Salary comma10.;
-
input #1 Lname $ Fname $ /
Department : $12. Salary : comma.;
-
input #1 Lname $ Fname $
#2 Department : $12. Salary : comma.;
-
-
Which raw data file
poses potential problems when you are reading multiple records for
each observation?