<?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 Data Set Changes in Excel Output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225776#M53972</link>
    <description>&lt;UL&gt;&lt;LI&gt;Use proc compare with out=work.Differences and noprint. Differences are marked by X in char variables, and a value &amp;gt; 0 in numeric variables.&lt;/LI&gt;&lt;LI&gt;Knowing this, you can create a new dataset containing flag-variables:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;flag_First_Name = (findc(First_Name, 'X') &amp;gt; 0);
/* ... */
flag_Zip = (Zip ^= 0);&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Drop the variables created by proc compare, &lt;FONT face="arial,helvetica,sans-serif"&gt;except&lt;/FONT&gt; _obs_.&lt;/LI&gt;&lt;LI&gt;Add the Flag-Dataset to the dataset containing the new values, example:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;data work.UpdateExtended;
   set work.DifferencesExtended ;
   set work.Update point=_obs_;

   drop _obs_;
run;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;proc report with a compute-block creates the output:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=work.UpdateExtended;
   columns First_Name Last_Name Address City State Zip flag: dummy;

   define First_Name / display; 
   define Last_Name / display;
   define Address / display;
   define City / display;
   define State / display;
   define Zip / display;
   define flag_First_Name / noprint;
   define flag_Last_Name / noprint;
   define flag_Address / noprint;
   define flag_City / noprint;
   define flag_State / noprint;
   define flag_Zip / noprint;
   define dummy / computed noprint;

   compute dummy / char;
      array vars [6] $ _temporary_ ("_c1_" "_c2_" "_c3_" "_c4_" "_c5_" "_c6_");
      array flags [6] _c7_ _c8_ c9_ _c10_ _c11_ _c12_;

      do i = 1 to dim(flags);         
         if flags[i] then call define(vars[i], "style", "style=[background=yellow]");
      end;

   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;One problem remains: creating large (&amp;gt;30k obs) excel-files with ods excel is not possible.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2015 07:24:25 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2015-09-16T07:24:25Z</dc:date>
    <item>
      <title>Highlighting Data Set Changes in Excel Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225456#M53934</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a database table that becomes updated every so often with new information. For example in an earlier version of the database a person's name might be misspelled or an address typed incorrectly. When the database table is updated, I want to be able to export the table with the new values highlighted in an excel sheet. Is this something that is possible to do? I have used proc compare to output a pdf of changes in variables values, and while this is also helpful, I was hoping the excel sheet could be done so that others I work with can easily keep using the entire database table to continue their work and just know that a value has changed from the last version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for any help.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 20:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225456#M53934</guid>
      <dc:creator>honk</dc:creator>
      <dc:date>2015-09-14T20:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting Data Set Changes in Excel Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225459#M53935</link>
      <description>You can do this using the information from PROC COMPARE OUT= to indicate which variables/obs are changed. This is used in PROC REPORT with CALL DEFINE to highlight the value. Post some example data makes it easier for all to see what you want.</description>
      <pubDate>Mon, 14 Sep 2015 21:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225459#M53935</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-09-14T21:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting Data Set Changes in Excel Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225477#M53937</link>
      <description>&lt;P&gt;Thank you for the response &lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410" target="_self"&gt;data_null__&lt;/A&gt;&amp;nbsp;. I was exploring PROC COMPARE OUT= and noticed that it gave X'd out values, periods, and 0s. So I could basically tell&amp;nbsp;PROC REPORT and CALL DEFINE to use the 'OUT=' data set as a map basically to highlight which values are new?&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;Good idea for posting data, I am pasting a fictitious example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Original Table&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;First_Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Last_Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt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;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Updated Table&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;First_Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Last_Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Address&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;City&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;State&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Zip&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;Robert&lt;/FONT&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;Newman&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;877 Walknot St&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;Blue&lt;/TD&gt;&lt;TD&gt;TX&lt;/TD&gt;&lt;TD&gt;99988&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Christopher&lt;/TD&gt;&lt;TD&gt;Watkins&lt;/TD&gt;&lt;TD&gt;222 Chestnut Dr&lt;/TD&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;TD&gt;WI&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;88888&lt;/FONT&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sally&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Ride&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;453 Peanut Ln&lt;/TD&gt;&lt;TD&gt;White&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;MI&lt;/FONT&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;22233&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Winona&lt;/TD&gt;&lt;TD&gt;Ryder&lt;/TD&gt;&lt;TD&gt;991 Pistachio Ct&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;Purple&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;GA&lt;/TD&gt;&lt;TD&gt;55587&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***Blue/italicized values would be highlighted in excel output. All original data would be kept in the output, except for updated values.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 21:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225477#M53937</guid>
      <dc:creator>honk</dc:creator>
      <dc:date>2015-09-14T21:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting Data Set Changes in Excel Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225776#M53972</link>
      <description>&lt;UL&gt;&lt;LI&gt;Use proc compare with out=work.Differences and noprint. Differences are marked by X in char variables, and a value &amp;gt; 0 in numeric variables.&lt;/LI&gt;&lt;LI&gt;Knowing this, you can create a new dataset containing flag-variables:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;flag_First_Name = (findc(First_Name, 'X') &amp;gt; 0);
