<?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: PROC Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742927#M232493</link>
    <description>&lt;P&gt;Let's progress one step further:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }
style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}
style(column)={fontfamily=coolvetica fontsize=2};
column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols. ;
define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;
define CLR1-CLR&amp;amp;mcolcnt. /display noprint;
%macro j(num);
compute NAME&amp;amp;num.;
if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr1.}');
if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr2.}');
if CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}');
if CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}');
endcomp;
%mend;
%j(14)
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Copy/paste the code to your environment and run it.&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 15:34:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-05-21T15:34:23Z</dc:date>
    <item>
      <title>PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742743#M232397</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to create a COMPUTE statement with a variable value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For eg :&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value for jump can range from 1 to 50 depending on the dataset being handled.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am hoping maybe I can create a macro as below. It throws an error however as it doesnt&amp;nbsp; like the if statment etc&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to be able to do is call this macro within a proc report based on what value I need to assign for jump.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If its not a macro is there another way to do it please. All I really want is to have the compute statement created by replacing the value for jump within the compute statment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro Name(jump);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;COMPUTE NAME&amp;amp;jump.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if CR&amp;amp;jump.=1 AND CL&amp;amp;jump.=1 then call define ("COL&amp;amp;jump.",'style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;if CR&amp;amp;jump.=2 AND CL&amp;amp;jump.=1 then call define ("COL&amp;amp;jump.",'style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;if CR&amp;amp;jump.=3 AND CLR&amp;amp;jump.=1 then call define ("COL&amp;amp;jump.",'style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;if CR&amp;amp;jump.=4 AND CLR&amp;amp;jump.=1 then call define ("COL&amp;amp;jump.",'style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742743#M232397</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-20T18:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742747#M232401</link>
      <description>&lt;P&gt;Please run the following command&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;at the start of your program, run the program again and show us the LOG. We need to see the ENTIRE log for PROC REPORT, that's 100%, every single character of the LOG for PROC REPORT — do not pick and choose parts of the log for PROC REPORT to show us. Please preserve the formatting in the log by copying the log as text and then pasting it into the window that appears when you click on the &amp;lt;/&amp;gt; icon —&amp;nbsp;&lt;STRONG&gt;DO NOT SKIP THIS STEP&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742747#M232401</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-20T18:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742749#M232403</link>
      <description>&lt;P&gt;Run the code without the macro definition, and set jump with a %LET.&lt;/P&gt;
