<?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: Create a cross tab and highlight the difference in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637819#M189636</link>
    <description>&lt;P&gt;How I'd do it:&lt;/P&gt;
&lt;P&gt;- pre-run the calculations&lt;/P&gt;
&lt;P&gt;- identify the values to highlight&lt;/P&gt;
&lt;P&gt;- modify these values slightly for reporting, for example add 1e-12&lt;/P&gt;
&lt;P&gt;- create a colour format for 2+1e-12&lt;/P&gt;
&lt;P&gt;- use that format to change the colour.&lt;/P&gt;
&lt;P&gt;The modified value still shows as 2 in the report, but can be formatted differently from other 2s that may be present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be cleverer ways.&lt;/P&gt;
&lt;P&gt;I've used this for proc report and proc tabulate. Not too sure how much proc freq's styles can be altered, so you may have to use a different proc for reporting..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2020 11:43:16 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-04-06T11:43:16Z</dc:date>
    <item>
      <title>Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637178#M189412</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have Fields in a tables , which is supposed to have same content .If there any good deviation needs to be highlighted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A B&lt;/STRONG&gt;&lt;BR /&gt;S S&lt;BR /&gt;M M&lt;BR /&gt;M M&lt;BR /&gt;S S&lt;BR /&gt;L L&lt;BR /&gt;S S&lt;BR /&gt;S S&lt;BR /&gt;S S&lt;BR /&gt;M M&lt;BR /&gt;S S&lt;BR /&gt;S L&lt;BR /&gt;S L&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the Cross tab created by PROC FREQ , I need to highlight value if it is greater than Diagonal value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table of A by b &lt;BR /&gt;B Total&lt;BR /&gt;L M S &lt;BR /&gt;A &lt;BR /&gt;L Frequency 1 0 0 1&lt;BR /&gt;Percent 8.33 0 0 8.33&lt;BR /&gt;Row Pct 100 0 0 &lt;BR /&gt;Col Pct 33.33 0 0 &lt;BR /&gt;M Frequency 0 3 0 3&lt;BR /&gt;Percent 0 25 0 25&lt;BR /&gt;Row Pct 0 100 0 &lt;BR /&gt;Col Pct 0 100 0 &lt;BR /&gt;S Frequency 2 0 6 8&lt;BR /&gt;Percent 16.67 0 50 66.67&lt;BR /&gt;Row Pct 25 0 75 &lt;BR /&gt;Col Pct 66.67 0 100 &lt;BR /&gt;&lt;BR /&gt;Total Frequency 3 3 6 12&lt;BR /&gt;Percent 25 25 50 100&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>Fri, 03 Apr 2020 08:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637178#M189412</guid>
      <dc:creator>Kayalvizhi</dc:creator>
      <dc:date>2020-04-03T08:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637667#M189551</link>
      <description>&lt;P&gt;Show us 1. some code and 2. some results.&lt;/P&gt;
&lt;P&gt;1. I suppose you ran this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq; 
  tables A*B; 
