proc sql; create table type7 as select count_sum ,dayofweek ,month ,sys_carr_mrk from mcs_stats where _type_ = 7 and sys_carr_mrk ne 'TFM' order by sys_carr_mrk ,dayofweek ,month ; quit; data middle; set type7; by sys_carr_mrk dayofweek month; retain temp_sum; if first.dayofweek then temp_sum = count_sum; else temp_sum + count_sum; middle = (count_sum/2)+lag(temp_sum); if first.dayofweek then middle=count_sum/2; run; data barlabel; length function color $8 text $10; retain xsys ysys '2' color 'black' when 'a'; set middle; function='label'; midpoint=dayofweek; GROUP=sys_carr_mrk; SUBGROUP=month; x=middle; position='+'; text=trim(left(put(count_sum,comma12.))); run; goptions reset = all; ods listing close; ods html path = "\\kcpublic\PUBLIC\Public\SAS\reports\" gpath = "\\kcpublic\PUBLIC\Public\SAS\reports\images" body = "MCS_Usage_Reports.html"; options gstyle; goptions xpixels = 1000 ypixels = 600; TITLE; TITLE1 "MCS Usage by Day of Week & Carrier"; FOOTNOTE; FOOTNOTE1 ""; pattern1 color=graydd; pattern2 color=VLIB; /* very-light-blue*/ pattern3 color=PALG; /* pale-light-green*/ Legend1 ACROSS = 3 SHAPE = BAR(3,2) LABEL = ("Month" position=(top center)) cborder=black position=(center outside bottom); Axis1 label = ( f="Arial/Bold" "Count of Hits"); Axis2 label = (f="Arial/Bold" ""); Axis3 label = none; PROC GCHART DATA=type7; HBAR dayofweek / DISCRETE SUMVAR=count_Sum SUBGROUP=month GROUP=sys_carr_mrk LEGEND=LEGEND1 RAXIS=AXIS1 MAXIS=AXIS2 GAXIS=AXIS3 NOSTATS ANNOTATE=barlabel ; format month monm.; RUN; QUIT; TITLE; FOOTNOTE; ods html close; ods listing;