<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: macro in proc report error multiple compute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906422#M357913</link>
    <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; he explained but he didn't say how to get around this problem, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and I tell you that I don't know how to do it.. combine the two macros into one? modify the compute..?&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="Y2IQFc"&gt;if yes, how can I meet my needs and not fall into the multiple compute error?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2023 12:06:31 GMT</pubDate>
    <dc:creator>snip</dc:creator>
    <dc:date>2023-12-06T12:06:31Z</dc:date>
    <item>
      <title>macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906306#M357861</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm in proc report.&lt;BR /&gt;I have around fifty variables. I try to optimize my processing through macro variables&lt;BR /&gt;I have a problem with multiple compute error…. (For information, my treatment works if I do not use macros)&lt;/P&gt;
&lt;P&gt;I built the two macros to replace my initial processing&lt;/P&gt;
&lt;P&gt;1-In the break line of my columns I do a calculation and I display the result in the break cells of my columns.&lt;BR /&gt;2- I do a compute to copy my values ​​for example: “tx_min_cible_&amp;amp;var..sum” into “top_tx_min_cible_&amp;amp;var”&lt;/P&gt;
&lt;P&gt;What did I miss?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro calc_top_sum(var);
    compute top_tx_min_cible_&amp;amp;var;
        top_tx_min_cible_&amp;amp;var = tx_min_cible_&amp;amp;var..sum;
    endcomp;

    compute top_tx_max_cible_&amp;amp;var;
        top_tx_max_cible_&amp;amp;var = tx_max_cible_&amp;amp;var..sum;
    endcomp;

%mend calc_top_sum;

/*****************************************************************/

%macro calc_top_taux_tot(var);
    
    compute top_tx_max_cible_&amp;amp;var;
        if nb_pers_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_&amp;amp;var = ……………….* 100;
        end;
        else top_tx_max_cible_&amp;amp;var = .; 
    endcomp;

    compute top_tx_min_cible_&amp;amp;var;
        if nb_pers_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_&amp;amp;var = …………………… * 100;
        end;
        else top_tx_min_cible_&amp;amp;var = .; 
    endcomp;
%mend calc_top_taux_tot;


PROC REPORT ;
.
.
.
% calc_top_sum(….) ;
% calc_top_sum(….) ;
% calc_top_sum(….) ;
% calc_top_sum(….) ;

BREAK
% calc_top_taux_tot (….) ;
% calc_top_taux_tot (….) ;
% calc_top_taux_tot (….) ;
% calc_top_taux_tot (….) ;

Run ;

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 18:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906306#M357861</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-05T18:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906311#M357863</link>
      <description>&lt;P&gt;Much of PROC REPORT processing depends on seeing ALL your code. We need to see the order of variables in your COLUMN statement and the usages in your DEFINE statements. Without this type of context, it is hard to comment constructively on your question. You indicated that your code works when it is not macro-ized. However, something is "breaking" when your code is macro-ized. &lt;BR /&gt;I am particularly confused by the word "BREAK" that appears in your question. There is not a statement in PROC REPORT that is the single WORD "BREAK" without a BEFORE or AFTER and a variable name or a location. In addition BREAK processing in PROC REPORT occurs at explicit places, and it would be hard to force a BREAK between COMPUTE blocks as you seem to imply.&lt;BR /&gt;But, as I said, without seeing the code that works and ALL of your macro code, it is hard to comment.&lt;BR /&gt;And, of course, without data, nobody can test or tweak your code.&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 19:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906311#M357863</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-12-05T19:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906312#M357864</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I have a problem with multiple compute error….&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You have to SHOW US the errors. For a macro producing errors, you need to first run this command to turn on macro debugging&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then run your PROC REPORT again, and copy the entire log (not parts of it, not just the error messages, but the ENTIRE log, every single line) —&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;If the log is producing lots of errors, we need to see the complete log for this PROC REPORT down to the first 10 errors or so. Then&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;DO NOT SKIP THIS STEP.&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1699900743276.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89703i797B759183DE7484/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1699900743276.png" alt="PaigeMiller_0-1699900743276.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 19:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906312#M357864</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-05T19:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906329#M357870</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Thanks for your feedback for reasons of confidentiality at the moment I do not have the right to communicate this data, I will check with my hierarchy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;while waiting I reproduced exactly the same report proc with a few columns and with the same characteristics as my real column (group, display, analysis, computed...) my columns. if that can help you see clearly and help me later.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: There are multiple COMPUTE statements for top_tx_min_cible_CTT&lt;/P&gt;
&lt;PRE&gt;ods excel file='..........xlsx' style=pearl;
ods excel options 
                (embedded_titles='none'        
                 FROZEN_ROWHEADERS='5'          
                 frozen_headers='yes'       
                 ); 
                     
%macro calc_top_sum(var);
  
    compute top_tx_min_cible_&amp;amp;var;
        top_tx_min_cible_&amp;amp;var = tx_min_cible_&amp;amp;var..sum;
    endcomp;

    compute top_tx_max_cible_&amp;amp;var;
        top_tx_max_cible_&amp;amp;var = tx_max_cible_&amp;amp;var..sum;
    endcomp;
   
%mend calc_top_sum;

%macro calc_top_taux_tot(var);
  
    compute top_tx_max_cible_&amp;amp;var;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / nb_siz_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_max_cible_&amp;amp;var = .; 
    endcomp;

    compute top_tx_min_cible_&amp;amp;var;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / nb_siz_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_min_cible_&amp;amp;var = .; 
    endcomp;
%mend calc_top_taux_tot;
proc report data=TAB_ANALYSE ;
column   ("~"  ZZ )  ("_blanc1_" nb_siz_cible) 

("CC" CTT_cible tx_min_cible_CTT tx_max_cible_CTT top_tx_min_cible_CTT top_tx_max_cible_CTT )		  
("BB" Evol_neg_cible tx_min_cible_Evol_neg tx_max_cible_Evol_neg TOP_tx_max_cible_Evol_neg TOP_tx_min_cible_Evol_neg)
 
("DD" Evol_pos_cible tx_min_cible_Evol_pos tx_max_cible_Evol_pos TOP_tx_max_cible_Evol_pos TOP_tx_min_cible_Evol_pos);

define  ZZ                             / group order=data  ;
define  nb_siz_cible                       / analysis  ;           


define  CTT_cible               / analysis  ;
define  tx_min_cible_CTT        / analysis  ;
define  tx_max_cible_CTT        / analysis  ;
define  top_tx_min_cible_CTT    / computed  ;
define  top_tx_max_cible_CTT    / computed  ;

define  Evol_neg_cible                  / analysis  ;           
define  tx_min_cible_Evol_neg           / analysis  ;
define  tx_max_cible_Evol_neg           / analysis  ;
define  TOP_tx_max_cible_Evol_neg       / computed   ;
define  TOP_tx_min_cible_Evol_neg       / computed   ;


define  Evol_pos_cible                  / analysis ;                  
define  tx_min_cible_Evol_pos           / analysis  ;
define  tx_max_cible_Evol_pos           / analysis  ;
define  TOP_tx_max_cible_Evol_pos       / computed  ;
define  TOP_tx_min_cible_Evol_pos       / computed  ;


%calc_top_sum(CTT);
%calc_top_sum(Evol_neg);
%calc_top_sum(Evol_pos);

break after ZZ / summarize ; 
       
%calc_top_taux_tot(CTT);
%calc_top_taux_tot(Evol_neg);
%calc_top_taux_tot(Evol_pos);

   endcomp;

run;
ods excel close;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip_0-1701809833057.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90831iF7F58EF70F4C25D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="snip_0-1701809833057.png" alt="snip_0-1701809833057.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906329#M357870</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-05T21:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906338#M357879</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/449477"&gt;@snip&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Thanks for your feedback for reasons of confidentiality at the moment I do not have the right to communicate this data, I will check with my hierarchy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your are getting the repeated error because you have two macros, both using the same base stem names for the variables and suffix provided by the macros&lt;/P&gt;
&lt;PRE&gt;%macro calc_top_sum(var);
  
    compute &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;top_tx_min_cible_&amp;amp;var&lt;/STRONG&gt;&lt;/FONT&gt;;
        top_tx_min_cible_&amp;amp;var = tx_min_cible_&amp;amp;var..sum;
    endcomp;

    compute top_tx_max_cible_&amp;amp;var;
        top_tx_max_cible_&amp;amp;var = tx_max_cible_&amp;amp;var..sum;
    endcomp;
   
