Problem Solving: When an Input Record Unexpectedly Does Not Have Enough Values
Understanding the Default Behavior
When a DATA step reads raw
data from an external file, problems can occur when SAS encounters
the end of an input line before reading in data for all variables
specified in the input statement. This problem can occur when reading
variable-length records, records containing missing values, or both.
The following is an
example of an external file that contains variable-length records:
----+–---1–---+–---2 22 333 4444 55555
This DATA step uses
the numeric informat 5. to read a single field in each record of raw
data and to assign values to the variable TestNumber:
data numbers; infile 'your-external-file'; input TestNumber 5.; run; ...
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.