0
votes

I am trying to import a tab of a spreadsheet into SAS. I am using the code below.

proc import 
    datafile="[directories....]\4. Media\2. Campaign Info\Tracking_Sheet_JA.xlsx"
    out=test1 
    dbms=xlsx replace;
    sheet="db_data";         
run;

and get the error message

ERROR: XLSX file does not exist -> [directories....]\4. Media\2. Campaign Info\Tracking_Sheet_JA.xlsx

I thought it might be something do do with the spaces or . in the directory, however when i pick another random file from that directory and import using exactly the same code as above it works fine. For Example

proc import 
    datafile="[directories....]\4. Media\2. Campaign Info\9feb.xlsx"
    out=test1 
    dbms=xlsx replace;
    sheet="uk";      
run;

I am certain the file extensions and tab references are correct. Could there be something to do with the settings of my excel file that would cause this?

Thanks.

1
Is the file open in excel (either yours or another persons' if this is a shared drive)?Joe

1 Answers

0
votes

There could be a few issues.. 1: Someone else could have the file open (shared-drive.. I assume you are at work?). 2: You could have the file open while trying to import it into SAS. 3: The file name could simply be wrong. In Excel, is your file saved with the underscores? 4: Excel permissions can be tricky at work.. but if other excel files are importing, then I don't think there should be an issue, unless maybe someone has locked the file? I'm not too sure about permissions stuff.