03-10-2018 02:02 PM
I'm using the import wizard with SAS to import a MS Excel CSV file. The problem is that SAS imports the entire file as a header with no observations.
SAS shows a 10 variable dataset with 0 observations:
RSID FULLNAME Priv Date EMAIL Ugkdd10 Jason Thomas DBA 2008 firstname.lastname@example.org
I need SAS to show me a 5 variable dataset with 1 observation:
RSID, FULLNAME, Priv, Date, EMAIL
Ugkdd10 Jason Thomas DBA 2008 email@example.com
I couldn't find any documentation of how to do this. Maybe proc transpose with some other formula?
Do I need to figure out a way to recreate the dataset with SAS code (i.e., SCAN, SUBSTR, etc)?
Any help is very much appreciated.
03-10-2018 02:28 PM
I bet you are using Excel on a MAC?
Excel is too stupid to understand that Mac's are now using Unix and that text files should use linefeed as the end of line marker and not carriage return.
Either use the SAVE AS feature and pick a different file format that uses the right end of line markers.
Or tell SAS that the end of line marker is CR.
filename mycsv 'filename' termstr=cr;
03-10-2018 04:59 PM
Make sure you saved the right CSV file. If you save your file as CSV(Macintosh) and try to import it into SAS then you will have the records in a single line.
@Tom You maybe right they maybe saved as Mac files.
03-10-2018 09:09 PM
One possible solution has also been posted here: https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-... in your other posting on the same question.