@mj8000 wrote:
For my own understanding and for future reference:
CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal).
CRLF (Windows) was expected, but my csv file was using CR (as I'm on a Macintosh). As @art297 suggested, appending the "LF" part did the trick.
Thanks to everyone for the help and support.
Related link: https://stackoverflow.com/questions/1552749/difference-between-cr-lf-lf-and-cr-line-break-types
A couple of points that can help make this easier.
First as far as I know it is only Excel on Mac that is still confused and thinks that Mac's should use CR only as end of line markers. Most other programs understand that MAC OS is now a unix variant and the lines should end with LF instead. If you check the options when saving a spreadsheet to a delimited file there are options that create the file using a more universal end of line setting.
Second you can use the TERMSTR option in SAS to tell it that your file is using only CR as the end of line marker. To use it with PROC IMPORT you will need to use a FILENAME statement and point PROC IMPORT at the fileref you have defined by the FILENAME statement.
FILENAME csv '/folders/myfolders/cars.csv' termstr=cr;
PROC IMPORT DATAFILE=csv
DBMS=CSV
OUT=WORK.IMPORT
replace;
GETNAMES=YES;
RUN;
... View more