next up previous
Next: Exporting a SAS dataset Up: SAS Previous: SAS

Reading Windows text files in UNIX/Linux SAS and dealing with carriage returns

Sometimes UNIX/Linux SAS may not correctly read in text files created in Windows because of the carriage return at the end of each line. The basic solution is create a fileref using a pipe using the UNIX utility tr. A pipe is a method wherein the input to your program is the output from some other program, instead of simply being the contents of a file on your computer or the internet.

filename mydata pipe tr -d '\r' < mydata.txt;

Now use 'mydata' in the infile statement.

More details are here

Last modified 6/23/07.

Chris Paciorek 2012-01-21