BookmarkSubscribeRSS Feed
Abishekaa
Obsidian | Level 7

I am trying to run a macro to create multiple pie charts for several image numberse (1-34). Below is my code and log. I don't get any errors in my log, but I don't get any output either (no plots are generated in results viewer or ods rtf). Please help!

ods graphics /reset=all width=2in height=2in;
%macro pie;
%do num=1 %to 34;
proc sgpie data=data noautolegend
 	dattrmap=attrmap;
 	pie feature / 
 	datalabelloc=inside datalabeldisplay=(response percent ) datalabelattrs=(size=11 family='CENTB' weight=bold)
startangle=90 dataskin=crisp attrid=myid;
where ImageID=#
run;
%end;
%mend pie;
%pie;

Log:
NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
3 REPLIES 3
PaigeMiller
Diamond | Level 26

Do you get any WARNINGs in the log?


Can you please show us the ENTIRE* log for this macro (including the part where you issue the ODS RTF command)? (And please do this every time in the future, show us the ENTIRE log for this macro, do not show us a small portion of the log). Please copy the log as text and paste it into the window that appears when you click on the </> icon.

2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png

 

* — as this log is iterative, and runs essentially the same code for 34 iterations, just show us the log for the first five iterations

--
Paige Miller
Abishekaa
Obsidian | Level 7
10150  ods rtf file="C:\Users\abi\Desktop\Output\macrotest &today..rtf"
10151  startpage=no bodytitle;
NOTE: Writing RTF Body file: C:\Users\abi\Desktop\Output\macrotest 050622.rtf
10152  ods graphics on;
10153
10154
10155  ods graphics /reset=all width=2in height=2in;
10156  %macro pie;
10157  %do num=1 %to 34;
10158  proc sgpie data=data noautolegend
10159      dattrmap=attrmap;
10160      pie feature /
10161      datalabelloc=inside datalabeldisplay=(response percent ) datalabelattrs=(size=11 family='CENTB' weight=bold)
10162  startangle=90 dataskin=crisp attrid=myid;
10163  where ImageID=&num;
10164  run;
10165  %end;
10166  %mend pie;
10167  %pie;

NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds



NOTE: PROCEDURE SGPIE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

10168
10169  ods rtf close;

Quentin
Super User

Those times showing 0.0 seconds are suspicious.  

 

Could you turn on options MPRINT and then show the log.

 

Its it possible there are no records with ImageID=1,2,3 ...

 

It's kind of scary to see a dataset named data.  But I guess it's allowed.

 

If you just run:

data want;
  set data;
run;

Does that work?  I'm wondering if maybe your code had an earlier error and it entered syntaxcheck mode and set OBS=0.  That stops any code from executing.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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