BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ybz12003
Rhodochrosite | Level 12

Hello,

An error message is shown in the log window.  How to fix it?

%let dira=%str(Pathway);

filename KC "&dira.\Cost_KC.xlsx";

%macro ttt(site,tab);
proc import datafile=&site. out=&site._&tab. dbms=excel replace; sheet="&tab."; run;
%mend ttt;

%ttt(KC,OPT_Data_Request);


31 %ttt(KC,OPT_Data_Request);

ERROR: File _IMEX_.'OPT_Data_Request$'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.24 seconds
cpu time 0.15 seconds

 

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12
In my environments, I could submit your code with no errors although excel book is read-only mode.
But if I change sheet name, I got same error as you got.

Please attach capture image of sheet name if you can.

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Please do not show ERRORs detached from the code that produced them. Whenever you get an ERROR in the log, SHOW US the ENTIRE log for this macro or PROC or DATA step. When the error is in a macro, please run the command options mprint; before your macro and then run the macro again. Please copy the log as text and paste it into the window that appears when you click on the </> icon

 

Insert Log Icon in SAS Communities.png

--
Paige Miller
japelin
Rhodochrosite | Level 12
Your log said.
"ERROR: File _IMEX_.'OPT_Data_Request$'n.DATA does not exist."

OPT_Data_Request sheet is in your Excel book "Cost_KC.xlsx"?
ybz12003
Rhodochrosite | Level 12
Yes, however it is in the read-only mode
japelin
Rhodochrosite | Level 12
In my environments, I could submit your code with no errors although excel book is read-only mode.
But if I change sheet name, I got same error as you got.

Please attach capture image of sheet name if you can.
ybz12003
Rhodochrosite | Level 12
Thanks for the reminder, I found one letter difference in the sheet name.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 5 replies
  • 701 views
  • 0 likes
  • 3 in conversation