For consideration, when you uncomment the first INPUT statement, that causes SAS to load the input data buffer and it will trigger the end=LASTREC before the other INPUT statement, so your IF test will pass and the DATA step will stop prematurely.
And, the NOTE (not really an ERROR) that you receive is because you are attempting to read a character field from the 2nd (last) record as numeric, and it is alphabetic, causing the SAS diagnostic message.
In the future, it is best to share your SAS log, please, not just to say that an error occurs. For assistance with a post, send a reply with the log pasted in your submission (instream). Also, consider adding a PUTLOG _ALL_; command before the RUN; to provide as much diagnostics output as possible -- it also may help you debug the problem, as well.
INFILE is executable, but in other ways (when compared with SET).
A data step can have more than one INFILE. The statement provides a pointer to which infile an INPUT statement should read, as well as initialising infile options which persist for the step. One important dynamic option on an infile statement, is the FILEVAR= option. Almost all of the other options on INFILE remain as defined on the first reference to that INFILE.