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..

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1127 views
  • 1 like
  • 3 in conversation