Hi, I'm trying to import xlsx file into SAS 9.4 M7 (32-bit) without success.
This is my SAS code:
/* Import data */
PROC IMPORT OUT=WORK.RFI_CONTACT
DATAFILE="Y:\Biostat\RFI\RFI_draft_20220126.xlsx"
DBMS=XLSX REPLACE;
RANGE="CONTACT DETAILS";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
run;
and this is the error:
ERROR: DBMS type XSLX not valid for import.
I think that the problem is because my Office environment could be 64-bit but I don't know how to solve the problem.
I don't want to use the wizard.
Can you help me?
I have downloaded SAS 32-bit version because it was suggested by the system during the installation process.
Many thanks!
The nice thing about the XLSX engine is that it does not rely on external modules, and is therefore not depending on bitness. After all, XLSX is just a ZIP archive of XML files.
Most likely you do not have SAS/ACCESS to PC Files licensed or installed.
Please run PROC SETINIT and PROC PRODUCTSTATUS, and post the log from that.
Do you have a typo somewhere, the code and the error message don't appear to match
The code has xLSx but the error xSLx
Can you import a different Excel file?
Use the wizard and see if returns an error
The nice thing about the XLSX engine is that it does not rely on external modules, and is therefore not depending on bitness. After all, XLSX is just a ZIP archive of XML files.
Most likely you do not have SAS/ACCESS to PC Files licensed or installed.
Please run PROC SETINIT and PROC PRODUCTSTATUS, and post the log from that.
Thank you for your answer!
The problem was related to the SAS/ACCESS to PC Files, it was present in the trial version but not in the official one!
I make that typo all of the time.
1563 filename xxx temp; 1564 proc export data=sashelp.class dbms=xlsx file=xxx replace; 1564! run; NOTE: The export data set has 19 observations and 5 variables. NOTE: "XXX" file was successfully created. NOTE: PROCEDURE EXPORT used (Total process time): real time 0.03 seconds cpu time 0.01 seconds 1565 proc import datafile=xxx dbms=xslx out=class replace; ERROR: DBMS type XSLX not valid for import. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 1565! run; 1566 proc import datafile=xxx dbms=xlsx out=class replace; 1566! run; NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with options MSGLEVEL=I. NOTE: The import data set has 19 observations and 5 variables. NOTE: WORK.CLASS data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.00 seconds cpu time 0.01 seconds
The other one to try is to get it wrong on the filename extension and then you have to try to figure out why Excel won't open it.
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.