10-10-2017 03:05 AM
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;
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,
10-10-2017 04:11 AM
10-10-2017 03:18 AM
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.
10-10-2017 04:12 AM - edited 10-10-2017 04:15 AM
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?
10-10-2017 04:56 AM
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**