BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
matt_beyers
Calcite | Level 5

I'm trying to import my Excel files into SAS without SAS/ACCESS. Is this possible other than the SAS Enterprise Guide import wizard? I'm a newbie but I've checked around in here and on other sites with no luck.

 

I'm using base SAS 9.4 with SAS/STAT on a Windows 10 64-bit machine.

 

From the import wizard, I'm not seeing a way to use the syntax generated directly.

 

From https://libguides.library.kent.edu/SAS/ImportData#s-lg-box-wrapper-18345498:
This uses PCFILES, which seems to be part of SAS/ACCESS. I get the error, "ERROR: The PCFILES engine cannot be found."

 

From https://stats.idre.ucla.edu/sas/faq/how-do-i-readwrite-excel-files-in-sas/:
This uses PROC IMPORT with DBMS=XLSX (I've used DBMS=EXCEL, too). I get the error, "ERROR: DBMS type XLSX not valid for import."

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You can also set up an ODBC connection to a file and connect to it that way, after it's set up as a DSN connection.

 

This is a major annoyance if you have to do it for a lot of different files though, since it's a manual process. 

You likely don't have access to your system to convert the XLSX files to CSV automatically, do you? If so, there's a VBS script floating around that will convert them and allow you to streamline this process a bit more. It's not possible to work both locally and on the server though so that's a different issue. 

 


@matt_beyers wrote:

I'm trying to import my Excel files into SAS without SAS/ACCESS. Is this possible other than the SAS Enterprise Guide import wizard? I'm a newbie but I've checked around in here and on other sites with no luck.

 

I'm using base SAS 9.4 with SAS/STAT on a Windows 10 64-bit machine.

 

From the import wizard, I'm not seeing a way to use the syntax generated directly.

 

From https://libguides.library.kent.edu/SAS/ImportData#s-lg-box-wrapper-18345498:
This uses PCFILES, which seems to be part of SAS/ACCESS. I get the error, "ERROR: The PCFILES engine cannot be found."

 

From https://stats.idre.ucla.edu/sas/faq/how-do-i-readwrite-excel-files-in-sas/:
This uses PROC IMPORT with DBMS=XLSX (I've used DBMS=EXCEL, too). I get the error, "ERROR: DBMS type XLSX not valid for import."


 

 

 

View solution in original post

4 REPLIES 4
SuryaKiran
Meteorite | Level 14

Convert your excel file into raw data file (csv, txt, ect..) and then import using the Data Step infile.

Thanks,
Suryakiran
Reeza
Super User

You can also set up an ODBC connection to a file and connect to it that way, after it's set up as a DSN connection.

 

This is a major annoyance if you have to do it for a lot of different files though, since it's a manual process. 

You likely don't have access to your system to convert the XLSX files to CSV automatically, do you? If so, there's a VBS script floating around that will convert them and allow you to streamline this process a bit more. It's not possible to work both locally and on the server though so that's a different issue. 

 


@matt_beyers wrote:

I'm trying to import my Excel files into SAS without SAS/ACCESS. Is this possible other than the SAS Enterprise Guide import wizard? I'm a newbie but I've checked around in here and on other sites with no luck.

 

I'm using base SAS 9.4 with SAS/STAT on a Windows 10 64-bit machine.

 

From the import wizard, I'm not seeing a way to use the syntax generated directly.

 

From https://libguides.library.kent.edu/SAS/ImportData#s-lg-box-wrapper-18345498:
This uses PCFILES, which seems to be part of SAS/ACCESS. I get the error, "ERROR: The PCFILES engine cannot be found."

 

From https://stats.idre.ucla.edu/sas/faq/how-do-i-readwrite-excel-files-in-sas/:
This uses PROC IMPORT with DBMS=XLSX (I've used DBMS=EXCEL, too). I get the error, "ERROR: DBMS type XLSX not valid for import."


 

 

 

matt_beyers
Calcite | Level 5

I forgot to say, I have dozens of sheets in the Excel file and I didn't want to export to CSV or other. Based on these two replies, however, it seems I must do so and can't get around that without using SAS/ACCESS. I can write a VBA script to export them all to the same directory and then call them by referencing every CSV file in that directory in a list.

 

I do like the idea of creating an ODBC connection but want to make this easy on the users.

 

 

Reeza
Super User

Honestly, I don't think they should sell SAS without SAS/ACCESS. Its a huge limitation and I don't know why they do that 😞

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2831 views
  • 5 likes
  • 3 in conversation