BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
boom3196
Fluorite | Level 6

Hey All!

 

I'm having a bit of a problem with the output of insetgroup in some proc boxplots for a draft of a report I'm making.

 

When I (re)start SAS Enterprise and run only one of my proc boxplots, the insetgroup area on the graph processes correctly, above the graph, in a table, with the correct format, as seen below.

 

boxplot2.PNG

 

However, when I run the entire program, which has A LOT of different graphics (proc sgplot/bubble, proc sgplot/vbox, proc boxplot, proc print) on it, the inset group in every single proc boxplot does not format correctly (Shown below). Instead, it displays itself within the chart area of the graph, without a table, and not formatted appropriately. And then afterwards, when I run a singular proc boxplot to check to see what's wrong, it is formatted incorrectly again. It's the same code each time!

 

boxplot1.PNG

 

Can someone help me figure out what's going on here? Does this happen because I'm trying to run too much code at once? And if so, how can I run the code and still get everything on the same report/pdf?  Here's a copy of my code for one of my proc boxplots below. Sorry if it's a mess!  I'm running SAS Enterprise 7.12 HF2 and SAS version 9.04. 

 

 

Thanks for all of your help!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

All of the code may be needed.

 

Since you didn't show any values in your "inset" boxes or the other box do you get title text appearing when unexpected?

 

Do you have any of the name literal variables like '% difference' that appear inside double quotes? The % could then be treated as related to a macro call with unexpected results.

 

You may want to look in your code for anything related to the keyword POSITION. To get the displayed (incorrect) result it appears that the POSITION in inset group has been set to AXIS but that shouldn't persist unless something very odd is going on in the code.

View solution in original post

6 REPLIES 6
ballardw
Super User

@boom3196 wrote:

Hey All!

 

I'm having a bit of a problem with the output of insetgroup in some proc boxplots for a draft of a report I'm making.

 

When I (re)start SAS Enterprise and run only one of my proc boxplots, the insetgroup area on the graph processes correctly, above the graph, in a table, with the correct format, as seen below.

 

boxplot2.PNG

 

However, when I run the entire program, which has A LOT of different graphics (proc sgplot/bubble, proc sgplot/vbox, proc boxplot, proc print) on it, the inset group in every single proc boxplot does not format correctly (Shown below). Instead, it displays itself within the chart area of the graph, without a table, and not formatted appropriately. And then afterwards, when I run a singular proc boxplot to check to see what's wrong, it is formatted incorrectly again. It's the same code each time!

 

boxplot1.PNG

 

Can someone help me figure out what's going on here? Does this happen because I'm trying to run too much code at once? And if so, how can I run the code and still get everything on the same report/pdf?  Here's a copy of my code for one of my proc boxplots below. Sorry if it's a mess!  I'm running SAS Enterprise 7.12 HF2 and SAS version 9.04. 

 

 

Thanks for all of your help!


Does any of your code involve macros? It is real easy to set something in a macro that persists when reusing macro variables. Especially if using/ reusing GTL templates or sections of code.

 

Almost certainly your code sets something that is persisting but we can't tell what without all of the code.

boom3196
Fluorite | Level 6

Hey,

 

Thanks for replying. I don't use macros in this program. Here's a copy of the code that I use to create this particular boxplot.

 

data analysis;
	set finalDS;
	where missing('State EthRace'n) & missing(gender) & missing(IEPStatus)
		  & missing('LEP/ELL'n) & missing(frl) & missing(Quartile_prev)
		  & not missing(Decile_prev) & missing(CRB_prev) & missing(Grade) &
		  missing(SchoolName);
run;

proc sort data=analysis;
	BY Discipline Decile_prev;
run;

proc boxplot data=analysis;
	plot ('% Difference'n)*Decile_prev / vformat=PERCENT7.2;
	by Discipline;
	insetgroup mean max min range / format=PERCENT7.2; 
	title1 "The Title";
run;

 

 

Edit:

Should I post ALL of the code? It's a lot (300 something lines), and might not be the easiest to look through. Just let me know if it'd be helpful!

ballardw
Super User

All of the code may be needed.

 

Since you didn't show any values in your "inset" boxes or the other box do you get title text appearing when unexpected?

 

Do you have any of the name literal variables like '% difference' that appear inside double quotes? The % could then be treated as related to a macro call with unexpected results.

 

You may want to look in your code for anything related to the keyword POSITION. To get the displayed (incorrect) result it appears that the POSITION in inset group has been set to AXIS but that shouldn't persist unless something very odd is going on in the code.

boom3196
Fluorite | Level 6

Thanks for your help. Your comment about title text appearing when unexpected was helpful! I was getting two titles, one that I was setting in the title1 statement, and one that was seemingly generated by the proc boxplot statement itself. And after googling about these two titles, I saw that I needed to turn off ODS Graphics in order to get everything to display correctly. So I was able to fix it!

 

However, I do have a lingering question. Do you know of any good resources to explain why ODS Graphics being on causes this? Or would you be able to tell me yourself? I just don't understand what ODS Graphics does enough to understand why it would cause this to happen.

 

 

Thanks!

ballardw
Super User

@boom3196 wrote:

Thanks for your help. Your comment about title text appearing when unexpected was helpful! I was getting two titles, one that I was setting in the title1 statement, and one that was seemingly generated by the proc boxplot statement itself. And after googling about these two titles, I saw that I needed to turn off ODS Graphics in order to get everything to display correctly. So I was able to fix it!

 

However, I do have a lingering question. Do you know of any good resources to explain why ODS Graphics being on causes this? Or would you be able to tell me yourself? I just don't understand what ODS Graphics does enough to understand why it would cause this to happen.

 

 

Thanks!


Some of this relates to the interaction between the older graphics procedures, i.e. proc BOXPLOT, GPLOT and how they operate when ODS Graphics is on. Another interaction is between the specific ODS destinations from the documentation:

Where titles and footnotes are displayed depends on the device driver that you are using and on the setting of the ODS statement options GTITLE and GFOOTNOTE.

 

If you specify NOGTITLE for specific ODS destinations such as HTML, RTF or PDF then the titles do not appear in the graphic image but part of the 'document' space for lack of better term to come to mind.

 

Since most of the graphic improvements are occurring in the ODS graphics procedures such as sgplot or sgpanel I have pretty much quit using the older device based procedures.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1313 views
  • 3 likes
  • 2 in conversation