&lt;P&gt;Then, post the log by copy/pasting it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You also seem to use macro variables clr1 to clr4 within single quotes.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742749#M232403</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-20T18:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742752#M232405</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;I always recommend getting things working without macro because it is easier to debug. You don't show ALL your code and you don't show your ERROR messages in the log. One reason it may not like your IF statement is that you may be referencing the variable incorrectly. Remember that for ANALYSIS items, you need to use a compound name: variable.statistic, as shown below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1621535329355.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59626iF19EE54DA711FD21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1621535329355.png" alt="Cynthia_sas_0-1621535329355.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;But that is just a guess...you don't get any error messages with incorrect usage, just a note in the log for the variable that was referenced incorrectly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Otherwise, without seeing ALL your code and your ODS statements and your LOG messages, it is hard to comment. Also, without providing any data, then people cannot run your code without making some fake data, which may or may not be structured correctly.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 18:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742752#M232405</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-05-20T18:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742764#M232410</link>
      <description>Apologies if my query wasnt that clear. I have now included my proc report sample that works. hope this helps.&lt;BR /&gt;&lt;BR /&gt;ods excel file="&amp;amp;xl_path./TEST.xlsx" options(&lt;BR /&gt;autofilter="yes" zoom='80' embedded_titles='yes' embedded_footnotes='yes'&lt;BR /&gt;sheet_name="TEST"&lt;BR /&gt;);&lt;BR /&gt;options validvarname=UPCASE label=0;&lt;BR /&gt;&lt;BR /&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }&lt;BR /&gt;style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}&lt;BR /&gt;style(column)={fontfamily=coolvetica fontsize=2};&lt;BR /&gt;column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols. ;&lt;BR /&gt;define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;define CLR1-CLR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;&lt;BR /&gt;%j_sel;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*The macro j_sel */&lt;BR /&gt;&lt;BR /&gt;%macro j_sel;&lt;BR /&gt;&lt;BR /&gt;%if &amp;amp;mcolcnt. eq 3 %then %do;&lt;BR /&gt;&lt;BR /&gt;%name1; %name2;&lt;BR /&gt;%end;&lt;BR /&gt;&lt;BR /&gt;%else %if &amp;amp;mcolcnt. eq 4 %then %do;&lt;BR /&gt;%name1; %name2; %name3;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Based on the value of variable mcolcnt, I want to have as many COMPUTE Statements created.&lt;BR /&gt;&lt;BR /&gt;At the moment I have macro name1, name2 and name3 written as below and this works perfectly fine. My proc report creates the report that I want&lt;BR /&gt;&lt;BR /&gt;But the issue is say I have say 10 or 40 NAME columns from NAME1 through to NAME 40, then I dont want to be writing as many COMPUTE Statements.&lt;BR /&gt;&lt;BR /&gt;So I was hoping if I can some sort of a %macro name(jump); If i just call that and pass the number 1 through to 4 then I dont have to write as many name macros.&lt;BR /&gt;&lt;BR /&gt;%macro NAME1;&lt;BR /&gt;COMPUTE NAME1;&lt;BR /&gt;&lt;BR /&gt;if CLR1=1 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=2 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=3 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=4 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;endcomp;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%macro NAME2;&lt;BR /&gt;COMPUTE NAME2;&lt;BR /&gt;&lt;BR /&gt;if CLR2=1 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=2 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=3 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=4 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;endcomp;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 May 2021 19:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742764#M232410</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-20T19:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742775#M232413</link>
      <description>I have now added some more info on my ods and proc report below.</description>
      <pubDate>Thu, 20 May 2021 19:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742775#M232413</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-20T19:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742777#M232415</link>
      <description>&lt;P&gt;Where is an example of the code that worked properly without any macros?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 19:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742777#M232415</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-20T19:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742789#M232423</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382230"&gt;@Anuz&lt;/a&gt; we specifically asked to see the LOG and we specifically gave instructions how to provide the LOG to us.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 21:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742789#M232423</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-20T21:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742850#M232456</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Below is what I would run without the macros. In this particular instance I have only two name columns - NAME1 and NAME2. So its fine. But I wouldn't know how many NAME columns could be there before hand. So want a way where the COMPUTE statements can be populated based on the number of NAME columns that appear in the final dataset that I need to run a report for.&lt;BR /&gt;&lt;BR /&gt;ods excel file="&amp;amp;xl_path./TEST.xlsx" options(&lt;BR /&gt;autofilter="yes" zoom='80' embedded_titles='yes' embedded_footnotes='yes'&lt;BR /&gt;sheet_name="TEST"&lt;BR /&gt;);&lt;BR /&gt;options validvarname=UPCASE label=0;&lt;BR /&gt;&lt;BR /&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }&lt;BR /&gt;style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}&lt;BR /&gt;style(column)={fontfamily=coolvetica fontsize=2};&lt;BR /&gt;column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols.;&lt;BR /&gt;define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;define CLR1-CLR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;&lt;BR /&gt;COMPUTE NAME1;&lt;BR /&gt;&lt;BR /&gt;if CLR1=1 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=2 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=3 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;if CLR1=4 AND CLFR1=1 then&lt;BR /&gt;call define ('NAME1','style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;endcomp;&lt;BR /&gt;&lt;BR /&gt;COMPUTE NAME2;&lt;BR /&gt;&lt;BR /&gt;if CLR2=1 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=2 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=3 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;if CLR2=4 AND CLFR2=1 then&lt;BR /&gt;call define ('NAME2','style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;endcomp;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 21 May 2021 09:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742850#M232456</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-21T09:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742857#M232458</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; - Sorry I don't know where the &amp;lt;/&amp;gt; icon is. I am new to this forum and SAS. So maybe I am missing something basic here. But I have pasted the full log below&lt;BR /&gt;&lt;BR /&gt;I want to be able to call this macro in the below proc report so it creates the COMPUTE STATEMENT based on the number I pass to the macro.&lt;BR /&gt;&lt;BR /&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }&lt;BR /&gt;style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}&lt;BR /&gt;style(column)={fontfamily=coolvetica fontsize=2};&lt;BR /&gt;column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols. ;&lt;BR /&gt;define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;define CLR1-CLR&amp;amp;mcolcnt. /display noprint;&lt;BR /&gt;&lt;BR /&gt;%j(14);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;==========MACRO===================================&lt;BR /&gt;The macro is as below&lt;BR /&gt;%macro j(num);&lt;BR /&gt;compute NAME&amp;amp;num.;&lt;BR /&gt;&lt;BR /&gt;if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then&lt;BR /&gt;call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then&lt;BR /&gt;call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;if CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then&lt;BR /&gt;call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;if CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then&lt;BR /&gt;call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;endcomp;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%j(14);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;===================LOG=========================================&lt;BR /&gt;&lt;BR /&gt;1 The SAS System&lt;BR /&gt;&lt;BR /&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (7)';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=ACTIVEX;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 FILENAME EGSR TEMP;&lt;BR /&gt;15 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;16 STYLE=HTMLBlue&lt;BR /&gt;17 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")&lt;BR /&gt;18 NOGTITLE&lt;BR /&gt;19 NOGFOOTNOTE&lt;BR /&gt;20 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;21 ENCODING=UTF8&lt;BR /&gt;22 options(rolap="on")&lt;BR /&gt;23 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 options mprint;&lt;BR /&gt;27&lt;BR /&gt;28 %macro j(num);&lt;BR /&gt;29&lt;BR /&gt;30 compute NAME&amp;amp;num.;&lt;BR /&gt;31 if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;32 if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;33 if CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;34 if CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;35&lt;BR /&gt;36 endcomp;&lt;BR /&gt;37&lt;BR /&gt;38 %mend;&lt;BR /&gt;39&lt;BR /&gt;40&lt;BR /&gt;41 %j(14);&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 compute NAME&amp;amp;num.; if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;_______&lt;BR /&gt;180&lt;BR /&gt;41 ! background=&amp;amp;clr1.}'); if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;41 ! background=&amp;amp;clr2.}'); if&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): compute NAME14;&lt;BR /&gt;&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 compute NAME&amp;amp;num.; if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;__&lt;BR /&gt;180&lt;BR /&gt;41 ! background=&amp;amp;clr1.}'); if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;41 ! background=&amp;amp;clr2.}'); if&lt;BR /&gt;2&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): if CLFR14=1 AND CLR14=1 then call define ("NAME14",'style','style={font_weight=bold background=&amp;amp;clr1.}');&lt;BR /&gt;&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 compute NAME&amp;amp;num.; if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;41 ! background=&amp;amp;clr1.}'); if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;__&lt;BR /&gt;180&lt;BR /&gt;41 ! background=&amp;amp;clr2.}'); if&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): if CLFR14=2 AND CLR14=1 then call define ("NAME14",'style','style={font_weight=bold background=&amp;amp;clr2.}');&lt;BR /&gt;&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 compute NAME&amp;amp;num.; if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;41 ! background=&amp;amp;clr1.}'); if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold&lt;BR /&gt;41 ! background=&amp;amp;clr2.}'); if&lt;BR /&gt;__&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): if CLFR14=3 AND CLR14=1 then call define ("NAME14",'style','style={font_weight=bold background=&amp;amp;clr3.}');&lt;BR /&gt;&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}'); if&lt;BR /&gt;__&lt;BR /&gt;180&lt;BR /&gt;41 ! CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}'); endcomp;&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): if CLFR14=4 AND CLR14=1 then call define ("NAME14",'style','style={font_weight=bold background=&amp;amp;clr4.}');&lt;BR /&gt;&lt;BR /&gt;NOTE: Line generated by the invoked macro "J".&lt;BR /&gt;41 CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}'); if&lt;BR /&gt;41 ! CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}'); endcomp;&lt;BR /&gt;_______&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;MPRINT(J): endcomp;&lt;BR /&gt;42&lt;BR /&gt;43 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;44 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;45 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;46 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;47 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;48 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;49 %LET _SASPROGRAMFILE=;&lt;BR /&gt;50 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;51&lt;BR /&gt;52 ;*';*";*/;quit;run;&lt;BR /&gt;53 ODS _ALL_ CLOSE;&lt;BR /&gt;54&lt;BR /&gt;55&lt;BR /&gt;56 QUIT; RUN;&lt;BR /&gt;57&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 May 2021 09:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742857#M232458</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-21T09:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742863#M232462</link>
      <description>&lt;P&gt;Please read &lt;A href="https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742749/highlight/true#M232403" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; again and &lt;STRONG&gt;use the indicated button for posting the log!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The post includes a picture that shows the button.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;And use the "little running man" right next to it for code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }
