BookmarkSubscribeRSS Feed
TomKari
Onyx | Level 15

Hi. When I run the following code...

 

data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

ods listing gpath='/home/xxx/AHAGM/images';
ods graphics / imagename="pie1" imagefmt=png;
title "pie1";

proc sgpie data=pie1;
	pie v / otherpercent=0;
run;

I get this result. My understanding is that using "otherpercent=0" should cause all slices to appear and be labelled.

 

sas1.jpg

3 REPLIES 3
data_null__
Jade | Level 19

I think you need to specify the label with OTHERLABEL

data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

*ods listing gpath='/home/xxx/AHAGM/images';
*ods graphics / imagename="pie1" imagefmt=png;
*title "pie1";

proc sgpie data=pie1;
	pie v / otherpercent=1 otherlabel='Other';
run;

Screenshot 2026-06-03 133658.png

TomKari
Onyx | Level 15

No, what I'm trying to get is a slice for every value of v...so it should be count 1000 for 5, and count 1 for 10, 15, and 20. Instead, I'm only getting a count of 1 for 20.

Ksharp
Super User

You could try GTL. It looks like GTL have better control.

 

data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;

	v=10;
	output;
	v=15;
	output;
	v=20;
	output;


run;


proc template;
define statgraph simplepie;
begingraph;
entrytitle "Car Models by Origin";
layout region;
piechart category=v / datalabellocation=outside OTHERSLICE=FALSE LABELFITPOLICY=NONE OUTLINEATTRS=(thickness=0);
endlayout;
endgraph;
end;
run;
proc sgrender data=pie1
template=simplepie;
run;

Ksharp_0-1780554181108.png

 

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch Now →
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
  • 129 views
  • 0 likes
  • 3 in conversation