BookmarkSubscribeRSS Feed
allurai0412
Fluorite | Level 6

hi,

I am trying to import multiple excel sheets  to get different ouput datasets,....

Please check and help ...what's wrong in my approach??

%MACRO IMPR(IMP,OUT_DAT,EXL_SHT);

PROC IMPORT DATAFILE="&IMP" DBMS=EXCEL OUT=&OUT_DAT REPLACE;

SHEET="EXL_SHT";

MIXED=YES;

RUN;

%MEND IMPR;

%IMPR(C:\Users\galax_allu\Desktop\Y3DTR.XLS,PURCHASE, PUR);

%IMPR(C:\Users\galax_allu\Desktop\Y3DTR.XLS,SWITCHES, SWT);

***************Error message**************88

NOTE: Data source is connected in READ ONLY mode.

ERROR: File _IMEX_.'EXL_SHT$'n.DATA does not exist.

ERROR: Import unsuccessful.  See SAS Log for details.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.96 seconds

      cpu time            0.56 seconds

2 REPLIES 2
LinusH
Tourmaline | Level 20

There are a bunch of SAS notes regarding this error message. I suggest that you first look thru these.

http://support.sas.com/dsearch?charset=iso-8859-1&nh=25&s1=1&filter=&qt=ERROR%3A+File+_IMEX+does+not...

Another way to do this is to use the Libname Excel engine instead, then there is no need for looping thru the different sheets with a macro call.

Data never sleeps
allurai0412
Fluorite | Level 6

hi,

Thanks ...i found the error....I have not included the  "&" in the line ..

SHEET="EXL_SHT";

It is working now...

Regards,

ALLU

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!
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
  • 2 replies
  • 970 views
  • 3 likes
  • 2 in conversation