The highest number
that follows the # pointer control in the INPUT statement determines
how many input data records are read into the input buffer. Use the
N= option in the INFILE statement to change the number of records.
For example, in this statement, the highest value after the # is 3:
input @31 age 3. #3 id 3-4 #2 @6 name $20.;
Unless you use N= in
the associated INFILE statement, the INPUT statement reads three input
records each time the DATA step executes.
When each observation
has multiple input records but values from the last record are not
read, you must use a # pointer control in the INPUT statement or N=
in the INFILE statement to specify the last input record. For example,
if there are four records per observation, but only values from the
first two input records are read, use this INPUT statement:
input name $ 1-10 #2 age 13-14 #4;
When you have advanced
to the next record with the / pointer control, use the # pointer control
in the INPUT statement or the N= option in the INFILE statement to
set the number of records that are read into the input buffer. To
move the pointer back to an earlier record, use a # pointer control.
For example, this statement requires the #2 pointer control, unless
the INFILE statement uses the N= option, to read two records:
input a / b #1 @52 c #2;
The INPUT statement
assigns A a value from the first record. The pointer advances to the
next input record to assign B a value. Then the pointer returns from
the second record to column 1 of the first record and moves to column
52 to assign C a value. The #2 pointer control identifies two input
records for each observation so that the pointer can return to the
first record for the value of C.
If the number of input
records per observation varies, use the N= option in the INFILE statement
to give the maximum number of records per observation. For more information,
see the
N= option.