I am trying to import an Excel spreadsheet in SAS Enterprise Guide v. 7.15 (64-bit).
This is the code:
PROC IMPORT DATAFILE="C:\Users\username\OneDrive - Name\Documents\spreadsheet.xlsx"
OUT= data_1
DBMS=XLSX
REPLACE;
GETNAMES=YES;
SHEET="sheet1";
RUN;
However I am getting the following Error message:
ERROR: Physical file does not exist, C:\Users\username\OneDrive - Name\Documents\spreadsheet"
I suspect it is because of the space in the path name ? Anyone has an idea ?
Thank you!
I typically use Windows Explorer so I can click on a folder and have the path in the display window to copy and paste into code. Same with filenames if they are to be read.
HOWEVER, since you cite Enterprise Guide it probably means that the server running EG does not see your local drive (or cloud mounted drive) at all and you need to copy the file to a location that the server sees and use that path. If you think about it the server is extremely unlikely to have a generic "yourusername" folder on its C: drive much less the One Drive.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.