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.
Thanks in advance for sharing your expertise and opinion.
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;
From your SAS log:
2095 %excel_pause(5):
I think this should be a semicolon (;) not a colon (:).
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.
Hello
In your newly posted code I see t
2068 proc export data = &DS
I think it should be
proc export data =&dataset.
Log line 2091 shows a RUN followed by a colon instead of a semicolon. This is what causes run to be interpreted as a GO TO label.
2091 run:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.