Named input reads the
input data records that contain a variable name followed by an equal
sign and a value for the variable. The INPUT statement reads the
input data record at the current location of the input pointer. If
the input data records contain data values at the start of the record
that the INPUT statement cannot read with named input, use another
input style to read them. However, once the INPUT statement starts
to read named input, SAS expects that all the remaining values are
in this form. See
Using Named Input with Another Input Style.
You do not have to specify
the variables in the INPUT statement in the same order that they occur
in the data records. Also, you do not have to specify a variable for
each field in the record. However, if you do not specify a variable
in the INPUT statement that another statement uses (for example, ATTRIB,
FORMAT, INFORMAT, LENGTH statement) and it occurs in the input data
record, the INPUT statement automatically reads the value. SAS writes
a note to the log that the variable is uninitialized.
When you do not specify
a variable for all the named input data values, SAS sets _ERROR_ to
1 and writes a note to the log. Here is an example.
data list;
input name=$ age=;
datalines;
name=John age=34 gender=M
;
The note that SAS writes
to the log states that GENDER is not defined and _ERROR_ is set to
1.