hi ,i'm trying to import multiple sheets in sas eg below is the code i used,
%macro pim(sheet);
proc import out= AR
datafile = 'C:\Users\sivakumar.sivaraj\Desktop\Data_Import.xlsx'
dbms = Excel;
sheet = "&sheet";
getnames = yes;
run;
%mend pim;
%pim(DumpKey);
%pim(UniqueProcedureID);
%pim(ReportDateIST);
after running this code its showing below error. can any one please help me to fix this.
ERROR: Unable to open file C:\Users\sivakumar.sivaraj\Desktop\Data_Import.xlsx. It does not exist or it is already opened
exclusively by another user, or you need permission to view its data.
thanks,
siva
In EG, do you use "Local" as your server, or another workspace server definition?
If other than Local, your workspace server may run on a remote computer and therefore can't "see" your C: drive.
If Local, it may be that the file is kept open by the last program that used it (probably Excel itself). Make sure that all Excel instances are closed and try again.
In EG, do you use "Local" as your server, or another workspace server definition?
If other than Local, your workspace server may run on a remote computer and therefore can't "see" your C: drive.
If Local, it may be that the file is kept open by the last program that used it (probably Excel itself). Make sure that all Excel instances are closed and try again.
Thanks for the quick replay Kurt,the sas is working on workspace server and i'm importing file from local desktop.i have checked agin its showing the same error
"ERROR: Unable to open file C:\Users\sivakumar.sivaraj\Desktop\Data_Import.xlsx. It does not exist or it is already opened
exclusively by another user, or you need permission to view its data."
is it stating any access level restriction..kindly hhelp me resolve this..
Right-click on the server in your server list, select Properties.
You will see the hostname of the physical machine where your workspace server is running.
If it is not the name of your desktop, you have a remote installation. In this case,
- copy the file(s) to that server, preferably your home directory there. Use WinSCP or similar.
or
- if your desktop and the server have access to a common network resource (or the server shares a resource you could use from your desktop), copy the file(s) there and use them from there. Ask the network/server admin for path names.
thanks for detailed replay Kurt.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.