style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}
style(column)={fontfamily=coolvetica fontsize=2};
column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols. ;
define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;
define CLR1-CLR&amp;amp;mcolcnt. /display noprint;
%let num=14;
compute NAME&amp;amp;num.;

if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr1.}');

if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr2.}');

if CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}');

if CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}');
endcomp;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and post the log&amp;nbsp;&lt;STRONG&gt;as requested&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS the buttons may not be there if you hit "quick reply" or answer directly from a mail. Open communities.sas.com in a browser (Chrome always works for me) to post here.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 10:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742863#M232462</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-21T10:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742904#M232481</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; - Thank you very much. The code you gave worked just fine. Also thank you pointing out that the Quick Reply wouldn't give me the right options to post my log. I was using the Quick reply.&lt;BR /&gt;&lt;BR /&gt;So what you gave works and gives me the desired output. My issue here is I wouldn't know how many COMPUTE statements I would need to include. Depending on the number of NAME columns I will need to write as many COMPUTE statements. So if my final dataset has 5 NAME columns, I need COMPUTE statements for NAME1 through to NAME5. How can I get the code to create them automatically. Can I write a DO or FOR LOOP within the proc report to enable that or some sort of macro. Thank you.&lt;BR /&gt;</description>
      <pubDate>Fri, 21 May 2021 14:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742904#M232481</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-21T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742927#M232493</link>
      <description>&lt;P&gt;Let's progress one step further:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=TEST_RPT style(column)={tagattr='wraptext:no' }
