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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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