BookmarkSubscribeRSS Feed
inquistive
Quartz | Level 8

Hi Experts,

 

I have a macro like this:

%macro DETAIL(dataset, sheet);
proc export data = &dataset
outfile = "mydata..xlsx"
dbms = xlsx replace;
sheet = &sheet;
run;
%mend DETAIL;

 

% DETAIL(dataset_a, 'Dataset A');

 

When I execute the macro: % DETAIL(dataset_a, 'Dataset A');

SAS 9.4 prints -'NOTE : Unreferenced label defined : run.' and keeps running forever until I break it .The strangest part is it does not throw any error or warning messages at all. 

inquistive_0-1649249856359.png

 

Thanks in advance for sharing your expertise and opinion.

7 REPLIES 7
ballardw
Super User

SHOW the CODE from the log where you compile the macro. Copy the text with all the messages, on the forum open a text box using the </> icon and paste the text.

 

 

SAS uses a COLON, the : , following a word as a statement label. One strongly suspects that the code you submitted, not entered in the message window here, has a

 

Run :

%mend

not Run;

 

inquistive
Quartz | Level 8
Thank you for suggestion. I have posted the code now.
SASKiwi
PROC Star

From your SAS log:

2095          %excel_pause(5):

I think this should be a semicolon (;) not a colon (:).

Sajid01
Meteorite | Level 14

I ran your code and it worked successfully. I don't see any error.
Please remove the space between % and Detail while invoking the macro.

 

 

Sajid01
Meteorite | Level 14

Hello

In your newly posted code I see t

2068          proc export data = &DS

I think it should be 

proc export data =&dataset.
inquistive
Quartz | Level 8
Thanks for pointing out. I had immediately rectified that but made difference.

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
  • 7 replies
  • 1033 views
  • 4 likes
  • 5 in conversation