<?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: Highlighting (Coloring) Empty cells in excel output in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928534#M41699</link>
    <description>&lt;P&gt;The code works fine, I guess my question is do I have to write out all the 47 columns that I have that I'd want to color if they have empty cells?&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 18:42:30 GMT</pubDate>
    <dc:creator>shamie011</dc:creator>
    <dc:date>2024-05-15T18:42:30Z</dc:date>
    <item>
      <title>Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928529#M41697</link>
      <description>&lt;P&gt;I have a exported an excel report that contains empty cells and would like to write a code that would color all empty cells in the excel output.&lt;/P&gt;&lt;P&gt;I have the following code which only highlights/colors empty cells in the NAME column, however I'd like to highlight all empty cells without having to write out code for all 47 columns that I have in my report :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC REPORT DATA = STAGE1;&lt;BR /&gt;DEFINE NAME -- REFERRAL_BASIS/ DISPLAY;&lt;/P&gt;&lt;P&gt;COMPUTE NAME;&lt;BR /&gt;IF NAME= '' THEN&lt;BR /&gt;CALL DEFINE('NAME', "STYLE", "STYLE=[BACKGROUND=CYAN]");&lt;BR /&gt;ENDCOMP;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 18:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928529#M41697</guid>
      <dc:creator>shamie011</dc:creator>
      <dc:date>2024-05-15T18:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928532#M41698</link>
      <description>&lt;P&gt;I can't reproduce this. The code works properly on my example data. Please provide (a portion) of your actual data set STAGE1, as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;), and not in any other format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
    set class;
    if name="Jane" then call missing(name);
run;

ods excel file='test.xlsx';
PROC REPORT DATA = class;
DEFINE name--weight/ DISPLAY;
COMPUTE NAME;
IF NAME= '' THEN
CALL DEFINE('NAME', "STYLE", "STYLE=[BACKGROUND=CYAN]");
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="PaigeMiller_0-1715798142309.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96555iF9292FDBB4B6C58F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PaigeMiller_0-1715798142309.png" alt="PaigeMiller_0-1715798142309.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 18:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928532#M41698</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-15T18:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928534#M41699</link>
      <description>&lt;P&gt;The code works fine, I guess my question is do I have to write out all the 47 columns that I have that I'd want to color if they have empty cells?&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 18:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928534#M41699</guid>
      <dc:creator>shamie011</dc:creator>
      <dc:date>2024-05-15T18:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928536#M41700</link>
      <description>&lt;P&gt;Sorry, I didn't read it carefully.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer is here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-use-proc-report-with-same-compute-block-for-many/m-p/873801#M345225" target="_blank" rel="noopener"&gt;Solved: Re: How to use proc report with same compute block for many variables ... - SAS Support Communities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;scroll down to the answer by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 18:46:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928536#M41700</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-15T18:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928542#M41702</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I was able to make it work for more variables with ARRAY processing in the COMPUTE block. I changed the COMPUTE block to be placed on the last report item in the report row (WEIGHT instead of NAME) because then I could do everything for each column in one COMPUTE block. But I still needed to have the column names listed in the ARRAY statement.&amp;nbsp; I took advantage of the fact that you can use temporary variables like "var_col" in the CALL DEFINE statement.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1715799860550.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96556i2C8BCBF942B66F85/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1715799860550.png" alt="Cynthia_sas_0-1715799860550.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 19:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928542#M41702</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2024-05-15T19:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting (Coloring) Empty cells in excel output</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928576#M41703</link>
      <description>&lt;P&gt;For your this special case, you could try keyword _CHARACTER_ and _NUMERIC_ to apply traffic light style to all these variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
    set sashelp.class;
    if _n_ in (1:4) then call missing(name);
    if _n_ in (6 10:12) then call missing(age,sex,height);
run;


proc format;
value $fmt
' '='cyan'
other='white'
;
value _fmt
.='cyan'
other='white'
;
run;
option missing=' ';
ods excel file='c:\temp\test.xlsx';
PROC REPORT DATA = class nowd;
DEFINE _character_/display style={background=$fmt.};
DEFINE _numeric_/display style={background=_fmt.};
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-1715820940904.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96558iD51893C6B0165297/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1715820940904.png" alt="Ksharp_0-1715820940904.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 00:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Highlighting-Coloring-Empty-cells-in-excel-output/m-p/928576#M41703</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-16T00:55:56Z</dc:date>
    </item>
  </channel>
</rss>

