BookmarkSubscribeRSS Feed
Tap222
Calcite | Level 5

proc import
datafile='D:\Exchange of data\shoes.xlsx'
dbms=xlsx
out=shoes
replace;
ENDCOL="4";
STARTCOL="2";

run;

error.png

In the above code it showing error.suggest me where I am going wrong?

6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20

Take a look at the following 🙂

 

http://support.sas.com/documentation/cdl/en/acpcref/69731/HTML/default/viewer.htm#n0msy4hy1so0ren1ac...

 

I usually follow the thumb rule that says

 

"Use RANGE= instead of STARTCOL=, STARTROW=, ENDCOL=, ENDROW=, or any combination of these because RANGE= already contains all of these values."

Tap222
Calcite | Level 5

Actually, it's working with range but startcol and endcol.it doesn't work.

PeterClemmensen
Tourmaline | Level 20

Cool. Does that solve your problem then? 🙂

Ksharp
Super User
STARTCOL=, STARTROW=, ENDCOL=, ENDROW=,

are not available to XLSX engine, try 

dbms=xls

or

dbms=excel

Tom
Super User Tom
Super User

The error message you showed is a side effect of the an earlier error. Fix that first.

I would not recommend using PROC IMPORT to read a CSV file with four columns. You will end up typing less code to just write the data step to read it yourself.  Plus then you won't need to run a PROC DATASETS step to remove unneccessary labels or formats that PROC IMPORT adds.

 

data shoes;
   infile 'D:\Exchange of data\shoes.csv' dsd truncover ;
   length Subsidiary $20 Stores Sales Inventory 8;
   input subsidiary -- inventory;
run;

 

Reeza
Super User

Please don't start a new thread for the same question. 

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
  • 6 replies
  • 1191 views
  • 2 likes
  • 5 in conversation