/* ... */
flag_Zip = (Zip ^= 0);&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Drop the variables created by proc compare, &lt;FONT face="arial,helvetica,sans-serif"&gt;except&lt;/FONT&gt; _obs_.&lt;/LI&gt;&lt;LI&gt;Add the Flag-Dataset to the dataset containing the new values, example:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;data work.UpdateExtended;
   set work.DifferencesExtended ;
   set work.Update point=_obs_;

   drop _obs_;
run;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;proc report with a compute-block creates the output:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=work.UpdateExtended;
   columns First_Name Last_Name Address City State Zip flag: dummy;

   define First_Name / display; 
   define Last_Name / display;
   define Address / display;
   define City / display;
   define State / display;
   define Zip / display;
   define flag_First_Name / noprint;
   define flag_Last_Name / noprint;
   define flag_Address / noprint;
   define flag_City / noprint;
   define flag_State / noprint;
   define flag_Zip / noprint;
   define dummy / computed noprint;

   compute dummy / char;
      array vars [6] $ _temporary_ ("_c1_" "_c2_" "_c3_" "_c4_" "_c5_" "_c6_");
      array flags [6] _c7_ _c8_ c9_ _c10_ _c11_ _c12_;

      do i = 1 to dim(flags);         
         if flags[i] then call define(vars[i], "style", "style=[background=yellow]");
      end;

   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;One problem remains: creating large (&amp;gt;30k obs) excel-files with ods excel is not possible.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 07:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/225776#M53972</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2015-09-16T07:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Highlighting Data Set Changes in Excel Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/226115#M54003</link>
      <description>&lt;P&gt;Thank you, looks promising. I am going to try this out soon and see if I can get it to work&amp;nbsp;&lt;img id="manhappy" class="emoticon emoticon-manhappy" src="https://communities.sas.com/i/smilies/16x16_man-happy.png" alt="Man Happy" title="Man Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt; wrote:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Use proc compare with out=work.Differences and noprint. Differences are marked by X in char variables, and a value &amp;gt; 0 in numeric variables.&lt;/LI&gt;&lt;LI&gt;Knowing this, you can create a new dataset containing flag-variables:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;flag_First_Name = (findc(First_Name, 'X') &amp;gt; 0);
/* ... */
flag_Zip = (Zip ^= 0);&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Drop the variables created by proc compare, &lt;FONT face="arial,helvetica,sans-serif"&gt;except&lt;/FONT&gt; _obs_.&lt;/LI&gt;&lt;LI&gt;Add the Flag-Dataset to the dataset containing the new values, example:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;data work.UpdateExtended;
   set work.DifferencesExtended ;
   set work.Update point=_obs_;

   drop _obs_;
run;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;proc report with a compute-block creates the output:&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=work.UpdateExtended;
   columns First_Name Last_Name Address City State Zip flag: dummy;

   define First_Name / display; 
   define Last_Name / display;
   define Address / display;
   define City / display;
   define State / display;
   define Zip / display;
   define flag_First_Name / noprint;
   define flag_Last_Name / noprint;
   define flag_Address / noprint;
   define flag_City / noprint;
   define flag_State / noprint;
   define flag_Zip / noprint;
   define dummy / computed noprint;

   compute dummy / char;
      array vars [6] $ _temporary_ ("_c1_" "_c2_" "_c3_" "_c4_" "_c5_" "_c6_");
      array flags [6] _c7_ _c8_ c9_ _c10_ _c11_ _c12_;

      do i = 1 to dim(flags);         
         if flags[i] then call define(vars[i], "style", "style=[background=yellow]");
      end;

   endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;One problem remains: creating large (&amp;gt;30k obs) excel-files with ods excel is not possible.&lt;/FONT&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2015 19:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Highlighting-Data-Set-Changes-in-Excel-Output/m-p/226115#M54003</guid>
      <dc:creator>honk</dc:creator>
      <dc:date>2015-09-17T19:02:19Z</dc:date>
    </item>
  </channel>
</rss>

