Hi SAS-friends,
I need some help if you can...
I have to import 88 excel files (about diseases and surgery operation).. they all have the same variables.. I can do it by manual procedures (file/import/ etc....) but It's too long.
so I wrote:
PROC IMPORT DATAFILE='C:\Users\savioli\Documents\BELLOMBRA_ANNO_2016_ok.xls'
DBMS=excel out =sasuser.bellombra_4_trim replace;
RUN;
but Sas told me:
ERROR: Unable to open file C:\Users\savioli\Documents\BELLOMBRA_ANNO_2016_ok.xls. It does not
exist or it is already opened exclusively by another user, or you need permission to
view its data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.09 seconds
cpu time 0.03 seconds
My file is in the same server where I use SAS.
thank you from Italy,
Valentina
it's not opened!
@valentina71 wrote:
it's not opened!
What did you do to verify that?
Make sure that no instance of Excel is running while you try the import. If the Excel file resides on a shared resource, this might become tricky, as you need to inform everyone having access to that to make sure that nobody has the file open.
It's highly likely that someone or some process "locks" your Excel. To test the theory: Manually create a copy of the Excel then run your code against this copy. If that works then the theory is more or less confirmed.
As for importing 88 same structured Excels: We can certainly help you with this. Are they all in the same directory? Do they follow some naming convention (name of workbook, name of tab in workbook)? ...and what SAS version are you using?
version is 9.3; yes all the files are in the same directory (shared by I have full rights).. no conventions, hospital'sname & mounth in the name of the file...
the problem is the proc import, doesnt' work...
I have only today to import.
Tomorrow I manually import......**bleep**
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.