<?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 How to color the column label in proc report in SAS 9.4? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827698#M25893</link>
    <description>&lt;P&gt;Hi experts,&lt;/P&gt;
&lt;P&gt;I have following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out= info
            datafile= "H:\Miscellaneous\test1.xls"
            dbms = xls replace;
            getnames= yes;
run;
ods noresults;
ods listing close;
ods excel file = "H:\Miscellaneous\Test.xlsx"
      options(
			sheet_name= "INFORMATION"
			autofilter= "ALL"
			       );
proc report data= info nowd split= '#';
     column  name stdid subject stream category enrolled_year 
     citizen_or_non_citizen Comments_Mandatory_Existing_Law;             
     define  name /order;
     define  name /'NAME';
	 define  stdid /'STUDENT ID'; 
     define  subject / 'SUBJECT';
     define  stream/'STREAM';
     define  category/ 'CATEGORY';
     define  enrolled_year/ 'ENROLLED#YEAR';
     define  citizen_or_non_citizen /'CITIZEN OR #NON CITIZEN';
     define  Comments_Mandatory_Existing_Law/'COMMENTS#MANDATORY#EXISTING_LAW'; 
    compute stream;
	if  stream ='Science'
   	then call define(_col_, "style", "style=[backgroundcolor=H0F0BFBB]");
    if  stream ='Humanities'
   	then call define(_col_, "style", "style=[backgroundcolor=H0C7809B]"); 
	endcomp;&lt;BR /&gt;&lt;BR /&gt;   compute Comments_Mandatory_Existing_Law;&lt;BR /&gt;   if Comments_Mandatory_Existing_Law='Citizen - Can work'&lt;BR /&gt;   then call define (_col_, "style", "style=[backgroundcolor=H0F0BFBB]");&lt;BR /&gt;   if Comments_Mandatory_Existing_Law='Limited work permit for summer'&lt;BR /&gt;   then call define (_col_, "style", "style=[backgroundcolor=H0B480FF]");&lt;BR /&gt;   endcomp;
run;
 ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I got this report via proc report and ODS.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inquistive_0-1659988606377.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74249i0DC93527E7804880/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inquistive_0-1659988606377.png" alt="inquistive_0-1659988606377.png" /&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;I now want:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Different color for each line in column label as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#00FF00"&gt;&amp;nbsp; COMMENTS&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt; MANDATORY&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FFFF00"&gt;&amp;nbsp;&lt;FONT color="#0000FF"&gt;EXISTING LAW&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;2.C&lt;/FONT&gt;&lt;FONT color="#000000"&gt;olor of the text under 'Citizen or Non Citizen' column as follows:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#00FF00"&gt;Citizen&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT color="#FF00FF"&gt;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#00FFFF"&gt;&lt;FONT color="#FF00FF"&gt;Non-Citizen&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;How can I do this?&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks for your help in advance!&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 20:33:08 GMT</pubDate>
    <dc:creator>inquistive</dc:creator>
    <dc:date>2022-08-08T20:33:08Z</dc:date>
    <item>
      <title>How to color the column label in proc report in SAS 9.4?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827698#M25893</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
&lt;P&gt;I have following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out= info
            datafile= "H:\Miscellaneous\test1.xls"
            dbms = xls replace;
            getnames= yes;
run;
ods noresults;
ods listing close;
ods excel file = "H:\Miscellaneous\Test.xlsx"
      options(
			sheet_name= "INFORMATION"
			autofilter= "ALL"
			       );
proc report data= info nowd split= '#';
     column  name stdid subject stream category enrolled_year 
     citizen_or_non_citizen Comments_Mandatory_Existing_Law;             
     define  name /order;
     define  name /'NAME';
	 define  stdid /'STUDENT ID'; 
     define  subject / 'SUBJECT';
     define  stream/'STREAM';
     define  category/ 'CATEGORY';
     define  enrolled_year/ 'ENROLLED#YEAR';
     define  citizen_or_non_citizen /'CITIZEN OR #NON CITIZEN';
     define  Comments_Mandatory_Existing_Law/'COMMENTS#MANDATORY#EXISTING_LAW'; 
    compute stream;
	if  stream ='Science'
   	then call define(_col_, "style", "style=[backgroundcolor=H0F0BFBB]");
    if  stream ='Humanities'
   	then call define(_col_, "style", "style=[backgroundcolor=H0C7809B]"); 
	endcomp;&lt;BR /&gt;&lt;BR /&gt;   compute Comments_Mandatory_Existing_Law;&lt;BR /&gt;   if Comments_Mandatory_Existing_Law='Citizen - Can work'&lt;BR /&gt;   then call define (_col_, "style", "style=[backgroundcolor=H0F0BFBB]");&lt;BR /&gt;   if Comments_Mandatory_Existing_Law='Limited work permit for summer'&lt;BR /&gt;   then call define (_col_, "style", "style=[backgroundcolor=H0B480FF]");&lt;BR /&gt;   endcomp;
run;
 ods _all_ close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I got this report via proc report and ODS.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inquistive_0-1659988606377.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74249i0DC93527E7804880/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inquistive_0-1659988606377.png" alt="inquistive_0-1659988606377.png" /&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;I now want:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Different color for each line in column label as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#00FF00"&gt;&amp;nbsp; COMMENTS&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FF0000"&gt; MANDATORY&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#FFFF00"&gt;&amp;nbsp;&lt;FONT color="#0000FF"&gt;EXISTING LAW&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;2.C&lt;/FONT&gt;&lt;FONT color="#000000"&gt;olor of the text under 'Citizen or Non Citizen' column as follows:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT color="#00FF00"&gt;Citizen&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;FONT color="#FF00FF"&gt;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#00FFFF"&gt;&lt;FONT color="#FF00FF"&gt;Non-Citizen&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;How can I do this?&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks for your help in advance!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 20:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827698#M25893</guid>
      <dc:creator>inquistive</dc:creator>
      <dc:date>2022-08-08T20:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the column label in proc report in SAS 9.4?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827731#M25894</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It is possible to do what you want to do. The tradeoff is that you need to use ODS ESCAPECHAR for your multi-colored header and so I had to make some fake data using SASHELP.PRDSALE because you didn't post any data to use with your code. I didn't bother mocking up your entire example, but I did use your headers and at least re-created a few of your values so the format would work. I used macro variables for the multi-colored header just because I prefer to have each line of the string as a different macro variable for ease of changing and not messing up brackets.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1660008379109.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74257iEFA5EE43EE2BFFFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1660008379109.png" alt="Cynthia_sas_0-1660008379109.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The colors aren't exactly the ones you showed, but the basic method would be the same no matter what the color is. I really prefer the PROC FORMAT method for making the background and foreground color changes because it is far easier to change a format than to keep adding to the COMPUTE block and using CALL DEFINE.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 01:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827731#M25894</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2022-08-09T01:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the column label in proc report in SAS 9.4?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827860#M25898</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you Cynthia.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It worked well.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 13:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-color-the-column-label-in-proc-report-in-SAS-9-4/m-p/827860#M25898</guid>
      <dc:creator>inquistive</dc:creator>
      <dc:date>2022-08-09T13:47:45Z</dc:date>
    </item>
  </channel>
</rss>

