BookmarkSubscribeRSS Feed
Smitha9
Fluorite | Level 6

I have an excel file and needs to import into SAS. Somehow this is not working.

any tricks here?

 

proc import datafile="folder\file.xlsx"
dbms=xlsx replace
out=a;
guessingrows=3000;/*guessingrows helps not to truncate the observations*/
run;

I am doing something wrong here? the log says "DBMS type xlsx is not valid to import"

 

thanks in advance.

2 REPLIES 2
Reeza
Super User

Please post your full code and log.

 


@Smitha9 wrote:

I have an excel file and needs to import into SAS. Somehow this is not working.

any tricks here?

 

proc import datafile="folder\file.xlsx"
dbms=xlsx replace
out=a;
guessingrows=3000;/*guessingrows helps not to truncate the observations*/
run;

I am doing something wrong here? the log says "DBMS type xlsx is not valid to import"

 

thanks in advance.


 

ballardw
Super User

For Import to work with XLSX files you need to have the write module licensed.

If you run

 

proc setinit;
run;

and do not see something like

 

 

---SAS/ACCESS Interface to PC Files
      30MAY2023

then your license does not include the access to XLSX files with Import. Solution: Use File-Save as menu to save to a CSV file and import that.

If you do see the Interface to PC Files then run this to see if it was installed.

proc product_status;run;

If the log does not show, among other products, something like the following then the it was not installed and you need to do a reinstall and make sure the PC Files is selected

For SAS/ACCESS Interface to PC Files ...
   Custom version information: 9.4_M4

 

 

 

"Not working" is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the "</>" to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "</>" icon or attached as text to show exactly what you have and that we can test code against.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 284 views
  • 0 likes
  • 3 in conversation