Data visualization with SAS programming

Increase the max number of groups, how to

Accepted Solution Solved
Reply
Contributor
Posts: 34
Accepted Solution

Increase the max number of groups, how to

Is there any way to increase the max number of groups for groups= option for BARCHART in the GTL? I seem to have hit the limit with 1092 groups. Interestingly proc sgplot doesn't seem to have the same limit.

R


Accepted Solutions
Solution
‎08-26-2011 09:09 AM
SAS Super FREQ
Posts: 1,080

Increase the max number of groups, how to

ODS Graphics limits the number of discrete values or groups to 1000 to prevent runaway jobs, where a group or category role may be assigned a column (unintionally) that has a very large number of unique values.  These are controlled by the DISCRETEMAX and GROUPMAX options on the ODS GRAPHICS statement.  You can set these values to a higher level for your needs.

ods graphics / groupmax=1001;

http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/viewer.htm#p0kroq43yu0lspn16hk1...

View solution in original post


All Replies
Solution
‎08-26-2011 09:09 AM
SAS Super FREQ
Posts: 1,080

Increase the max number of groups, how to

ODS Graphics limits the number of discrete values or groups to 1000 to prevent runaway jobs, where a group or category role may be assigned a column (unintionally) that has a very large number of unique values.  These are controlled by the DISCRETEMAX and GROUPMAX options on the ODS GRAPHICS statement.  You can set these values to a higher level for your needs.

ods graphics / groupmax=1001;

http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/viewer.htm#p0kroq43yu0lspn16hk1...

Contributor
Posts: 34

Increase the max number of groups, how to

Thanks for this. I new there must be an option somewhere to increase this but its not mentioned in the error message or in the documentation for groups= . The only mention is in regard to increasing the memory available for ODS graphics. Also what is the limit for groups= in proc sgplot?

R

SAS Super FREQ
Posts: 1,080

Increase the max number of groups, how to

I don't expect any difference at all for this scatter plot use case.  I just ran this code for SG and GTL, and I got the exact same log message.

data scatter;
  do g=1 to 1001;
    x=ranuni(2);
    y=ranuni(2);
    output;
  end;
run;

ods html close;
ods listing;

proc sgplot data=scatter tmplout='c:\max.sas';   scatter x=x y=y / group=g; run; proc template;   define statgraph max;     begingraph;       layout overlay;         scatterplot x=x y=y / group=g;       endlayout;     endgraph;   end; run; /*ods graphics / groupmax=1001;*/ proc sgrender data=scatter template=max; run;
Contributor
Posts: 34

Increase the max number of groups, how to

Looks like I had excluded some obs which meant the no groups dropped below 1000

R

New User
Posts: 1

Re: Increase the max number of groups, how to

Thanks Sanjay for what a simple but hard found solution! I Have been searching the SAS Manual for a whole day but only found your answer here!!

SAS Employee
Posts: 2

Re: Increase the max number of groups, how to

We are always looking to improve the documentation. I will update the GROUP= option in the next edition of the SAS ODS Graphics Procedures Guide with this information. Thank you!

SAS Super FREQ
Posts: 1,080

Re: Increase the max number of groups, how to

Normally, the software will write a note to the log indicating when this has happened, and the name of the option you can use to fix the issue.  In this case the note is not logged, sorry about that.  I have opened a defect.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 370 views
  • 3 likes
  • 4 in conversation