Ho Soha
You can also use the SG... procs to achieve the result, see example below. They allow to overlay plots with some settings for barwidth and discreteoffset you get two bar beside each other. With this example there is no need to change our data
DISCRETEOFFSET is supported with SAS 9.3 SGPLOT. You can turn off stat labels to remove the (Sum) suffix to the label in the legend. You can also creatively set bar width and discrete offsets to get an overlap effect or separate the bars completely.
title 'Sales by Region';
ods listing style=listing;
proc sgplot data=plotData cycleattrs;
hbar region / nostatlabel response=sales2009 discreteoffset=-0.2 barwidth=0.5;
hbar region / nostatlabel response=sales2010 discreteoffset=0.2 barwidth=0.5;
xaxis display=(nolabel);
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.