Chapter 20: Creating a Single Observation from Multiple Raw
Data Records
Correct answer: c
Information for one
observation can be spread out over several records. You can write
one INPUT statement that contains line pointer controls to specify
the record or records from which values are read.
Correct answer: c
The forward slash (/)
line pointer control is used to read multiple records sequentially.
Each time a / pointer is encountered, the input pointer advances to
the next line. @n and +n are
column pointer controls.
Correct answer: b
The #n line
pointer control is used to read records non-sequentially. The #n specifies
the absolute number of the line to which you want to move the pointer.
Correct answer: a
The INPUT statement
uses the / line pointer control to move the input pointer forward
from the first record to the second record, and from the second record
to the third record. The / line pointer control only moves the input
pointer forward and must be specified after the instructions for reading
the values in the current record. You should place a semicolon only
at the end of a complete INPUT statement.
Correct answer: d
The first #n line
pointer control enables you to read the values for ID from the fourth
record. The second #n line
pointer control moves back to the first record and reads the values
for Fname and Lname. You can use formatted input, column input, or
list input to read the values for ID.
Correct answer: c
The first time the DATA
step executes, the first three records are read, and an observation
is written to the data set. During the second iteration, the next
three records are read, and the second observation is written to the
data set. During the third iteration, the last three records are read,
and the final observation is written to the data set.
Correct answer: b
A combination of modified
and simple list input can be used to read the values for City, State,
and Zip. You need to use modified list input to read the values for
City, because one of the values is longer than eight characters and
contains an embedded blank. You cannot use formatted input, because
the values do not begin and end in the same column in each record.
Correct answer: c
The values for Item
in the first record are read, and then the following / or #n line
pointer control advances the input pointer to the second record to
read the values for Inventory and Type.
Correct answer: d
You can use either the
/ or #n line pointer control
to advance the input pointer to the second line, in order to read
the values for Department and Salary. The colon (:) modifier is used
to read the character values that are longer than eight characters
(Department) and the nonstandard data values (Salary).
Correct answer: c
The third raw data file
does not contain the same number of records for each observation,
so the output from this data set will show invalid data for the ID
and salary information in the fourth line.