Hello,
I'm using the following code to import a Microsoft Excel Worksheet (.xls) dataset into SAS 9.4:
However, I keep getting this error message in the Log:
<<ERROR: Unable to open file H:\NIAGEN Clinical Trial\Fellowship Project\Datasets\SAS Programs
for Data Analysis.XLS. It does not exist or it is already opened exclusively by
another user, or you need permission to view its data.>>
I don't have the file open when I'm running this code.
Many thanks in advance for some advice!
Thanks for noting that!
I have tried this code adding the name of the excel file and it worked!
proc import datafile = 'H:\NIAGEN Clinical Trial\Fellowship Project\Datasets\SAS Programs for Data Analysis\COVID_Niagen_Sleep_SAS_1.0.xlsx'
out = COVID.Sleep
dbms = xlsx
replace;
run;
Thank you!
I'm getting access to the software in my local computer through VPN and the use of a remote desktop. H: is my workplace drive.
Yes! I can see the file when I navigate to the path using the file explorer.
Thank you.
Thanks for noting that!
I have tried this code adding the name of the excel file and it worked!
proc import datafile = 'H:\NIAGEN Clinical Trial\Fellowship Project\Datasets\SAS Programs for Data Analysis\COVID_Niagen_Sleep_SAS_1.0.xlsx'
out = COVID.Sleep
dbms = xlsx
replace;
run;
Thank you!
The same network drive has to be mounted as H: on the SAS server for this to work.
And use the XLSX engine and the complete filename with the .xlsx extension.
Thanks for both comments.
I've added the name of the excel file and it worked!
The successful code is provided below:
proc import datafile = 'H:\NIAGEN Clinical Trial\Fellowship Project\Datasets\SAS Programs for Data Analysis\COVID_Niagen_Sleep_SAS_1.0.xlsx'
out = COVID.Sleep
dbms = xlsx
replace;
run;
Thank you!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.