Say you have a raw data file that uses both tabs and spaces as delimiters. How do you read the raw data file? In this example, we read the raw data file reading the entire observation as one long string (up to 1000 characters, but you can change that) and convert the tabs to spaces and then read the raw data file back in using spaces as delimeters.
data test; * read in original file as one big character variable ; * this assumes the longest line is less than 1000 chars ; * reads file from e:temptest.txt, change filename as needed ; infile "e:temptest.txt" missover pad lrecl=1000; length a $ 1000 ; input a 1-1000 ; * convert tabs into spaces ; b=translate(a," ","09"x); * writes raw data out to e:temptest2.txt, change filename as needed ; file "e:temptest2.txt" lrecl=1000; put b ; run; * check first 10 obs read ; proc print data=test(obs=10); run; * Now, read from the raw data from prior step ; data test2; infile "e:temptest2.txt" lrecl=1000 missover ; * put names of your variables here ; input x y ; run; * check first 10 obs read ; proc print data=test2(obs=10); run;