Or, you could build a small import program, the below for instance assumes text for quoted values and numeric for not: /* test data CSV looks like this */ /* TOWN,POP,IN "London",123456,"UK" "Glasgow",34243,"UK" "Brussels",7876,"Belgium" */ data read_data; length buffer $2000.; infile "s:\temp\rob\test.csv" dsd missover lrecl=32767 dlm="¬"; input buffer $; run; data a/*_null_*/; merge read_data (obs=1 in=head) read_data (obs=2 in=first_row firstobs=2 rename=(buffer=myrow)); i=1; call execute('data want (drop=buffer); set read_data (firstobs=2); length '); /* Assign lengths based on first row */ do while (scan(buffer,i,",") ne ""); call execute(" "||scan(buffer,i,",")); if index(scan(myrow,i,","),'"')>0 then call execute(' $20'); else call execute(' 8'); i=i+1; end; i=1; call execute(';'); /* Split up the data */ do while (scan(buffer,i,",") ne ""); call execute(" "||scan(buffer,i,",")||'=scan(buffer,'||strip(put(i,best.))||',",");'); i=i+1; end; call execute('; run;'); run;
... View more