%mend calc_top_sum;

%macro calc_top_taux_tot(var);
  
    compute top_tx_max_cible_&amp;amp;var;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / nb_siz_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_max_cible_&amp;amp;var = .; 
    endcomp;

    compute&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt; top_tx_min_cible_&amp;amp;var;&lt;/STRONG&gt;&lt;/FONT&gt;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / nb_siz_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_min_cible_&amp;amp;var = .; 
    endcomp;
%mend calc_top_taux_tot;&lt;/PRE&gt;
&lt;P&gt;So every time that you use the same parameter and call both of those macros you get the duplication.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906338#M357879</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-12-05T21:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906354#M357883</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;SPAN class="Y2IQFc"&gt;if I use my hard report proc, it works!! there is no problem, I tell myself that maybe I am using the two macros wrong?? !!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;for my hard copy use, I need to calculate my break and then copy my values ​​from my tx... .sum columns into my top columns...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=TAB_ANALYSE ;
column   ("~"  ZZ )  ("_blanc1_" nb_siz_cible) 

("CC" CTT_cible tx_min_cible_CTT tx_max_cible_CTT top_tx_min_cible_CTT top_tx_max_cible_CTT )		  
("BB" Evol_neg_cible tx_min_cible_Evol_neg tx_max_cible_Evol_neg TOP_tx_max_cible_Evol_neg TOP_tx_min_cible_Evol_neg)
 
("DD" Evol_pos_cible tx_min_cible_Evol_pos tx_max_cible_Evol_pos TOP_tx_max_cible_Evol_pos TOP_tx_min_cible_Evol_pos);

define  ZZ                             / group order=data  ;
define  nb_siz_cible                       / analysis  ;           


define  CTT_cible               / analysis  ;
define  tx_min_cible_CTT        / analysis  ;
define  tx_max_cible_CTT        / analysis  ;
define  top_tx_min_cible_CTT    / computed  ;
define  top_tx_max_cible_CTT    / computed  ;

define  Evol_neg_cible                  / analysis  ;           
define  tx_min_cible_Evol_neg           / analysis  ;
define  tx_max_cible_Evol_neg           / analysis  ;
define  TOP_tx_max_cible_Evol_neg       / computed   ;
define  TOP_tx_min_cible_Evol_neg       / computed   ;


define  Evol_pos_cible                  / analysis ;                  
define  tx_min_cible_Evol_pos           / analysis  ;
define  tx_max_cible_Evol_pos           / analysis  ;
define  TOP_tx_max_cible_Evol_pos       / computed  ;
define  TOP_tx_min_cible_Evol_pos       / computed  ;


compute top_tx_min_cible_CTT;
top_tx_min_cible_CTT=tx_min_cible_CTT.SUM;
endcomp;
compute top_tx_max_cible_CTT;
top_tx_max_cible_CTT =tx_max_cible_CTT.SUM;

compute top_tx_min_cible_Evol_neg;
top_tx_min_cible_Evol_neg=tx_min_cible_Evol_neg.SUM;
endcomp;
compute top_tx_max_cible_Evol_neg;
top_tx_max_cible_Evol_neg =tx_max_cible_Evol_neg.SUM;

compute top_tx_min_cible_Evol_pos;
top_tx_min_cible_Evol_pos=tx_min_cible_Evol_pos.SUM;
endcomp;
compute top_tx_max_cible_Evol_pos;
top_tx_max_cible_Evol_pos =tx_max_cible_Evol_pos.SUM;


