I'm using PROC GCHART - PIE3D and have problems with data values between 1 and 0. No matter how I try to affect the formating, the slice comes out as 0% or .81. I've tried OTHER=# to group such values into "Other" or Proc Format picture with (round fuzz=#) to round up and label accordingly. Neither is working, so clearly there something wrong in how I'm trying to do this.
Here are the relevant code snippets:
/* first, tried the following, adding OTHER=# in PROC GCHART */
PROC FORMAT;
PICTURE pctfmt (ROUND FUZZ=.5)
RUN;
/* didn't round up, so tried the following - after commenting out the OTHER=# option */
PROC FORMAT;
PICTURE pctfmt (ROUND)
0-<1 = "(<1%)"(noedit)
1-<9.9 = "09.0%)" (prefix="(")
10-<99.9 = "099.0%)" (prefix="(")
99.9-100 = "(>99%)" (noedit);
/* with the following */
PROC GCHART DATA = PWSAS.DATA_TEST2;
PIE3D Dog_Breed / type = freq
SUMVAR = percent
NOLEGEND
ANGLE = 90
OTHER = 1
SLICE = arrow
MIDPOINT = 'Pug' 'French Bull Dog' 'Boxer' 'Mastiff' ... 'Other';
VALUE = outside
NOHEADING;
format percent pctfmt.;
Title "Breed Groups in the area:;
RUN;
QUIT;
I get one slice that is either 0% or .81. Do not ever get an "other" slice or the breed label with a value = "<1%".
What have I overlooked or forgotten? It seems that something inside PROC GCHART is over-riding the formatting I wish to use.
thanks, Paige
Could you post up the data values you're using?
Hello,
I apologize for being so slow to respond ... when things get fired up around here, it's not until the drive home do I remember.
The data ranges can be anywhere from 0.00 to 100.00 although 0 and 100 are almost never seen. The range I'm working with is, roughly, 1.6 to 55.8 and one pesky value of 0.81. I cannot get it to round up, attach to the (0<1) in the PROC Format Picture code, which I'm not sure I'm using correctly since none of the other values pay attention to it either.
I recently discovered we are missing a "hot fix" (?) or something that includes rounding. We are going to be moving to 9.3 ...........soon. Any day now. If that doesn't correct the problem, which I'm optimistically sure it will, I'll have to figure out how to make something else work. The problem is temporarily on the back-burner, however .... if anyone can advise on using the "other" option in PROC GCHART with a 3D Pie chart and/or correct use of PROC Format Picture, I would be very appreciative.
v/r
Paige
Could you provide some sample data that demonstrates the problem?
Are you sure you want to use type=freq (counting up how many obsns in each slice)?
If you could provide some sample data, and tell us what you want the graph to show ... we can probably come up with several ways to accomplish that 🙂
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.