Hey Tom! Thanks for posting this solution. The second code you provided worked for the line breaks I was facing in my data. To better understand what's going on, could you explain why we add the second input statement and also the put statement at the end (in red)? filename fixedcsv temp;
data _null_;
infile 'sample.csv' lrecl=2500;
file fixedcsv lrecl=5000 ;
input ;
put _infile_ @;
if countw(_infile_,',','qm') < 10 then do;
input ;
put _infile_ @;
end;
put;
run; Also I tried replace any single quotes in the data to avoid any complication with "|", however I'm not sure how to change it back to a single quote in the end! filename fixedcsv temp;
data _null_;
infile 'sample.csv' lrecl=2500;
file fixedcsv lrecl=5000 ;
input ;
_infile_=tranwrd(_infile_,"'","|");
put _infile_ @;
if countw(_infile_,',','qm') < 10 then do;
input ;
put _infile_ @;
end;
put;
run;
... View more