Help using Base SAS procedures

[Proc Report]Print the word "TOTAL" in the rbreak summary line

Reply
Contributor
Posts: 36

[Proc Report]Print the word "TOTAL" in the rbreak summary line

Hi,

I would like to print the word "TOTAL" as the label of the total line performed with the rbreak statement.

The folling code produces no error but it does not print the word "TOTAL" :

%macro tabFlux(MyTable, MyVarLi);

      proc report nowd data=&MyTable missing;

      column &MyVarLi entres sortis presents flux flux_p;

      define &MyVarLi / group;

      define flux_p / computed "Flux rapportés aux presents au 31 Déc. &MyAn. (%)";

     

compute flux_p;

                 flux_p=flux.sum/presents.sum*100;

      endcomp;

      compute &MyVarLi;

           if _BREAK_="_RBREAK_" then &MyVarLi="TOTAL";

      endcomp;

     

      rbreak after / ol summarize style=[font_size=8pt font_weight=bold foreground=black background=gainsboro];

     

run;

%mend;

If someone has an idea it would be great.

Thanks.

SAS Super FREQ
Posts: 8,683

[Proc Report]Print the word "TOTAL" in the rbreak summary line

Hi,

  You are using an macro variable for &MYVARLI -- Let's say that the variable you pass to be a group variable is only a 1 byte character variable. In this case, you would only see the letter "T" in the output -- because an assignment like this is bound to the length (and type) of the variable whose cell value you want to change. If the variable you pass is a numeric variable, then the string "TOTAL" is not really something that can easily be placed in a "numeric" column. Can you explain a bit more about what type of variable you are passing to &MYVARLI??? Also, what is your destination of interest?? There is a PRETEXT method that will sometimes work, but not in the LISTING destination -- so what is your destination of interest?

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 86 views
  • 0 likes
  • 2 in conversation