break after ZZ / summarize ; 
/*************************/    
compute top_tx_max_cible_CTT;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_CTT = ((CTT_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((CTT_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (CTT_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_max_cible_CTT = .; 
    endcomp;

    compute top_tx_min_cible_CTT ;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_CTT = ((CTT_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((CTT_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (CTT_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_min_cible_CTT = .; 
    endcomp;
/*****************/
	compute top_tx_max_cible_Evol_neg;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_Evol_neg = ((Evol_neg_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((Evol_neg_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (Evol_neg_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_max_cible_Evol_neg = .; 
    endcomp;

    compute top_tx_min_cible_Evol_neg;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_Evol_neg = ((Evol_neg_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((Evol_neg_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (Evol_neg_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_min_cible_Evol_neg = .; 
    endcomp;
	/*******************************/

		compute top_tx_max_cible_Evol_pos;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_Evol_pos = ((Evol_pos_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((Evol_pos_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (Evol_pos_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_max_cible_Evol_pos = .; 
    endcomp;

    compute top_tx_min_cible_Evol_pos;
        if nb_siz_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_Evol_pos = ((Evol_pos_cible.sum / nb_siz_cible.sum) + 
                                      (1.96 * sqrt((Evol_pos_cible.sum / nb_siz_cible.sum) * 
                                      (1 - (Evol_pos_cible.sum / nb_siz_cible.sum))) / nb_siz_cible.sum)) * 100;
        end;
        else top_tx_min_cible_Evol_pos = .; 
    endcomp;
run;
ods excel close;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 21:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906354#M357883</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-05T21:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906357#M357885</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/449477"&gt;@snip&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Thanks for your feedback for reasons of confidentiality at the moment I do not have the right to communicate this data, I will check with my hierarchy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;while waiting I reproduced exactly the same report proc with a few columns and with the same characteristics as my real column &lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I asked to see the log, not the data. You have not shown us the log as I requested.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 22:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906357#M357885</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-05T22:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906365#M357889</link>
      <description>Hi:&lt;BR /&gt;  If the code you've posted works with your data, then somehow in the process of writing your macro program(s), the code you're generating is not correct syntax-wise or not correct within the context of PROC REPORT. &lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 06 Dec 2023 00:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906365#M357889</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2023-12-06T00:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906408#M357907</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I have the two logs below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;log 1: without macro ===&amp;gt; it works &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;log2: with macro==&amp;gt; in error&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                                  LOG:1&lt;BR /&gt;10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         FILENAME EGSR TEMP;
15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16             STYLE=HTMLBlue
17             STYLESHEET=(URL=file:///C:/Program%20Files%20(x86)/SASHome/x86/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css)
18             NOGTITLE
19             NOGFOOTNOTE
20             GPATH=&amp;amp;sasworklocation
21             ENCODING=UTF8
22             options(rolap="on")
23         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         FILENAME EGXLSSX TEMP;
25         ODS EXCEL(ID=EGXLSSX) FILE=EGXLSSX STYLE=Excel
26         OPTIONS (
27          EMBEDDED_TITLES="no" EMBEDDED_FOOTNOTES="no" SHEET_INTERVAL="None"
28         );
29         
30         GOPTIONS ACCESSIBLE;
31         
32         options mprint;
33         
34         PROC FORMAT ;
34       !               PICTURE milliers (ROUND)
35                                99999999='-'
36                               low - &amp;lt;0 = "000 000 009" (prefix='-')
37                                       0 - &amp;lt;99999999= "000 000 009"                      ;
NOTE: Format MILLIERS is already on the library WORK.FORMATS.
NOTE: Format MILLIERS has been output.
38         RUN ;

NOTE: PROCEDURE FORMAT a utilisé (Durée totale du traitement) :
      real time           0.00 seconds
      cpu time            0.00 seconds
      

39         ods listing close ;
40         ods excel file='S:\qs\02. fatyr\kjh\clars.xlsx' style=pearl;
41         
42         
43         proc report data=TAB split='*' ;
44         column
45          ("~"  UNIVERS  )
46         ("_blanc1_" pers_cible) ("_blanc2_" pers_temoin)
47         
48         
2                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

49         /* CONTACT ENTRANT */
50         ("ENTRANT"
51         entrant_cible
52         entrant_temoin
53         
54         tx_min_cible_entrant
55         tx_max_cible_entrant
56         tx_min_temoin_entrant
57         tx_max_temoin_entrant
58         top_tx_min_cible_entrant
59         top_tx_max_cible_entrant
60         top_tx_min_temoin_entrant
61         top_tx_max_temoin_entrant)
62         
63                   
64         ("NEG"
65         Neg_cible
66         Neg_temoin
67         
68         tx_min_cible_Neg
69         tx_max_cible_Neg
70         tx_min_temoin_Neg
71         tx_max_temoin_Neg
72         TOP_tx_max_temoin_Neg
73         TOP_tx_min_temoin_Neg
74         TOP_tx_max_cible_Neg
75         TOP_tx_min_cible_Neg
76         )
77         
78         /* CLIENTS avec HAUSSE de CA */
79         ("POS"
80         pos_cible
81         pos_temoin
82         
83         tx_min_cible_pos
84         tx_max_cible_pos
85         tx_min_temoin_pos
86         tx_max_temoin_pos
87         TOP_tx_max_temoin_pos
88         TOP_tx_min_temoin_pos
89         TOP_tx_max_cible_pos
90         TOP_tx_min_cible_pos
91         )
92         ;
93         
94         define  UNIVERS                             / group order=data             style(header)={ width=1IN  FOREGROUND=BLACK};
94       ! define  univers /style(column)={width=1IN /*cellwidth=2.5cm*/ fontsize=6pt just=LEFT};
95         
96         define  pers_cible                       / analysis                     FORMAT=commax12.0    style(header)={
96       ! cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};       define  pers_cible /style(column)={ just=center};
97         define  pers_temoin                      / analysis                   FORMAT=commax12.0    style(header)={cellwidth=1.3cm
97       !   FOREGROUND=BLACK background=#DCE6F1};        define  pers_temoin /style(column)={ just=center};
98         
99         /* CONTACT ENTRANT */
100        define  entrant_cible               / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK
100      !  background=#DDD9C4};           define  entrant_cible /style(column)={just=center};
101        define  entrant_temoin              / analysis noprint ;
102        define  tx_min_cible_entrant        / analysis                         format=5.4
3                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

102      ! style(header)={cellwidth=2.5cm};
103        define  tx_max_cible_entrant        / analysis                         format=5.4
103      ! style(header)={cellwidth=2.5cm};;
104        define  tx_min_temoin_entrant       / analysis                         format=5.4
104      ! style(header)={cellwidth=2.5cm};;
105        define  tx_max_temoin_entrant       / analysis                         format=5.4
105      ! style(header)={cellwidth=2.5cm};;
106        
107        define  top_tx_min_cible_entrant    / computed                         format=5.4
107      ! style(header)={cellwidth=2.5cm};;
108        define  top_tx_max_cible_entrant    / computed                         format=5.4
108      ! style(header)={cellwidth=2.5cm};;
109        define  top_tx_min_temoin_entrant   / computed                         format=5.4
109      ! style(header)={cellwidth=2.5cm};;
110        define  top_tx_max_temoin_entrant   / computed                         format=5.4
110      ! style(header)={cellwidth=2.5cm};;
111        
112        
113        /* CLIENTS avec PERTE de CA */
114        define  Neg_cible                  / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK
114      ! background=#C5D9F1};define  Neg_cible / style(column)={just=center};
115        define  Neg_temoin                 / analysis noprint;
116        define  tx_min_cible_Neg           / analysis                        format=5.4
116      ! style(header)={cellwidth=2.5cm};;
117        define  tx_max_cible_Neg           / analysis                        format=5.4
117      ! style(header)={cellwidth=2.5cm};;
118        define  tx_min_temoin_Neg          / analysis                        format=5.4
118      ! style(header)={cellwidth=2.5cm};;
119        define  tx_max_temoin_Neg          / analysis                        format=5.4
119      ! style(header)={cellwidth=2.5cm};;
120        
121        define  TOP_tx_max_temoin_Neg      / computed                        format=5.4
121      ! style(header)={cellwidth=2.5cm};
122        define  TOP_tx_min_temoin_Neg      / computed                        format=5.4
122      ! style(header)={cellwidth=2.5cm};
123        define  TOP_tx_max_cible_Neg       / computed                        format=5.4
123      ! style(header)={cellwidth=2.5cm};
124        define  TOP_tx_min_cible_Neg       / computed                        format=5.4
124      ! style(header)={cellwidth=2.5cm};
125        
126        /* CLIENTS avec HAUSSE de CA */
127        define  pos_cible                  / analysis                     FORMAT=commax12.0  style(header)={ FOREGROUND=BLACK
127      ! background=#8DB4E2};define  pos_cible / style(column)={just=center};
128        define  pos_temoin                 / analysis noprint;
129        define  tx_min_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
130        define  tx_max_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
131        define  tx_min_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
132        define  tx_max_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
133        
134        define  TOP_tx_max_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
135        define  TOP_tx_min_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
136        define  TOP_tx_max_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
137        define  TOP_tx_min_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
138        
139        
140        
141        compute top_tx_min_cible_entrant;
142        top_tx_min_cible_entrant=tx_min_cible_entrant.SUM;
4                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

143        endcomp;
144        compute top_tx_max_cible_entrant;
145        top_tx_max_cible_entrant =tx_max_cible_entrant.SUM;
146        endcomp;
147        compute top_tx_min_temoin_entrant;
148        top_tx_min_temoin_entrant =tx_min_temoin_entrant.SUM;
149        endcomp;
150        compute top_tx_max_temoin_entrant;
151        top_tx_max_temoin_entrant=tx_max_temoin_entrant.SUM;
152        endcomp;
153        
154        
155        /*******************/
156        compute top_tx_min_cible_Neg;
157        top_tx_min_cible_Neg=tx_min_cible_Neg.SUM;
158        endcomp;
159        compute top_tx_max_cible_Neg;
160        top_tx_max_cible_Neg =tx_max_cible_Neg.SUM;
161        endcomp;
162        compute top_tx_min_temoin_Neg;
163        top_tx_min_temoin_Neg =tx_min_temoin_Neg.SUM;
164        endcomp;
165        compute top_tx_max_temoin_Neg;
166        top_tx_max_temoin_Neg=tx_max_temoin_Neg.SUM;
167        endcomp;
168        
169        /*******************/
170        compute top_tx_min_cible_pos;
171        top_tx_min_cible_pos=tx_min_cible_pos.SUM;
172        endcomp;
173        compute top_tx_max_cible_pos;
174        top_tx_max_cible_pos =tx_max_cible_pos.SUM;
175        endcomp;
176        compute top_tx_min_temoin_pos;
177        top_tx_min_temoin_pos =tx_min_temoin_pos.SUM;
178        endcomp;
179        compute top_tx_max_temoin_pos;
180        top_tx_max_temoin_pos=tx_max_temoin_pos.SUM;
181        endcomp;
182        
183        break after univers / summarize ;
184        
185        compute after univers;
186        length univers $80;
187        univers=catx('','TOTAL',univers);
188        
189        
190        /* entrant ********************************************************/
191        /* taux maxi pour temoin */
192          if pers_temoin.sum &amp;gt; 0 then do;
193                top_tx_max_temoin_entrant = ((entrant_temoin.sum/pers_temoin.sum) + (1.96 *
193      ! sqrt(((entrant_temoin.sum/pers_temoin.sum) * (1 - (entrant_temoin.sum/pers_temoin.sum))   ) / pers_temoin.sum)))*100;
194            end;
195            else top_tx_max_temoin_entrant = .;
196        /*taux mini pour temoin */
197          if pers_temoin.sum &amp;gt; 0 then do;
198                top_tx_min_temoin_entrant = ((entrant_temoin.sum/pers_temoin.sum) - (1.96 *
198      ! sqrt(((entrant_temoin.sum/pers_temoin.sum) * (1 - (entrant_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
5                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

199            end;
200            else top_tx_min_temoin_entrant = .;
201        
202        /*taux maxi pour cible */
203          if pers_cible.sum &amp;gt; 0 then do;
204                top_tx_max_cible_entrant= ((entrant_cible.sum/pers_cible.sum) + (1.96 * sqrt(((entrant_cible.sum/pers_cible.sum)
204      ! * (1 - (entrant_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
205            end;
206            else top_tx_max_cible_entrant = .;
207        /*taux mini pour cible */
208          if pers_cible.sum &amp;gt; 0 then do;
209                top_tx_min_cible_entrant= ((entrant_cible.sum/pers_cible.sum) - (1.96 * sqrt(((entrant_cible.sum/pers_cible.sum)
209      ! * (1 - (entrant_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
210            end;
211            else top_tx_min_cible_entrant= .;
212        
213        /* Neg ********************************************************/  
214        /* taux maxi pour temoin */
215          if pers_temoin.sum &amp;gt; 0 then do;
216                top_tx_max_temoin_Neg= ((Neg_temoin.sum/pers_temoin.sum) + (1.96 * sqrt(((Neg_temoin.sum/pers_temoin.sum) * (1 -
216      ! (Neg_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
217            end;
218            else top_tx_max_temoin_Neg= .;
219        /*taux mini pour temoin */
220          if pers_temoin.sum &amp;gt; 0 then do;
221                top_tx_min_temoin_Neg= ((Neg_temoin.sum/pers_temoin.sum) - (1.96 * sqrt(((Neg_temoin.sum/pers_temoin.sum) * (1 -
221      ! (Neg_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
222            end;
223            else top_tx_min_temoin_Neg= .;
224        
225        /*taux maxi pour cible */
226          if pers_cible.sum &amp;gt; 0 then do;
227                top_tx_max_cible_Neg= ((Neg_cible.sum/pers_cible.sum) + (1.96 * sqrt(((Neg_cible.sum/pers_cible.sum) * (1 -
227      ! (Neg_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
228            end;
229            else top_tx_max_cible_Neg= .;
230        /*taux mini pour cible */
231          if pers_cible.sum &amp;gt; 0 then do;
232                top_tx_min_cible_Neg= ((Neg_cible.sum/pers_cible.sum) - (1.96 * sqrt(((Neg_cible.sum/pers_cible.sum) * (1 -
232      ! (Neg_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
233            end;
234            else top_tx_min_cible_Neg= .;
235        
236        /*   pos   ********************************************************/
237             /* taux maxi pour temoin */
238          if pers_temoin.sum &amp;gt; 0 then do;
239                top_tx_max_temoin_pos= ((pos_temoin.sum/pers_temoin.sum) + (1.96 * sqrt(((pos_temoin.sum/pers_temoin.sum) * (1 -
239      ! (pos_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
240            end;
241            else top_tx_max_temoin_pos= .;
242        /*taux mini pour temoin */
243          if pers_temoin.sum &amp;gt; 0 then do;
244                top_tx_min_temoin_pos= ((pos_temoin.sum/pers_temoin.sum) - (1.96 * sqrt(((pos_temoin.sum/pers_temoin.sum) * (1 -
244      ! (pos_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
245            end;
246            else top_tx_min_temoin_pos= .;
247        
248        /*taux maxi pour cible */
6                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

249          if pers_cible.sum &amp;gt; 0 then do;
250                top_tx_max_cible_pos= ((pos_cible.sum/pers_cible.sum) + (1.96 * sqrt(((pos_cible.sum/pers_cible.sum) * (1 -
250      ! (pos_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
251            end;
252            else top_tx_max_cible_pos= .;
253        /*taux mini pour cible */
254          if pers_cible.sum &amp;gt; 0 then do;
255                top_tx_min_cible_pos= ((pos_cible.sum/pers_cible.sum) - (1.96 * sqrt(((pos_cible.sum/pers_cible.sum) * (1 -
255      ! (pos_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
256            end;
257            else top_tx_min_cible_pos= .;
258        
259        
260        
261        endcomp;
262        run;

WARNING: Length of character variable UNIVERS has already been set. 
         Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.
NOTE: There were 249 observations read from the data set WORK.TAB.
NOTE: At least one W.D format was too small for the number to be printed. The decimal may be shifted by the "BEST" format.
NOTE: PROCEDURE REPORT a utilisé (Durée totale du traitement) :
      real time           0.29 seconds
      cpu time            0.29 seconds
      

263        ods excel close;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                                                LOG : 2
1                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=PNG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         FILENAME EGSR TEMP;
15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
16             STYLE=HTMLBlue
17             STYLESHEET=(URL=file:///C:/Program%20Files%20(x86)/SASHome/x86/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css)
18             NOGTITLE
19             NOGFOOTNOTE
20             GPATH=&amp;amp;sasworklocation
21             ENCODING=UTF8
22             options(rolap="on")
23         ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24         FILENAME EGXLSSX TEMP;
25         ODS EXCEL(ID=EGXLSSX) FILE=EGXLSSX STYLE=Excel
26         OPTIONS (
27          EMBEDDED_TITLES="no" EMBEDDED_FOOTNOTES="no" SHEET_INTERVAL="None"
28         );
29         
30         GOPTIONS ACCESSIBLE;
31         
32         options mprint;
33         
34         PROC FORMAT ;
34       !               PICTURE milliers (ROUND)
35                                99999999='-'
36                               low - &amp;lt;0 = "000 000 009" (prefix='-')
37                                       0 - &amp;lt;99999999= "000 000 009"                      ;
NOTE: Format MILLIERS is already on the library WORK.FORMATS.
NOTE: Format MILLIERS has been output.
38         RUN ;

NOTE: PROCEDURE FORMAT a utilisé (Durée totale du traitement) :
      real time           0.00 seconds
      cpu time            0.00 seconds
      

39         ods listing close ;
40         ods excel file='S:\qs\02. fatyr\kjh\clars.xlsx' style=pearl;
41         
42         %macro calc_top_sum(var);
43             /* Calcul de la somme du taux minimum pour le groupe cible */
44             compute top_tx_min_cible_&amp;amp;var;
45                 top_tx_min_cible_&amp;amp;var = tx_min_cible_&amp;amp;var..sum;
46             endcomp;
47         
48             /* Calcul de la somme du taux maximum pour le groupe cible */
2                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

49             compute top_tx_max_cible_&amp;amp;var;
50                 top_tx_max_cible_&amp;amp;var = tx_max_cible_&amp;amp;var..sum;
51             endcomp;
52         
53             /* Calcul de la somme du taux minimum pour le groupe témoin */
54             compute top_tx_min_temoin_&amp;amp;var;
55                 top_tx_min_temoin_&amp;amp;var = tx_min_temoin_&amp;amp;var..sum;
56             endcomp;
57         
58             /* Calcul de la somme du taux maximum pour le groupe témoin */
59             compute top_tx_max_temoin_&amp;amp;var;
60                 top_tx_max_temoin_&amp;amp;var = tx_max_temoin_&amp;amp;var..sum;
61             endcomp;
62         %mend calc_top_sum;
63         
64         /********************************************/
65         %macro calc_top_taux_tot(var);
66             /* Calcul du taux maximum et minimum pour temoin et cible pour &amp;amp;var */
67             compute top_tx_max_temoin_&amp;amp;var;
68                 /* Calculer le taux maximum pour le groupe témoin si le nombre de personnes est supérieur à 0 */
69                 if pers_temoin.sum &amp;gt; 0 then do;
70                     top_tx_max_temoin_&amp;amp;var = ((&amp;amp;var._temoin.sum / pers_temoin.sum) +
71                                               (1.96 * sqrt((&amp;amp;var._temoin.sum / pers_temoin.sum) *
72                                               (1 - (&amp;amp;var._temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
73                 end;
74                 else top_tx_max_temoin_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
75             endcomp;
76                /* Calculer le taux minimum pour le groupe témoin si le nombre de personnes est supérieur à 0 */
77             compute top_tx_min_temoin_&amp;amp;var;
78                 if pers_temoin.sum &amp;gt; 0 then do;
79                     top_tx_min_temoin_&amp;amp;var = ((&amp;amp;var._temoin.sum / pers_temoin.sum) +
80                                               (1.96 * sqrt((&amp;amp;var._temoin.sum / pers_temoin.sum) *
81                                               (1 - (&amp;amp;var._temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
82                 end;
83                 else top_tx_min_temoin_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
84             endcomp;
85                 /* Calculer le taux maximum pour le groupe cible si le nombre de personnes est supérieur à 0 */
86             compute top_tx_max_cible_&amp;amp;var;
87                 if pers_cible.sum &amp;gt; 0 then do;
88                     top_tx_max_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / pers_cible.sum) +
89                                               (1.96 * sqrt((&amp;amp;var._cible.sum / pers_cible.sum) *
90                                               (1 - (&amp;amp;var._cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
91                 end;
92                 else top_tx_max_cible_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
93             endcomp;
94         
95         /* Calculer le taux minimum pour le groupe cible si le nombre de personnes est supérieur à 0 */
96             compute top_tx_min_cible_&amp;amp;var;
97                 if pers_cible.sum &amp;gt; 0 then do;
98                     top_tx_min_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / pers_cible.sum) +
99                                               (1.96 * sqrt((&amp;amp;var._cible.sum / pers_cible.sum) *
100                                              (1 - (&amp;amp;var._cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
101                end;
102                else top_tx_min_cible_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
103            endcomp;
104        %mend calc_top_taux_tot;
105        
106        
3                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

107        
108        proc report data=TAB split='*' ;
109        column
110         ("~"  UNIVERS  )
111        ("_blanc1_" pers_cible) ("_blanc2_" pers_temoin)
112        
113        
114        /* CONTACT ENTRANT */
115        ("ENTRANT"
116        entrant_cible
117        entrant_temoin
118        
119        tx_min_cible_entrant
120        tx_max_cible_entrant
121        tx_min_temoin_entrant
122        tx_max_temoin_entrant
123        top_tx_min_cible_entrant
124        top_tx_max_cible_entrant
125        top_tx_min_temoin_entrant
126        top_tx_max_temoin_entrant)
127        
128                  
129        ("NEG"
130        Neg_cible
131        Neg_temoin
132        
133        tx_min_cible_Neg
134        tx_max_cible_Neg
135        tx_min_temoin_Neg
136        tx_max_temoin_Neg
137        TOP_tx_max_temoin_Neg
138        TOP_tx_min_temoin_Neg
139        TOP_tx_max_cible_Neg
140        TOP_tx_min_cible_Neg
141        )
142        
143        /* CLIENTS avec HAUSSE de CA */
144        ("POS"
145        pos_cible
146        pos_temoin
147        
148        tx_min_cible_pos
149        tx_max_cible_pos
150        tx_min_temoin_pos
151        tx_max_temoin_pos
152        TOP_tx_max_temoin_pos
153        TOP_tx_min_temoin_pos
154        TOP_tx_max_cible_pos
155        TOP_tx_min_cible_pos
156        )
157        ;
158        
159        define  UNIVERS                             / group order=data             style(header)={ width=1IN  FOREGROUND=BLACK};
159      ! define  univers /style(column)={width=1IN /*cellwidth=2.5cm*/ fontsize=6pt just=LEFT};
160        
161        define  pers_cible                       / analysis                     FORMAT=commax12.0    style(header)={
161      ! cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};       define  pers_cible /style(column)={ just=center};
162        define  pers_temoin                      / analysis                   FORMAT=commax12.0    style(header)={cellwidth=1.3cm
4                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

162      !   FOREGROUND=BLACK background=#DCE6F1};        define  pers_temoin /style(column)={ just=center};
163        
164        /* CONTACT ENTRANT */
165        define  entrant_cible               / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK
165      !  background=#DDD9C4};           define  entrant_cible /style(column)={just=center};
166        define  entrant_temoin              / analysis noprint ;
167        define  tx_min_cible_entrant        / analysis                         format=5.4
167      ! style(header)={cellwidth=2.5cm};
168        define  tx_max_cible_entrant        / analysis                         format=5.4
168      ! style(header)={cellwidth=2.5cm};;
169        define  tx_min_temoin_entrant       / analysis                         format=5.4
169      ! style(header)={cellwidth=2.5cm};;
170        define  tx_max_temoin_entrant       / analysis                         format=5.4
170      ! style(header)={cellwidth=2.5cm};;
171        
172        define  top_tx_min_cible_entrant    / computed                         format=5.4
172      ! style(header)={cellwidth=2.5cm};;
173        define  top_tx_max_cible_entrant    / computed                         format=5.4
173      ! style(header)={cellwidth=2.5cm};;
174        define  top_tx_min_temoin_entrant   / computed                         format=5.4
174      ! style(header)={cellwidth=2.5cm};;
175        define  top_tx_max_temoin_entrant   / computed                         format=5.4
175      ! style(header)={cellwidth=2.5cm};;
176        
177        
178        /* CLIENTS avec PERTE de CA */
179        define  Neg_cible                  / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK
179      ! background=#C5D9F1};define  Neg_cible / style(column)={just=center};
180        define  Neg_temoin                 / analysis noprint;
181        define  tx_min_cible_Neg           / analysis                        format=5.4
181      ! style(header)={cellwidth=2.5cm};;
182        define  tx_max_cible_Neg           / analysis                        format=5.4
182      ! style(header)={cellwidth=2.5cm};;
183        define  tx_min_temoin_Neg          / analysis                        format=5.4
183      ! style(header)={cellwidth=2.5cm};;
184        define  tx_max_temoin_Neg          / analysis                        format=5.4
184      ! style(header)={cellwidth=2.5cm};;
185        
186        define  TOP_tx_max_temoin_Neg      / computed                        format=5.4
186      ! style(header)={cellwidth=2.5cm};
187        define  TOP_tx_min_temoin_Neg      / computed                        format=5.4
187      ! style(header)={cellwidth=2.5cm};
188        define  TOP_tx_max_cible_Neg       / computed                        format=5.4
188      ! style(header)={cellwidth=2.5cm};
189        define  TOP_tx_min_cible_Neg       / computed                        format=5.4
189      ! style(header)={cellwidth=2.5cm};
190        
191        /* CLIENTS avec HAUSSE de CA */
192        define  pos_cible                  / analysis                     FORMAT=commax12.0  style(header)={ FOREGROUND=BLACK
192      ! background=#8DB4E2};define  pos_cible / style(column)={just=center};
193        define  pos_temoin                 / analysis noprint;
194        define  tx_min_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
195        define  tx_max_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
196        define  tx_min_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
197        define  tx_max_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
198        
199        define  TOP_tx_max_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
200        define  TOP_tx_min_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
5                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

201        define  TOP_tx_max_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
202        define  TOP_tx_min_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
203        
204        
205        %calc_top_sum(entrant);
MPRINT(CALC_TOP_SUM):   compute top_tx_min_cible_entrant;
MPRINT(CALC_TOP_SUM):   top_tx_min_cible_entrant = tx_min_cible_entrant.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_cible_entrant;
MPRINT(CALC_TOP_SUM):   top_tx_max_cible_entrant = tx_max_cible_entrant.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_min_temoin_entrant;
MPRINT(CALC_TOP_SUM):   top_tx_min_temoin_entrant = tx_min_temoin_entrant.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_temoin_entrant;
MPRINT(CALC_TOP_SUM):   top_tx_max_temoin_entrant = tx_max_temoin_entrant.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
206        %calc_top_sum(Neg);
MPRINT(CALC_TOP_SUM):   compute top_tx_min_cible_Neg;
MPRINT(CALC_TOP_SUM):   top_tx_min_cible_Neg = tx_min_cible_Neg.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_cible_Neg;
MPRINT(CALC_TOP_SUM):   top_tx_max_cible_Neg = tx_max_cible_Neg.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_min_temoin_Neg;
MPRINT(CALC_TOP_SUM):   top_tx_min_temoin_Neg = tx_min_temoin_Neg.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_temoin_Neg;
MPRINT(CALC_TOP_SUM):   top_tx_max_temoin_Neg = tx_max_temoin_Neg.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
207        %calc_top_sum(pos);
MPRINT(CALC_TOP_SUM):   compute top_tx_min_cible_pos;
MPRINT(CALC_TOP_SUM):   top_tx_min_cible_pos = tx_min_cible_pos.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_cible_pos;
MPRINT(CALC_TOP_SUM):   top_tx_max_cible_pos = tx_max_cible_pos.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_min_temoin_pos;
MPRINT(CALC_TOP_SUM):   top_tx_min_temoin_pos = tx_min_temoin_pos.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
MPRINT(CALC_TOP_SUM):   compute top_tx_max_temoin_pos;
MPRINT(CALC_TOP_SUM):   top_tx_max_temoin_pos = tx_max_temoin_pos.sum;
MPRINT(CALC_TOP_SUM):   endcomp;
208        
209        
210        
211        break after univers / summarize ;
212        
213        compute after univers;
214        length univers $80;
215        univers=catx('','TOTAL',univers);
216        
217        %calc_top_taux_tot(entrant);
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_temoin_entrant;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_temoin_entrant = ((entrant_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((entrant_temoin.sum 
/ pers_temoin.sum) * (1 - (entrant_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
6                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_temoin_entrant = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_temoin_entrant;
ERROR: There are multiple COMPUTE statements for  top_tx_min_temoin_entrant.
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_temoin_entrant = ((entrant_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((entrant_temoin.sum 
/ pers_temoin.sum) * (1 - (entrant_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_temoin_entrant = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_cible_entrant;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_cible_entrant = ((entrant_cible.sum / pers_cible.sum) + (1.96 * sqrt((entrant_cible.sum / 
pers_cible.sum) * (1 - (entrant_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_cible_entrant = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_cible_entrant;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_cible_entrant = ((entrant_cible.sum / pers_cible.sum) + (1.96 * sqrt((entrant_cible.sum / 
pers_cible.sum) * (1 - (entrant_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_cible_entrant = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
218        %calc_top_taux_tot(Neg);
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_temoin_Neg;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_temoin_Neg = ((Neg_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((Neg_temoin.sum / 
pers_temoin.sum) * (1 - (Neg_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_temoin_Neg = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_temoin_Neg;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_temoin_Neg = ((Neg_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((Neg_temoin.sum / 
pers_temoin.sum) * (1 - (Neg_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_temoin_Neg = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_cible_Neg;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_cible_Neg = ((Neg_cible.sum / pers_cible.sum) + (1.96 * sqrt((Neg_cible.sum / 
pers_cible.sum) * (1 - (Neg_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_cible_Neg = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_cible_Neg;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_cible_Neg = ((Neg_cible.sum / pers_cible.sum) + (1.96 * sqrt((Neg_cible.sum / 
pers_cible.sum) * (1 - (Neg_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_cible_Neg = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
219        %calc_top_taux_tot(pos);
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_temoin_pos;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_temoin_pos = ((pos_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((pos_temoin.sum / 
pers_temoin.sum) * (1 - (pos_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
7                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_temoin_pos = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_temoin_pos;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_temoin.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_temoin_pos = ((pos_temoin.sum / pers_temoin.sum) + (1.96 * sqrt((pos_temoin.sum / 
pers_temoin.sum) * (1 - (pos_temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_temoin_pos = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_max_cible_pos;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_max_cible_pos = ((pos_cible.sum / pers_cible.sum) + (1.96 * sqrt((pos_cible.sum / 
pers_cible.sum) * (1 - (pos_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_max_cible_pos = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
MPRINT(CALC_TOP_TAUX_TOT):   compute top_tx_min_cible_pos;
MPRINT(CALC_TOP_TAUX_TOT):   if pers_cible.sum &amp;gt; 0 then do;
MPRINT(CALC_TOP_TAUX_TOT):   top_tx_min_cible_pos = ((pos_cible.sum / pers_cible.sum) + (1.96 * sqrt((pos_cible.sum / 
pers_cible.sum) * (1 - (pos_cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
MPRINT(CALC_TOP_TAUX_TOT):   end;
MPRINT(CALC_TOP_TAUX_TOT):   else top_tx_min_cible_pos = .;
MPRINT(CALC_TOP_TAUX_TOT):   endcomp;
220        
221        endcomp;
222        run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE REPORT a utilisé (Durée totale du traitement) :
      real time           0.00 seconds
      cpu time            0.00 seconds
      
223        ods excel close;
NOTE: Writing EXCEL file: ./S:\qs\02. fatyr\kjh\clars.xlsx' 
224        
225        
226        
227        
228        
229        
230        
231        
232        
233        
234        
235        
236        
237        
238        
239        
240        
241        
242        
243        
244        
245        
246        
8                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

247        
248        
249        
250        
251        
252        
253        
254        
255        
256        
257        
258        
259        
260        
261        
262        
263        
264        
265        
266        
267        
268        
269        
270        
271        
272        
273        
274        
275        
276        
277        
278        
279        
280        
281        
282        
283        
284        
285        
286        
287        
288        
289        
290        
291        
292        
293        
294        
295        
296        
297        
298        
299        
300        
301        
302        
303        
304        
9                                                          Le Système SAS                          07:51 Wednesday, December 6, 2023

305        
306        
307        
308        
309        
310        
311        
312        
313        
314        
315        
316        
317        
318        
319        
320        
321        
322        
323        
324        
325        
326        
327        
328        
329        
330        
331        
332        
333        
334        
335        
336        
337        
338        
339        
340        
341        
342        
343        
344        
345        
346        
347        
348        
349        
350        
351        
352        
353        
354        
355        
356        
357        
358        
359        
360        
361        
362        
10                                                         Le Système SAS                          07:51 Wednesday, December 6, 2023

363        
364        
365        
366        
367        
368        
369        
370        
371        
372        
373        
374        
375        
376        
377        
378        
379        
380        
381        
382        
383        
384        
385        
386        
387        
388        
389        
390        
391        
392        
393        
394        
395        
396        
397        
398        
399        
400        
401        
402        
403        
404        
405        
406        
407        
408        
409        
410        
411        
412        
413        
414        
415        
416        
417        
418        
419        
420        
11                                                         Le Système SAS                          07:51 Wednesday, December 6, 2023

421        
422        
423        
424        
425        
426        
427        
428        GOPTIONS NOACCESSIBLE;
429        %LET _CLIENTTASKLABEL=;
430        %LET _CLIENTPROCESSFLOWNAME=;
431        %LET _CLIENTPROJECTPATH=;
432        %LET _CLIENTPROJECTPATHHOST=;
433        %LET _CLIENTPROJECTNAME=;
434        %LET _SASPROGRAMFILE=;
435        %LET _SASPROGRAMFILEHOST=;
436        
437        ;*';*";*/;quit;run;
438        ODS _ALL_ CLOSE;
NOTE: Writing EXCEL(EGXLSSX) file: /saswork_lev1/sasworkTP/SAS_workEF97000549CE_lx20015.posix.covea.priv/#LN00515
439        
440        
441        QUIT; RUN;
442        

&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/********* code without macro : ok *************************/
options mprint;

PROC FORMAT ; PICTURE milliers (ROUND) 
                       99999999='-' 
                      low - &amp;lt;0 = "000 000 009" (prefix='-') 
					   0 - &amp;lt;99999999= "000 000 009"                      ;
RUN ;
ods listing close ;
ods excel file='S:\qs\02. fatyr\kjh\clars.xlsx' style=pearl;


proc report data=TAB split='*' ;
column  
 ("~"  UNIVERS  )  
("_blanc1_" pers_cible) ("_blanc2_" pers_temoin)


/* CONTACT ENTRANT */
("ENTRANT"  
entrant_cible
entrant_temoin
 
tx_min_cible_entrant 
tx_max_cible_entrant 
tx_min_temoin_entrant 
tx_max_temoin_entrant 
top_tx_min_cible_entrant 
top_tx_max_cible_entrant 
top_tx_min_temoin_entrant 
top_tx_max_temoin_entrant)

		  
("NEG"  
Neg_cible
Neg_temoin 

tx_min_cible_Neg 
tx_max_cible_Neg 
tx_min_temoin_Neg 
tx_max_temoin_Neg 
TOP_tx_max_temoin_Neg 
TOP_tx_min_temoin_Neg     
TOP_tx_max_cible_Neg     
TOP_tx_min_cible_Neg 
)
 
/* CLIENTS avec HAUSSE de CA */
("POS"  
pos_cible
pos_temoin 

tx_min_cible_pos 
tx_max_cible_pos
tx_min_temoin_pos 
tx_max_temoin_pos 
TOP_tx_max_temoin_pos 
TOP_tx_min_temoin_pos   
TOP_tx_max_cible_pos   
TOP_tx_min_cible_pos 
)
;

define  UNIVERS                             / group order=data             style(header)={ width=1IN  FOREGROUND=BLACK};define  univers /style(column)={width=1IN /*cellwidth=2.5cm*/ fontsize=6pt just=LEFT};

define  pers_cible                       / analysis                     FORMAT=commax12.0    style(header)={ cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};       define  pers_cible /style(column)={ just=center};
define  pers_temoin                      / analysis                   FORMAT=commax12.0    style(header)={cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};        define  pers_temoin /style(column)={ just=center};

/* CONTACT ENTRANT */
define  entrant_cible               / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK background=#DDD9C4};           define  entrant_cible /style(column)={just=center};
define  entrant_temoin              / analysis noprint ;
define  tx_min_cible_entrant        / analysis                         format=5.4           style(header)={cellwidth=2.5cm};
define  tx_max_cible_entrant        / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_entrant       / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_entrant       / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;

define  top_tx_min_cible_entrant    / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_max_cible_entrant    / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_min_temoin_entrant   / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_max_temoin_entrant   / computed                         format=5.4           style(header)={cellwidth=2.5cm};;


/* CLIENTS avec PERTE de CA */
define  Neg_cible                  / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK background=#C5D9F1};define  Neg_cible / style(column)={just=center};
define  Neg_temoin                 / analysis noprint;
define  tx_min_cible_Neg           / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_max_cible_Neg           / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_Neg          / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_Neg          / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;

define  TOP_tx_max_temoin_Neg      / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_min_temoin_Neg      / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_max_cible_Neg       / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_min_cible_Neg       / computed                        format=5.4            style(header)={cellwidth=2.5cm};

/* CLIENTS avec HAUSSE de CA */
define  pos_cible                  / analysis                     FORMAT=commax12.0  style(header)={ FOREGROUND=BLACK background=#8DB4E2};define  pos_cible / style(column)={just=center};
define  pos_temoin                 / analysis noprint;
define  tx_min_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_max_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;

define  TOP_tx_max_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_min_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_max_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_min_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};


                                                     
compute top_tx_min_cible_entrant;
top_tx_min_cible_entrant=tx_min_cible_entrant.SUM;
endcomp;
compute top_tx_max_cible_entrant;
top_tx_max_cible_entrant =tx_max_cible_entrant.SUM;
endcomp;
compute top_tx_min_temoin_entrant;
top_tx_min_temoin_entrant =tx_min_temoin_entrant.SUM;
endcomp;
compute top_tx_max_temoin_entrant;
top_tx_max_temoin_entrant=tx_max_temoin_entrant.SUM;
endcomp;


/*******************/
compute top_tx_min_cible_Neg;
top_tx_min_cible_Neg=tx_min_cible_Neg.SUM;
endcomp;
compute top_tx_max_cible_Neg;
top_tx_max_cible_Neg =tx_max_cible_Neg.SUM;
endcomp;
compute top_tx_min_temoin_Neg;
top_tx_min_temoin_Neg =tx_min_temoin_Neg.SUM;
endcomp;
compute top_tx_max_temoin_Neg;
top_tx_max_temoin_Neg=tx_max_temoin_Neg.SUM;
endcomp;

/*******************/
compute top_tx_min_cible_pos;
top_tx_min_cible_pos=tx_min_cible_pos.SUM;
endcomp;
compute top_tx_max_cible_pos;
top_tx_max_cible_pos =tx_max_cible_pos.SUM;
endcomp;
compute top_tx_min_temoin_pos;
top_tx_min_temoin_pos =tx_min_temoin_pos.SUM;
endcomp;
compute top_tx_max_temoin_pos;
top_tx_max_temoin_pos=tx_max_temoin_pos.SUM;
endcomp; 

break after univers / summarize ; 

compute after univers;            
length univers $80;
univers=catx('','TOTAL',univers); 


/* entrant ********************************************************/
/* taux maxi pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_max_temoin_entrant = ((entrant_temoin.sum/pers_temoin.sum) + (1.96 * sqrt(((entrant_temoin.sum/pers_temoin.sum) * (1 - (entrant_temoin.sum/pers_temoin.sum))   ) / pers_temoin.sum)))*100;
    end;
    else top_tx_max_temoin_entrant = .; 
/*taux mini pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_min_temoin_entrant = ((entrant_temoin.sum/pers_temoin.sum) - (1.96 * sqrt(((entrant_temoin.sum/pers_temoin.sum) * (1 - (entrant_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
    end;
    else top_tx_min_temoin_entrant = .; 

/*taux maxi pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_max_cible_entrant= ((entrant_cible.sum/pers_cible.sum) + (1.96 * sqrt(((entrant_cible.sum/pers_cible.sum) * (1 - (entrant_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_max_cible_entrant = .; 
/*taux mini pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_min_cible_entrant= ((entrant_cible.sum/pers_cible.sum) - (1.96 * sqrt(((entrant_cible.sum/pers_cible.sum) * (1 - (entrant_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_min_cible_entrant= .;

/* Neg ********************************************************/	
/* taux maxi pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_max_temoin_Neg= ((Neg_temoin.sum/pers_temoin.sum) + (1.96 * sqrt(((Neg_temoin.sum/pers_temoin.sum) * (1 - (Neg_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
    end;
    else top_tx_max_temoin_Neg= .; 
/*taux mini pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_min_temoin_Neg= ((Neg_temoin.sum/pers_temoin.sum) - (1.96 * sqrt(((Neg_temoin.sum/pers_temoin.sum) * (1 - (Neg_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
    end;
    else top_tx_min_temoin_Neg= .; 

/*taux maxi pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_max_cible_Neg= ((Neg_cible.sum/pers_cible.sum) + (1.96 * sqrt(((Neg_cible.sum/pers_cible.sum) * (1 - (Neg_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_max_cible_Neg= .; 
/*taux mini pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_min_cible_Neg= ((Neg_cible.sum/pers_cible.sum) - (1.96 * sqrt(((Neg_cible.sum/pers_cible.sum) * (1 - (Neg_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_min_cible_Neg= .; 

/*   pos   ********************************************************/
	/* taux maxi pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_max_temoin_pos= ((pos_temoin.sum/pers_temoin.sum) + (1.96 * sqrt(((pos_temoin.sum/pers_temoin.sum) * (1 - (pos_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
    end;
    else top_tx_max_temoin_pos= .; 
/*taux mini pour temoin */
  if pers_temoin.sum &amp;gt; 0 then do;
        top_tx_min_temoin_pos= ((pos_temoin.sum/pers_temoin.sum) - (1.96 * sqrt(((pos_temoin.sum/pers_temoin.sum) * (1 - (pos_temoin.sum/pers_temoin.sum))) / pers_temoin.sum)))*100;
    end;
    else top_tx_min_temoin_pos= .; 

/*taux maxi pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_max_cible_pos= ((pos_cible.sum/pers_cible.sum) + (1.96 * sqrt(((pos_cible.sum/pers_cible.sum) * (1 - (pos_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_max_cible_pos= .; 
/*taux mini pour cible */
  if pers_cible.sum &amp;gt; 0 then do;
        top_tx_min_cible_pos= ((pos_cible.sum/pers_cible.sum) - (1.96 * sqrt(((pos_cible.sum/pers_cible.sum) * (1 - (pos_cible.sum/pers_cible.sum))) / pers_cible.sum)))*100;
    end;
    else top_tx_min_cible_pos= .; 



endcomp;
run;
ods excel close;










































































































































































































&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/********* code with macro : KO  *************************/

options mprint;

PROC FORMAT ; PICTURE milliers (ROUND) 
                       99999999='-' 
                      low - &amp;lt;0 = "000 000 009" (prefix='-') 
					   0 - &amp;lt;99999999= "000 000 009"                      ;
RUN ;
ods listing close ;
ods excel file='S:\qs\02. fatyr\kjh\clars.xlsx' style=pearl;

%macro calc_top_sum(var);
    /* Calcul de la somme du taux minimum pour le groupe cible */
    compute top_tx_min_cible_&amp;amp;var;
        top_tx_min_cible_&amp;amp;var = tx_min_cible_&amp;amp;var..sum;
    endcomp;

    /* Calcul de la somme du taux maximum pour le groupe cible */
    compute top_tx_max_cible_&amp;amp;var;
        top_tx_max_cible_&amp;amp;var = tx_max_cible_&amp;amp;var..sum;
    endcomp;

    /* Calcul de la somme du taux minimum pour le groupe témoin */
    compute top_tx_min_temoin_&amp;amp;var;
        top_tx_min_temoin_&amp;amp;var = tx_min_temoin_&amp;amp;var..sum;
    endcomp;

    /* Calcul de la somme du taux maximum pour le groupe témoin */
    compute top_tx_max_temoin_&amp;amp;var;
        top_tx_max_temoin_&amp;amp;var = tx_max_temoin_&amp;amp;var..sum;
    endcomp;
%mend calc_top_sum;

/********************************************/
%macro calc_top_taux_tot(var);
    /* Calcul du taux maximum et minimum pour temoin et cible pour &amp;amp;var */
    compute top_tx_max_temoin_&amp;amp;var;
        /* Calculer le taux maximum pour le groupe témoin si le nombre de personnes est supérieur à 0 */
        if pers_temoin.sum &amp;gt; 0 then do;   
            top_tx_max_temoin_&amp;amp;var = ((&amp;amp;var._temoin.sum / pers_temoin.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._temoin.sum / pers_temoin.sum) * 
                                      (1 - (&amp;amp;var._temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
        end;
        else top_tx_max_temoin_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
    endcomp;
       /* Calculer le taux minimum pour le groupe témoin si le nombre de personnes est supérieur à 0 */
    compute top_tx_min_temoin_&amp;amp;var;
        if pers_temoin.sum &amp;gt; 0 then do;
            top_tx_min_temoin_&amp;amp;var = ((&amp;amp;var._temoin.sum / pers_temoin.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._temoin.sum / pers_temoin.sum) * 
                                      (1 - (&amp;amp;var._temoin.sum / pers_temoin.sum))) / pers_temoin.sum)) * 100;
        end;
        else top_tx_min_temoin_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
    endcomp;
        /* Calculer le taux maximum pour le groupe cible si le nombre de personnes est supérieur à 0 */
    compute top_tx_max_cible_&amp;amp;var;
        if pers_cible.sum &amp;gt; 0 then do;
            top_tx_max_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / pers_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / pers_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
        end;
        else top_tx_max_cible_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
    endcomp;

/* Calculer le taux minimum pour le groupe cible si le nombre de personnes est supérieur à 0 */
    compute top_tx_min_cible_&amp;amp;var;
        if pers_cible.sum &amp;gt; 0 then do;
            top_tx_min_cible_&amp;amp;var = ((&amp;amp;var._cible.sum / pers_cible.sum) + 
                                      (1.96 * sqrt((&amp;amp;var._cible.sum / pers_cible.sum) * 
                                      (1 - (&amp;amp;var._cible.sum / pers_cible.sum))) / pers_cible.sum)) * 100;
        end;
        else top_tx_min_cible_&amp;amp;var = .; /* Valeur manquante si pas assez de personnes */
    endcomp;
%mend calc_top_taux_tot;



proc report data=TAB split='*' ;
column  
 ("~"  UNIVERS  )  
("_blanc1_" pers_cible) ("_blanc2_" pers_temoin)


/* CONTACT ENTRANT */
("ENTRANT"  
entrant_cible
entrant_temoin
 
tx_min_cible_entrant 
tx_max_cible_entrant 
tx_min_temoin_entrant 
tx_max_temoin_entrant 
top_tx_min_cible_entrant 
top_tx_max_cible_entrant 
top_tx_min_temoin_entrant 
top_tx_max_temoin_entrant)

		  
("NEG"  
Neg_cible
Neg_temoin 

tx_min_cible_Neg 
tx_max_cible_Neg 
tx_min_temoin_Neg 
tx_max_temoin_Neg 
TOP_tx_max_temoin_Neg 
TOP_tx_min_temoin_Neg     
TOP_tx_max_cible_Neg     
TOP_tx_min_cible_Neg 
)
 
/* CLIENTS avec HAUSSE de CA */
("POS"  
pos_cible
pos_temoin 

tx_min_cible_pos 
tx_max_cible_pos
tx_min_temoin_pos 
tx_max_temoin_pos 
TOP_tx_max_temoin_pos 
TOP_tx_min_temoin_pos   
TOP_tx_max_cible_pos   
TOP_tx_min_cible_pos 
)
;

define  UNIVERS                             / group order=data             style(header)={ width=1IN  FOREGROUND=BLACK};define  univers /style(column)={width=1IN /*cellwidth=2.5cm*/ fontsize=6pt just=LEFT};

define  pers_cible                       / analysis                     FORMAT=commax12.0    style(header)={ cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};       define  pers_cible /style(column)={ just=center};
define  pers_temoin                      / analysis                   FORMAT=commax12.0    style(header)={cellwidth=1.3cm  FOREGROUND=BLACK background=#DCE6F1};        define  pers_temoin /style(column)={ just=center};

/* CONTACT ENTRANT */
define  entrant_cible               / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK background=#DDD9C4};           define  entrant_cible /style(column)={just=center};
define  entrant_temoin              / analysis noprint ;
define  tx_min_cible_entrant        / analysis                         format=5.4           style(header)={cellwidth=2.5cm};
define  tx_max_cible_entrant        / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_entrant       / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_entrant       / analysis                         format=5.4           style(header)={cellwidth=2.5cm};;

define  top_tx_min_cible_entrant    / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_max_cible_entrant    / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_min_temoin_entrant   / computed                         format=5.4           style(header)={cellwidth=2.5cm};;
define  top_tx_max_temoin_entrant   / computed                         format=5.4           style(header)={cellwidth=2.5cm};;


/* CLIENTS avec PERTE de CA */
define  Neg_cible                  / analysis                      FORMAT=commax12.0    style(header)={ FOREGROUND=BLACK background=#C5D9F1};define  Neg_cible / style(column)={just=center};
define  Neg_temoin                 / analysis noprint;
define  tx_min_cible_Neg           / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_max_cible_Neg           / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_Neg          / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_Neg          / analysis                        format=5.4            style(header)={cellwidth=2.5cm};;

define  TOP_tx_max_temoin_Neg      / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_min_temoin_Neg      / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_max_cible_Neg       / computed                        format=5.4            style(header)={cellwidth=2.5cm};
define  TOP_tx_min_cible_Neg       / computed                        format=5.4            style(header)={cellwidth=2.5cm};

/* CLIENTS avec HAUSSE de CA */
define  pos_cible                  / analysis                     FORMAT=commax12.0  style(header)={ FOREGROUND=BLACK background=#8DB4E2};define  pos_cible / style(column)={just=center};
define  pos_temoin                 / analysis noprint;
define  tx_min_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_max_cible_pos           / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_min_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;
define  tx_max_temoin_pos          / analysis  format=5.4  style(header)={cellwidth=2.5cm};;

define  TOP_tx_max_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_min_temoin_pos      / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_max_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};
define  TOP_tx_min_cible_pos       / computed  format=5.4 style(header)={cellwidth=2.5cm};


%calc_top_sum(entrant); 
%calc_top_sum(Neg);
%calc_top_sum(pos); 



break after univers / summarize ; 

compute after univers;            
length univers $80;
univers=catx('','TOTAL',univers); 

%calc_top_taux_tot(entrant); 
%calc_top_taux_tot(Neg);
%calc_top_taux_tot(pos); 

endcomp;
run;
ods excel close;










































































































































































































&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 09:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906408#M357907</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-06T09:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906414#M357910</link>
      <description>&lt;P&gt;The ERROR statement in the log indicates what the problem is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;ERROR: There are multiple COMPUTE statements for  top_tx_min_temoin_entrant.&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you fix the macro(s) so this doesn't happen? This issue of multiple COMPUTE statements for the stated variable does not happen when the non-macro version of the code is run.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 11:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906414#M357910</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-06T11:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906417#M357911</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt; knew it came from him. but what is the solution to avoid this problem? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;I don't know what I should fix and how&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 11:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906417#M357911</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-06T11:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906419#M357912</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;knew it came from him.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then why not tell us in your original post?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;has already explained this&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 11:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906419#M357912</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-06T11:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906422#M357913</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; he explained but he didn't say how to get around this problem, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;and I tell you that I don't know how to do it.. combine the two macros into one? modify the compute..?&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="Y2IQFc"&gt;if yes, how can I meet my needs and not fall into the multiple compute error?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 12:06:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906422#M357913</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-06T12:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906425#M357914</link>
      <description>&lt;P&gt;I would try combining the two macros. You don't need a macro that creates one part of a compute block and a different macro to create another part of the compute block.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 12:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906425#M357914</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-12-06T12:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906452#M357928</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;how ? you have a syntax example. I admit that I am not an expert in macro&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 14:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906452#M357928</guid>
      <dc:creator>snip</dc:creator>
      <dc:date>2023-12-06T14:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: macro in proc report error multiple compute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906544#M357947</link>
      <description>&lt;P&gt;So the problem is the SECOND macro is generate COMPUTE and ENDCOMP statement when you don't want those statements.&lt;/P&gt;
&lt;P&gt;Look at your non-macro code. The second block of repeated code is all inside of a COMPUTE block already.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 17:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-in-proc-report-error-multiple-compute/m-p/906544#M357947</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-06T17:19:48Z</dc:date>
    </item>
  </channel>
</rss>

