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.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1923 views
  • 4 likes
  • 5 in conversation