Data visualization with SAS programming

proc gchart: stop truncating values of group variables

Reply
Regular Contributor
Regular Contributor
Posts: 156

proc gchart: stop truncating values of group variables

Dear all,

I have a proc gchart with a group variable. Unfortunately the values of the group variable are longer than 32 characters. Therefore SAS automatically truncates these values to the length of 32. This causes a big problem for me as (who would have guessed) character 1-32 are the same for all the values and character number 33 then makes the difference.
Now SAS truncates the values to a length of 32 and therefore all values are the same and are displayed in the same group :-(
So I'd like to say: no, don't truncate the values of my group variable. Does anybody know how to do this?
(Explicitly setting the length in a data step before doesn't help)

Best regards
Eva
SAS Employee
Posts: 967

Re: proc gchart: stop truncating values of group variables

Sounds like you're not using v9.2 sas yet?

This was one of the (many) great new features & enhancements in v9.2 -- supporting bar chart midpoints & group values > 32 characters Smiley Happy
Regular Contributor
Regular Contributor
Posts: 156

Re: proc gchart: stop truncating values of group variables

No we are using SAS9.1.3
Is there a way to do this in that version?
SAS Employee
Posts: 967

Re: proc gchart: stop truncating values of group variables

The only way I know of that you can do it in v9.1.3 would be to use shorter (fake) values for your groups, and then annotate the desired text over the fake values (making the fake values white-on-white so they're "invisible"). It would be a bit tricky...

I think it would probably be quicker/easier to upgrade, than to figure out how to use annotated text labels in this scenario! Smiley Happy
Regular Contributor
Regular Contributor
Posts: 156

Re: proc gchart: stop truncating values of group variables

I guess I just manipulate the data instead of using annotate and then wait for SAS9.2 in our company.
Super Contributor
Posts: 291

Re: proc gchart: stop truncating values of group variables

Eva;

I can think of two alternatives.
1. Rename the group variables so that they are less than 32 long.
2. Use code values for the group variables and then add a legend - direct labelling is preferred, but if you're stuck ... Just be sure to locate the legend so that it's as adjacent as possible and in the same order as the data display.
SAS Employee
Posts: 967

Re: proc gchart: stop truncating values of group variables

Bill - I don't think >32 character text values work in the legend per-say in v9.1.3 (not even in v9.2). This is a feature I got added in (upcoming) v9.3 though :-)

So, I'm assuming that by "legend" you're referring to creating a "fake" legend, by clever use of title, footnote, or note statements (or annotated text) - yep, that would work! :-) Message was edited by: Robert Allison @ SAS
Super Contributor
Posts: 291

Re: proc gchart: stop truncating values of group variables

With 9.1.3, I'm driven to clever!
Super Contributor
Super Contributor
Posts: 3,174

Re: proc gchart: stop truncating values of group variables

Many examples on the SAS support http://support.sas.com/ website - suggested Google advanced search argument to consider using:

gchart example group subgroup site:sas.com

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 8 replies
  • 352 views
  • 0 likes
  • 4 in conversation