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;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.