%let gpath='.';
ods html close;
%let dpi=200;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Find longest name string--*/
data _null_;
retain maxlen;
set sashelp.class end=last;
maxlen=max(maxlen, length(name));
if last then call symput("Maxlen", maxlen*2);
run;
/*--Use regular expression prxchange function to add blanks--*/
/*--See http://pharmasug.org/proceedings/2014/BB/PharmaSUG-2014-BB08.pdf--*/
data class;
length newname $&maxlen;
set sashelp.class;
/*--Replace each character ".", with the same char from bucket $1 + a space--*/
newname = prxchange('s/(.)/$1 /', -1, name);
run;
/*--Bar Chart vertical tick values--*/
ods listing image_dpi=200;
ods graphics / reset width=4in height=3in imagename='BarChartHotel';
title 'Height by Name';
proc sgplot data=class noautolegend noborder;
vbar newname / response=height dataskin=pressed nostatlabel
baselineattrs=(thickness=0) fillattrs=graphdata6 filltype=gradient;
xaxis display=(nolabel noline noticks) fitpolicy=splitalways
valueattrs=(size=7);
yaxis display=(noline);
run;
title;