<?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: Color coding for title part in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957684#M373831</link>
    <description>&lt;P&gt;Color code what?&lt;/P&gt;
&lt;P&gt;"Title" is normally part that goes before a report in SAS so coloring age doesn't make much sense in relation to "title".&lt;/P&gt;
&lt;P&gt;To color a value based the value we need to know exactly what to color.&lt;/P&gt;
&lt;P&gt;This example colors the background of cell that has the age.&lt;/P&gt;
&lt;PRE&gt;proc format ;
value agecolor
11 = 'Yellow'
12, 13 =  'Red'
14, 15 = 'Black'
;
run;

Proc report data = sashelp.class ;
   column  name age sex weight height ;
   define name / group;
   define age / style=[background=agecolor.];

run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 13:14:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2025-01-30T13:14:25Z</dc:date>
    <item>
      <title>Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957666#M373820</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="112211_0-1738228913687.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104138i376676CDF4F48874/image-size/medium?v=v2&amp;amp;px=400" role="button" title="112211_0-1738228913687.png" alt="112211_0-1738228913687.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I need color coding, as mentioned in the title section&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Proc report data = sashelp.class ;&lt;/P&gt;
&lt;P&gt;column&amp;nbsp; name age sex weight height ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 09:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957666#M373820</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2025-01-30T09:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957667#M373821</link>
      <description>&lt;P&gt;See these:&lt;/P&gt;
&lt;P&gt;1) &lt;A href="https://support.sas.com/resources/papers/proceedings11/290-2011.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings11/290-2011.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/142-31.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/142-31.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3)&amp;nbsp;&lt;A href="https://www.lexjansen.com/wuss/2006/tutorials/TUT-Carpenter.pdf" target="_blank"&gt;https://www.lexjansen.com/wuss/2006/tutorials/TUT-Carpenter.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 09:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957667#M373821</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2025-01-30T09:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957668#M373822</link>
      <description>Thanks for replay&lt;BR /&gt;I have gone through all those PDFs, but I'm not getting.</description>
      <pubDate>Thu, 30 Jan 2025 09:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957668#M373822</guid>
      <dc:creator>112211</dc:creator>
      <dc:date>2025-01-30T09:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957669#M373823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that people can more easily help you, please share 4 more things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The code you have tried.&lt;/LI&gt;
&lt;LI&gt;The result you received.&lt;/LI&gt;
&lt;LI&gt;The result you want.&lt;/LI&gt;
&lt;LI&gt;The SAS log, if there any issues reported in it.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 09:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957669#M373823</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2025-01-30T09:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957684#M373831</link>
      <description>&lt;P&gt;Color code what?&lt;/P&gt;
&lt;P&gt;"Title" is normally part that goes before a report in SAS so coloring age doesn't make much sense in relation to "title".&lt;/P&gt;
&lt;P&gt;To color a value based the value we need to know exactly what to color.&lt;/P&gt;
&lt;P&gt;This example colors the background of cell that has the age.&lt;/P&gt;
&lt;PRE&gt;proc format ;
value agecolor
11 = 'Yellow'
12, 13 =  'Red'
14, 15 = 'Black'
;
run;

Proc report data = sashelp.class ;
   column  name age sex weight height ;
   define name / group;
   define age / style=[background=agecolor.];

run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 13:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957684#M373831</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-01-30T13:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957689#M373834</link>
      <description>&lt;P&gt;If I run your code I do not get any TITLE printed (unless I had previous run a TITLE statement).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1738246195652.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104141i298C958B51E251E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1738246195652.png" alt="Tom_0-1738246195652.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Do you mean you want to change the colors of the column headers in your report?&lt;/P&gt;
&lt;P&gt;You can do that with the STYLE option on the DEFINE statement in PROC REPORT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data = sashelp.class ;
  column  name age sex weight height ;
  define name / style(header)={backgroundcolor=red};
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1738246326529.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104142i80A81E47549F5C58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_1-1738246326529.png" alt="Tom_1-1738246326529.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 14:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957689#M373834</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-30T14:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Color coding for title part</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957769#M373857</link>
      <description>&lt;P&gt;1)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
 set sashelp.class;
 length x $ 80;
 if age in (11:14) then x=cats('(*ESC*){style [foreground=yellow fontsize=2 fontweight=bold]||||||||}age_',age);
 else x=cats('(*ESC*){style [foreground=red fontsize=2 fontweight=bold]||||||||}age_',age);
 keep name age x;
 run;
ods excel file='c:\temp\temp.xlsx';
 proc report data=class nowd ;
 run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1738292008725.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104164i198FD0F01B9ED39B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1738292008725.png" alt="Ksharp_0-1738292008725.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;2)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
 set sashelp.class;
 length x $ 80;
 y='||||||||'; x=cats('age_',age);
 keep name age y  x;
 run;
ods excel file='c:\temp\temp.xlsx';
 proc report data=class nowd ;
 column name age y x;
 define age/display;
 compute y;
 if age in (11:14) then call define(_col_,'style','style={background=yellow foreground=yellow}');
  else  call define(_col_,'style','style={background=red foreground=red}');
 endcomp;
 run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1738292354567.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104165i50DA1C63BD3D5B04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1738292354567.png" alt="Ksharp_1-1738292354567.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 02:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Color-coding-for-title-part/m-p/957769#M373857</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-31T02:59:32Z</dc:date>
    </item>
  </channel>
</rss>

