BookmarkSubscribeRSS Feed
kokodenden52
Obsidian | Level 7
I tried the program below on SAS University Edition.
However it failed.
 
proc import out=test
datafile="C:\Users\Owner\Desktop\folder\test.xlsx"
replace;
 sheet = "sheet1";
 getnames = yes;
run;
 
 
The error message says 
"Statement or option "Getnames" is invalid to EXCELCS IMPORT."
 
Which parts is mistaken?
 
Please teach me.
2 REPLIES 2
Kurt_Bremser
Super User

Put your file in the shared folder, and use

/folders/myfolders/.......xlsx

as the path in University Edition. Also use

dbms=xlsx

in your proc import statement.

GETNAMES will not work for Excel files. From the documentation of the GETNAMES statement:

Interaction: The GETNAMES statement is valid only for delimited files.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please follow the video help, which goes over importing data.

https://video.sas.com/category/videos/how-to-tutorials

 

First off you cannot refer to the file on your local machine, UE is installed to a virtual image, so you need to refer to a shared folder - setup is also part of the training vids.

 

Next up, you will want to set the dbms option:

proc import ... dbms=excel..

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1180 views
  • 1 like
  • 3 in conversation