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.
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
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:
Hope this helps!
Thank you, Dan,
for your valuable answer. I think I will follow your advice and write a ticket to Technical Support.
Best regards Uli
Is what you are looking for ?
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=CELL; PANELBY varX; VBAR varY / GROUP=varZ STAT=PERCENT ; ROWAXIS LABEL='% of Z'; ; RUN;
Thank you, Ksharp,
for your valuable proposal. I am sorry, my sample might have been to much simplified. I need indeed group percentages. However, the problem can be solved by the WHERE-clause mentioned above. I just wanted to know the background of this behaviour in order to be save using the program.
best regards Uli
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →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.
Ready to level-up your skills? Choose your own adventure.