Data visualization with SAS programming

Problem annodate in data set

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 8
Accepted Solution

Problem annodate in data set

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;

Accepted Solutions
Solution
‎07-24-2014 08:39 AM
SAS Employee
Posts: 977

Re: Problem annodate in data set

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


All Replies
Solution
‎07-24-2014 08:39 AM
SAS Employee
Posts: 977

Re: Problem annodate in data set

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.

Occasional Contributor
Posts: 8

Re: Problem annodate in data set

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

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 826 views
  • 1 like
  • 2 in conversation