Hi, Why not import that whole text as one long text string. Then process it in a datastep. So (note I wrote this very quickly and didn't think about optimizing or better methods of getting the data, just got it working: filename mine "S:\Temp\Rob\test.txt"; data have; attrib buff format=$2000.; infile mine dsd; input buff; run; data want (drop=tmp); set have; obs=input(strip(substr(buff,1,index(buff," "))),best.); buff=strip(substr(buff,index(buff," "))); tmp=index(strip(reverse(buff))," ")-1; bright=input(strip(substr(buff,length(strip(buff))-tmp)),best.); buff=substr(strip(buff),1,length(strip(buff))-tmp); run;
... View more