Pessoal, estou com um problema na hora de gerar um GCHAR
O problema que imprime no log é esse:
NOTE: ERROR DETECTED IN ANNOTATE= DATASET WORK.ANLABELS.
NOTE: PROBLEM IN OBSERVATION 11 -
DATA SYSTEM REQUESTED, BUT VALUE IS NOT ON GRAPH 'SUBGROUP'
Ambulatório
NOTE: PROBLEM IN OBSERVATION 25 -
DATA SYSTEM REQUESTED, BUT VALUE IS NOT ON GRAPH 'MIDPOINT'
|Agreste|Meridional
NOTE: PROBLEM IN OBSERVATION 26 -
DATA SYSTEM REQUESTED, BUT VALUE IS NOT ON GRAPH 'MIDPOINT'
|Agreste|Meridional
Esse problema acontece quando o tamanho da variável carácter ultrapassa um certo limite.
No exemplo acima a variável tem esse conteúdo "|Agreste|Meridional 08.12 -|07.13"
| data anlabels(drop=nome_unimed indicador ); | ||
| length text $ 8 cbox $ 10; | ||
| retain function 'label' when 'a' xsys ysys '2' hsys '3' size 2 ; | ||
| set tab_final_grafico; | ||
| midpoint=nome_unimed; subgroup=indicador; |
| text=" " || left(put(valor,percentn12.2)); | ||||
| position = 'e'; | ||||
| /* | y = cumpct - (valor/2);*/ | |||
| if indicador = 'Consulta' then | ||||
| do; cbox = "#AC1632"; | ||||
| color = "white"; end; | ||||
| else if indicador = 'SADT' then | ||||
| do; cbox = "#FFD100"; | ||||
| color = "black"; end; | ||||
| else if indicador = 'Ambulatório' then | ||||
| do; cbox = "#B9D300"; | ||||
| color = "black"; end; | ||||
| else if indicador = 'Internação' then | ||||
| do;cbox = "#009FAF"; | ||||
| color = "white"; end; |
| where nome_orig in (&varFiltro.); | ||
| ; | ||
| run; |
| /* Define the axis characteristics */ | ||
| axis1 color=white | ||
| value=(justify=center) split='|' label=none ; | ||
| axis2 color=white LABEL=NONE | ||
| order=(0.00 to 1 by 0.1) | ||
| minor=(n=10); |
| pattern4 color="#FFD100"; /*SADT*/ | ||
| pattern3 color="#009FAF"; /*Internação*/ | ||
| pattern2 color="#AC1632"; /*Consulta*/ | ||
| pattern1 color="#B9D300"; /*Ambulatorio*/ |
| /* Define legend options */ | ||
| legend1 frame cframe=white; |
| proc gchart data=tab_final_grafico; | ||||||
| vbar nome_unimed / subgroup=indicador | ||||||
| sumvar=valor | ||||||
| legend=legend1 | ||||||
| /* | nostats*/ | |||||
| maxis=axis1 | ||||||
| raxis=axis2 | ||||||
| annotate=anlabels | ||||||
| width=8 | ||||||
| ; | ||||||
| where nome_orig in (&varFiltro.); |
| format valor percentn12.2; | ||
| run; | ||
| quit; | ||
Based on Google's translation of the Portuguese problem description:
... This problem happens when the size of the character variable exceeds a certain limit. In the above example the variable has that content "| Wasteland | South 08:12 - | 07:13"
I think you are running into the 32-character length limit. I recently entered a feature-request to get the length limit increased (tracking number S1096736), which the developers completed 2 weeks ago, and should be in the upcoming SAS 9.4-maintenance-3 release. The example I gave the developers used Proc Gplot, and I'll check to make sure the enhancement also works in Proc Gchart.
In the meantime (while you wait on the 9.4m3 SAS release), I think the only work-around is to use shorter text values, with length <=32 characters.
Based on Google's translation of the Portuguese problem description:
... This problem happens when the size of the character variable exceeds a certain limit. In the above example the variable has that content "| Wasteland | South 08:12 - | 07:13"
I think you are running into the 32-character length limit. I recently entered a feature-request to get the length limit increased (tracking number S1096736), which the developers completed 2 weeks ago, and should be in the upcoming SAS 9.4-maintenance-3 release. The example I gave the developers used Proc Gplot, and I'll check to make sure the enhancement also works in Proc Gchart.
In the meantime (while you wait on the 9.4m3 SAS release), I think the only work-around is to use shorter text values, with length <=32 characters.
Thanks, I had not thought about that detail. I'm waiting for 9.4.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.