BookmarkSubscribeRSS Feed
Prateek1
Obsidian | Level 7

hi,

i am getting an error while importing a excel file into sas.i am using portable version sas .

this is my code:

proc import datafile="C:\Analytixlabs1\5 - Data Exploration (SAS Module 2)\Grocery_coupons.xls"
out=Grocery_coupons dbms=Excel
Replace;
Sheet="Data";
getnames=yes;
datarow=2;
run;

 

i am getting an error: Statement is not valid or it is used out of proper order.????????

please help

7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

Please clarify what software you are using, there is no such thing as portable SAS.  Also, post your log including the statements before the problem area.

Prateek1
Obsidian | Level 7

Hi,

i am using SAS system 9.0 portable version.

what should i do ??

is there any other way to import excel file into sas?

 

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You haven't answered either of my questions.  There is no such thing as portable SAS, what are you using, how is is setup?  Are you using University Edition, or Enterprise Guide etc.  You haven't posted the log of what is happening before that statement either.

howarder
Obsidian | Level 7

One thing to try is to use the right extension:

 

proc import datafile="C:\Analytixlabs1\5 - Data Exploration (SAS Module 2)\Grocery_coupons.xlsx"

howarder
Obsidian | Level 7

I would try changing the file to a .csv instead of a .xlsx file since SAS may have problems reading in an Excel file with any verison prior to SAS 9.2.

Ksharp
Super User

"datarow=2;" is not supported by engine Excel, remove it .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1372 views
  • 0 likes
  • 5 in conversation