Hi,
I'm trying to add some shapes to my report and I found this webpage that explains how to use the annotate macros:
However, when I run the code, I get the following messages and end up with no lines drawn.
WARNING: Apparent invocation of macro LINE not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.
Here is the code from the webpage. Do you see any potential problems? I appreciate and help or insight. Thanks!
ods pdf style=printer
file='/sasdata/TEST.pdf'
startpage=never;
title1;
proc report data=sashelp.prdsale(where=(prodtype='OFFICE'))
nowd;
%annomac;
* Build the annotate data set;
data Annolines;
length function color $8;
retain xsys ysys '5';
* Syntax for the LINE macro;
%*LINE (x1, y1, x2, y2, color, line_type, size);
%line(.5,69.6,50.5,69.6,blue,1,30);
%line(.5,80.5,50.5,80.5,red,1,30);
%line(42.2,67,42.2,94,green,1,30);
run;
* Use the annotate data set;
proc gslide anno=annolines;
run; quit;
ods _all_ close;
It seems that you have copied the code as is from the PDF.
Try to add at the end of each %line(.....); with a semicolon.
Thank you but adding semicolons did not change the outcome.
WARNING: Apparent invocation of macro LINE not resolved.
means that %annomac did not run properly.
The log should show something similar to
9 %annomac
MAUTOLOCDISPLAY(ANNOMAC): This macro was compiled from the autocall file D:\Program
Files\SAS\SASHome\SASFoundation\9.4\core\sasmacro\annomac.sas
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.