BookmarkSubscribeRSS Feed
USchu
Calcite | Level 5

Hi everybody.

I faced a strange result when producing some slighty complicated sgpanel plots and tried to simplify the example as far as possible.

Running the following program, SAS results in a 200% bar for the  graph. 

DATA test;  
 /*<1>*/  varX=.; varY=2; varZ=7; OUTPUT;
 /*<2>*/  varX=1; varY=1; varZ=1; OUTPUT;
 /*<3>*/  varX=1; varY=1; varZ=2; OUTPUT;
RUN;
 
PROC SGPANEL DATA= test PCTLEVEL=GROUP; 
PANELBY varX;
  VBAR varY / GROUP=varZ STAT=PERCENT;
ROWAXIS LABEL='% of Z';  ;
RUN;

 

However, removing the Missing VarX dataline (<1>) or giving allways varZ=1 vor varX=1  (dataline<3>), sgpanel works fine.

 

Does anyone have an explanation for this?

I just can solve it by removing any varX=. lines using

Proc SGPANEL DATA=test(WHERE= (varX^=.));

but since this is simplified from a rather complicated multiuse macro, I would prefere to know the background of this result.

Thanks for any help.

Uli

1 REPLY 1
DanH_sas
SAS Super FREQ

This does appear to be an issue that needs to be investigated. I would recommend entering a ticket to Technical Support with this simple example you've created. In the meantime, you have two choices:

  1. If you want to exclude missing panel variable values from your display, WHERE clause them out as you propose.
  2. If you are okay with seeing these panels with missing values, just add the MISSING option to the PANELBY statement, and you should get the correct result.

Hope this helps!

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch 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
  • 1 reply
  • 57 views
  • 2 likes
  • 2 in conversation