BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8
I'm trying to use an annotate dataset with a BY statement in gchart. The procedure plots the charts correctly but only reads the first level of by variables in the annotate dataset.
ERROR: The by-variable drc from WORK.TOP10ALLBARS has the value T04, but in WORK.ANNO it has the value N01. This is not permissible with the NOTSORTED option, in which all by-groups must match exactly.


Is there a way to use annotate in a BY situation?
Code that I'm using just below.
Any help would be appreciated.!


proc sort data=Top10AllBars;
by Order Period DRC; /*DRC values are alike within an Order level*/
run;

data anno;
set Top10AllBars (keep=Period Pct DRC);
by DRC notsorted;
function='label';
xsys='2';
ysys='2';
midpoint=period;
y=Pct;
text=trim(left(put(Pct,4.2)));
size=1.5;
position='2';
color='black';
when='a';
output;
run;

proc gchart data=Top10AllBars;
by DRC notsorted;
vbar period/sumvar=pct
annotate=anno
;
run;
1 REPLY 1
Bill
Quartz | Level 8
I've found an answer at http://support.sas.com/kb/16/615.html. Given that I'm using 9.1.3, I'll need to use some macro programming.

sas-innovate-2024.png

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 597 views
  • 0 likes
  • 1 in conversation