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

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;
1 ACCEPTED SOLUTION

Accepted Solutions
GraphGuy
Meteorite | Level 14

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.

View solution in original post

2 REPLIES 2
GraphGuy
Meteorite | Level 14

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.

LuizSousa
Calcite | Level 5

Thanks, I had not thought about that detail. I'm waiting for 9.4.

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
  • 2 replies
  • 2298 views
  • 1 like
  • 2 in conversation