The second INPUT is to read the next line and write it onto the end of the current line being written. You should probably test whether or not it works when there are multiple extra end-of-lines embedded in the same record.
The last PUT is the end the line that is being written since the previous PUT statements had trailing @ which does not write the end-of-line characters.
Probably the simplest way to convert the |'s back into ' is to do it in the variables you end up with in your SAS dataset after you have successfully read in the fixed file.
Here is a data step that will replace all | with ' in all character variables in a SAS dataset.
data apostrophe;
set bar ;
array _char_ _character_;
do over _char_;
_char_ = translate(_char_,"'",'|');
end;
run;
... View more