The problem is caused by the fact that when you read in-line records using DATALINES ( also known as CARDS) statement then SAS will pad the lines to be a multiple of 80 columns. So that they look like 80 column IBM punch cards.
Normally SAS will stop your DATA step when it reads past the end of the input data (INPUT statement or SET/MERGE/UPDATE/MODIFY statement). But since you are reading a fixed number of characters per observation you do not attempt to read the second line until you have read more than 80 characters.
Note that this also explains the LOST CARD message. Because 80 is not an even multiple of 3, when you read columns 79 and 80 and then SAs tries to go to the next card to find the 81st character, but there is no next line, hence the LOST CARD.
The answer that DATA_NULL_ posted takes advantage that the fact that when you use PARMCARDS statement instead of DATALINE (cards) statement that SAS does not pad the lines.
The tricks that Art posted are attempts to either eliminate the extra blank observations or calculate when to stop the data step.
Here is another way of stopping that uses the COL= infile option to create variable that indicates where you are on the line. That way you can issue an INPUT statement to skip the blanks at the end of the line.
data check_pointer;
infile cards col=cc ;
if cc > length(_infile_) then input;
input (id id2 id3) (1. 1. $1.) @@ ;
cards;
12m13f14m15f
;;;;
... View more