@mcook wrote: That would require a different adaptation for each CSV file correct? I am trying to figure a way to import many CSV files without having to manually attend to the Carriage returns in each.
Alternative code may be used with any csv file containing breaklines:
/* 1 - creating test csv file */
filename mytest '/folders/myfolders/flat/test.csv';
data _null_;
fname = 'barry';
lname = 'Allen'||'13'x||'Smith';
mi = 'Q';
line = catx(',',fname,lname,mi);
file mytest;
put line;
run;
/* 2 - remove breaklines */
filename newtest '/folders/myfolders/flat/testnw.csv';
data _NULL_;
infile mytest;
file newtest;
input ;
infile = translate(_infile_,' ','13'x);
put infile;
run;
/* 3 - importing the csv file by a data step */
data test;
length fname lname $20;
infile newtest dlm=',' termstr=CRLF truncover;
input fname $ lname $ mi $;
put lname=;
run;
... View more