run;.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. I suppose you obtained this?&lt;/P&gt;
&lt;SECTION style="display: block; padding-top: 1px; padding-bottom: 8px; color: #000000; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #fafbfe; text-decoration-style: initial; text-decoration-color: initial;"&gt;
&lt;ARTICLE style="display: block; padding-top: 1px; padding-bottom: 8px;" aria-label="Cross-Tabular Freq Table"&gt;
&lt;TABLE style="border-collapse: collapse; border-spacing: 0px; margin-bottom: 1em; margin-left: auto; margin-right: auto;" role="presentation"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c t" style="text-align: center; padding: 3px 6px; vertical-align: top;"&gt;
&lt;TABLE class="table" style="border-collapse: collapse; border-spacing: 0px; margin-bottom: 1em; border-width: 1px 0px 0px 1px; border-style: solid; border-color: #c1c1c1; border-image: initial;"&gt;&lt;COLGROUP&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="t header" style="text-align: left; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="col"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="t" style="vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Frequency&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="t" style="vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Percent&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="t" style="vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Row Pct&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="t" style="vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Col Pct&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;TD style="text-align: left; padding: 3px 6px; vertical-align: top;"&gt;
&lt;TABLE class="table" style="border-collapse: collapse; border-spacing: 0px; margin-bottom: 1em; border-width: 1px 0px 0px 1px; border-style: solid; border-color: #c1c1c1; border-image: initial;" aria-label="Cross-Tabular Freq Table"&gt;&lt;CAPTION aria-label="Cross-Tabular Freq Table"&gt;&amp;nbsp;&lt;/CAPTION&gt;&lt;COLGROUP&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;/COLGROUP&gt;&lt;COLGROUP&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;COL style="border-left: 1px solid #c1c1c1; border-right: 0px solid #c1c1c1;" /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="c header" style="text-align: center; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" colspan="5" scope="colgroup"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Table&amp;nbsp;of&amp;nbsp;a&amp;nbsp;by&amp;nbsp;b&lt;/FONT&gt;&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="c b header" style="text-align: center; padding: 3px 6px; vertical-align: bottom; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" rowspan="2" scope="col"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;a&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="c b header" style="text-align: center; padding: 3px 6px; vertical-align: bottom; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" colspan="4" scope="colgroup"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;b&lt;/FONT&gt;&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="r header" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="col"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;L&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="col"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;M&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="col"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;S&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="col"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Total&lt;/FONT&gt;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="t rowheader" style="text-align: left; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="row"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;L&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;8.33&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;100.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;33.33&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;8.33&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="t rowheader" style="text-align: left; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="row"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;M&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;25.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;100.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;100.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;25.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="t rowheader" style="text-align: left; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="row"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;S&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;16.67&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;25.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;66.67&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;6&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;50.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;75.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;100.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;8&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;66.67&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="border-top: 1px solid #c1c1c1; border-bottom: 0px solid #c1c1c1;"&gt;
&lt;TH class="t rowheader" style="text-align: left; padding: 3px 6px; vertical-align: top; background-color: #edf2f9; border-color: #b0b7bb; border-style: solid; border-width: 0px 1px 1px 0px; color: #112277; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: bold;" scope="row"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Total&lt;/FONT&gt;&lt;/TH&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;25.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;3&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;25.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;6&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;50.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="r t data" style="text-align: right; padding: 3px 6px; vertical-align: top; background-color: #ffffff; border-color: #c1c1c1; border-style: solid; border-width: 0px 1px 1px 0px; font-family: Arial, 'Albany AMT', Helvetica, Helv; font-size: x-small; font-style: normal; font-weight: normal;"&gt;
&lt;DIV class="stacked-cell"&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;12&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="r t" style="text-align: right; vertical-align: top;"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;100.00&lt;/FONT&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/ARTICLE&gt;
&lt;/SECTION&gt;
&lt;P&gt;What do you want next?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 10:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637667#M189551</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-04-05T10:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637818#M189635</link>
      <description>I want to highlight first column 3rd row square , as it shows some deviation from diagonal value , which is 6 in 3rd row 3rd column</description>
      <pubDate>Mon, 06 Apr 2020 11:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637818#M189635</guid>
      <dc:creator>Kayalvizhi</dc:creator>
      <dc:date>2020-04-06T11:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637819#M189636</link>
      <description>&lt;P&gt;How I'd do it:&lt;/P&gt;
&lt;P&gt;- pre-run the calculations&lt;/P&gt;
&lt;P&gt;- identify the values to highlight&lt;/P&gt;
&lt;P&gt;- modify these values slightly for reporting, for example add 1e-12&lt;/P&gt;
&lt;P&gt;- create a colour format for 2+1e-12&lt;/P&gt;
&lt;P&gt;- use that format to change the colour.&lt;/P&gt;
&lt;P&gt;The modified value still shows as 2 in the report, but can be formatted differently from other 2s that may be present.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be cleverer ways.&lt;/P&gt;
&lt;P&gt;I've used this for proc report and proc tabulate. Not too sure how much proc freq's styles can be altered, so you may have to use a different proc for reporting..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 11:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637819#M189636</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-04-06T11:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637834#M189643</link>
      <description>If there is same value in the diagonal ,then it would highlight the diagonal value. Which doesn't need</description>
      <pubDate>Mon, 06 Apr 2020 13:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637834#M189643</guid>
      <dc:creator>Kayalvizhi</dc:creator>
      <dc:date>2020-04-06T13:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a cross tab and highlight the difference</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637938#M189680</link>
      <description>&lt;P&gt;Proc &lt;STRONG&gt;FREQ&lt;/STRONG&gt; does &lt;STRONG&gt;not&lt;/STRONG&gt; have a syntax to conditionally style a cell of it's output based on values in other cells.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nor does TABULATE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nor does PRINT.&lt;/P&gt;
