BookmarkSubscribeRSS Feed
jaycss
Fluorite | Level 6

Hi, 

I am learning SAS Studio. I want to create Bar chart in SAS Studio. I have data set with row count of 7453215. When I am execute SAS program to create Bar Chart it throws me following error.

ERROR: The data to be rendered has exceeded the MAXOBS limit of 2000000. You can set MAXOBS=7453215 on the ODS GRAPHICS statement to render the graph.
 I have tried to set firstobs=1 obs=7453215 also.
ods graphics / reset width=6.4in height=4.8in imagemap;

proc sgplot data=MYLIB.TBL2007;
	vbar FlightNum / group=Year groupdisplay=cluster;
	yaxis grid;
run;

ods graphics / reset;
run;
 But it did not work for me. Do I committed any mistakes or driving in wrong direction? Give me some suggestion. Thank you.  
Error.JPG
6 REPLIES 6
andreas_lds
Jade | Level 19

And what happened with maxobs set to 7453215?

 

The log is text, so please post is using {i} icon.

jaycss
Fluorite | Level 6
Still facing same error.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You have hit a limitation of not just SAS, but the human eye.  No graph should be displaying 7453215 observations, a normal size graph would not have space to display a fraction of this.

Summarise your data by your categories - this will be x or y axis depending on direction of bar, then plot the summarised data.  For instance, if I have a dataset with subject,age and val with 20,000 records I could try plotting that, or I could ascertain what categories I want to see in my graph and then summarise (maybe mean, high/low, standard deviation etc.).

jaycss
Fluorite | Level 6
But what if i want to analyse all record for particular purpose ? Still do I need to summarized my data ?
RW9
Diamond | Level 26 RW9
Diamond | Level 26

"But what if i want to analyse all record for particular purpose" - please define.

I would recommend you summarise.  The point of a graph is to show in simple shapes the data, plotting every single point in a dataset will almost never create a viewable graph.  Decide what you want to see in the graph, what is the bar your trying to show, is it the maximum, or the count or something else.  Then organise the data to show just the results you want to see, then plot those.  A simple example, I could take the data from sashelp.class, and plot M/F against age, this would make my Xaxis have lots of individual columns, as there are many ages.  This is not conducive to easily looking at the data, so in this instance I take the decision to sum by age category which I create, in this way I may have 3 or 4 xaxis columns, and the data is easy to view.  Without knowing your problem I cant suggest.

athienitis
Calcite | Level 5

Try setting your maxobs higher:

 

ods graphics on / obsmax=11000000;
proc sgplot data=out;
scatter y=y x=x/group=cluster;
run;
ods graphics off;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 13935 views
  • 0 likes
  • 4 in conversation