BookmarkSubscribeRSS Feed
phil27
Calcite | Level 5

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.

1 REPLY 1
Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1098 views
  • 0 likes
  • 2 in conversation