&lt;P&gt;Proc REPORT&amp;nbsp;&lt;STRONG&gt;does&lt;/STRONG&gt;&amp;nbsp;have the&amp;nbsp;&lt;STRONG&gt;COMPUTE&lt;/STRONG&gt; block in which a&amp;nbsp;&lt;STRONG&gt;CALL DEFINE&lt;/STRONG&gt; can be conditionally executed to change the&amp;nbsp;&lt;STRONG&gt;STYLE&lt;/STRONG&gt; attribute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose you want to stick with Proc FREQ.&amp;nbsp; What can you do ?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Capture ODS OUTPUT of the CrossTabFreqs
&lt;UL&gt;
&lt;LI&gt;You will have all the data needed to reconstruct the crosstab rendering with custom styling.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;One row per combination of &amp;lt;var1&amp;gt;*&amp;lt;var2&amp;gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Process the captured output
&lt;UL&gt;
&lt;LI&gt;Compute a 'cell value' that stacks the frequencies in the same manner as Proc FREQ cells
&lt;UL&gt;
&lt;LI&gt;Stacking can be done using inline styling function ^{NEWLINE}&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Tag the cells that are freq &amp;gt; diagonal freq&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Transpose the CrossTabFreq into a grid shape&lt;/LI&gt;
&lt;LI&gt;Proc REPORT the grid shaped data
&lt;UL&gt;
&lt;LI&gt;Conditionally style the cell if the cell value is tagged&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data have;
input A$ B$ @@;
datalines;
S S S S S S S S S S S S
M M M M M M
L L
L M L M L M
S L S L
S M S M S M S M S M S M S M
;

* CAPTURE CrossTabFreqs;

ods _all_ close;
ods output CrossTabFreqs=xtab;
proc freq data=have;
  tables A * B;
run;

* FLAG and STACK cross tab freq renders;
options missing=' ';
data xcells;
  if 0 then set xtab;

  * HASH for looking up diagonal freq;
  if _n_ = 1 then do;
    retain diagfreq .;
    declare hash diags(dataset:'xtab(where=(a=b and not missing(a)) rename=frequency=diagfreq)');
    diags.defineKey('a');
    diags.defineData('diagfreq');
    diags.defineDone();
  end;

  set xtab;

  length mlv $100;  * mlv ~ multi line value;

  rc = diags.find();

  * TAG mlv per OP criteria;
  if rc=0 and not missing(b) and DiagFreq &amp;lt; Frequency then do;
    mlv = '*';
  end;

  * STACK the count and percents for later output;
  mlv = trim(mlv) || vvalue(Frequency)
  || '^{NEWLINE}' || vvalue(Percent);

  if not missing(RowPercent) then mlv = trim(mlv)
  || '^{NEWLINE}' || vvalue(RowPercent);

  if not missing(ColPercent) then mlv = trim(mlv)
  || '^{NEWLINE}' || vvalue(ColPercent);

  if missing (A) then A = 'Total';
  if missing (B) then B = 'Total';
run;
options missing='.';

* RESHAPE to a grid;
proc transpose data=xcells out=grid(drop=_name_);
  by a notsorted;
  id b;
  var mlv;
run;

* Code generate macro calls for conditional styling the grid columns;
* Column names are from transpose id b, and thus the names are the values of b;
proc sql noprint;
  select distinct ('%compute('||cats(b)||')') into :columns separated by ' ' from xtab where not missing(b);
quit;

ods escapechar = '^';
ods html file='xtab.html';

* compile the macro that the codegen will invoke upon resolution;
%macro compute(column);
  compute &amp;amp;column.;
    if &amp;amp;column. =: '*' then do;
      &amp;amp;column. = left(substr(&amp;amp;column.,2));
      call define ("&amp;amp;column.", 'style', 'style=[background=orange]');
    end;
  endcomp;
%mend;

proc report data=grid style(column)=[textalign=right];
  columns ('B' _character_);
  define a / order order=data style=header;

  /* resolve the codegen so the macro calls further codegen COMPUTE block source codes that perform the conditional styling */
  &amp;amp;columns
run;

ods _all_ close;
&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_0-1586205124925.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37963iF20B7EF00B9BE87B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardADeVenezia_0-1586205124925.png" alt="RichardADeVenezia_0-1586205124925.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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 20:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-cross-tab-and-highlight-the-difference/m-p/637938#M189680</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-04-06T20:34:15Z</dc:date>
    </item>
  </channel>
</rss>