style(header)={just=l fontfamily=arial fontweight=bold foreground=black background=tan fontsize=2.5}
style(column)={fontfamily=coolvetica fontsize=2};
column CLR1-CLR&amp;amp;mcolcnt. CLFR1-CLFR&amp;amp;mcolcnt. &amp;amp;mcols. ;
define CLFR1-CLFR&amp;amp;mcolcnt. /display noprint;
define CLR1-CLR&amp;amp;mcolcnt. /display noprint;
%macro j(num);
compute NAME&amp;amp;num.;
if CLFR&amp;amp;num.=1 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr1.}');
if CLFR&amp;amp;num.=2 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr2.}');
if CLFR&amp;amp;num.=3 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr3.}');
if CLFR&amp;amp;num.=4 AND CLR&amp;amp;num.=1 then
call define ("NAME&amp;amp;num.",'style','style={font_weight=bold background=&amp;amp;clr4.}');
endcomp;
%mend;
%j(14)
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Copy/paste the code to your environment and run it.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 15:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742927#M232493</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-05-21T15:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742969#M232513</link>
      <description>that worked as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I was then able to include a do loop to have the multiple COMPUTE statements done.&lt;BR /&gt;&lt;BR /&gt;Thanks a ton for your help &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;... Appreciate it.</description>
      <pubDate>Fri, 21 May 2021 17:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-Report/m-p/742969#M232513</guid>
      <dc:creator>Anuz</dc:creator>
      <dc:date>2021-05-21T17:01:38Z</dc:date>
    </item>
  </channel>
</rss>

