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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.