<?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: Comparing two excel files to find the different values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933882#M41975</link>
    <description>&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;
&lt;P&gt;What does it say about this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a and b and (existing ne revised);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC COMPARE, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by dm9_consumer_id;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;otherwise the procedure will compare observations sequentially as they come in, disregarding the key.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 11:08:50 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2024-06-27T11:08:50Z</dc:date>
    <item>
      <title>Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933880#M41973</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;I am trying to compare two excel files to find the different values. I have imported the files (File name Existing and Revised). I did a proc compare step but it shows 50 records and says the max limit has reached. I want the output to highlight only those rows in a table which has differences. The DM9_consumer_ID is same in both the files. Here is a sample dataset of one of the file. The headers are also same. I also tried to do a merge to find a difference but it did not produced any output, shows only the header. Could you please check and help the best way to compare the difference in the excel files&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;Data Compare_files;&lt;/DIV&gt;
&lt;DIV&gt;infile cards expandtabs;&lt;/DIV&gt;
&lt;DIV&gt;input DM9_Consumer_ID Calculated_Balance_Non_Covid Calculated_Provision_Covid Calculated_Provision_CBIL Calculated_Provision_Final collectvalcovid Impairment No_of_COVID_CBIL_RLS_Products;&lt;/DIV&gt;
&lt;DIV&gt;datalines ;&lt;/DIV&gt;
&lt;DIV&gt;6896 0 0 0 0 0 0 0&lt;/DIV&gt;
&lt;DIV&gt;6895 6248.17 0 0 6248.17 0 6248.17 0&lt;/DIV&gt;
&lt;DIV&gt;6899 0 0 0 0 0 0 0&lt;/DIV&gt;
&lt;DIV&gt;6894 0 0 0 0 0 0 0&lt;/DIV&gt;
&lt;DIV&gt;6893 0 0 0 0 0 0 0&lt;/DIV&gt;
&lt;DIV&gt;14382 -10741.58 14094.8911 14094.8911 14094.8911 26645.8081 14094.8911 1&lt;/DIV&gt;
&lt;DIV&gt;14598 -11981.12 17030.9439 17030.9439 17030.9439 32196.2944 17030.9439 1&lt;/DIV&gt;
&lt;DIV&gt;14577 -47199.67 21795.8424 21795.8424 21795.8424 41204.1381 21795.8424 1&lt;/DIV&gt;
&lt;DIV&gt;;&lt;/DIV&gt;
&lt;DIV&gt;run;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc sort data=existing;
by DM9_Consumer_ID;
run;
Proc sort data=revised;
by DM9_Consumer_ID;
run;
Data differences;
merge existing (in=a) revised (in=b);
by _all_;
if a and b and (existing ne revised);
run;
Proc print data=differences;
run;
/* Comparing both the files */
Proc compare base= existing
compare=revised;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jun 2024 10:35:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933880#M41973</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2024-06-27T10:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933881#M41974</link>
      <description>&lt;P&gt;Reading excel files is guesswork, because in excel the concept of typed columns does not exist in a reliable way.&lt;/P&gt;
&lt;P&gt;If something does not work as expecting sharing the log is always a good idea, so that others know what actually happened.&lt;/P&gt;
&lt;P&gt;If both datasets have all variables in common, a merge without renaming the variable in one of the datasets won't allow comparison of values.&lt;/P&gt;
&lt;P&gt;The if statement&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;if a and b and (existing ne revised);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;means: keep all observations being in both dataset where the variable existing and revised are not equal. Most likely not what your expected to happen.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 10:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933881#M41974</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2024-06-27T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933882#M41975</link>
      <description>&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;
&lt;P&gt;What does it say about this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a and b and (existing ne revised);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC COMPARE, add&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by dm9_consumer_id;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;otherwise the procedure will compare observations sequentially as they come in, disregarding the key.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 11:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933882#M41975</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-27T11:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933886#M41976</link>
      <description>Log:&lt;BR /&gt;1          ;*';*";*/;quit;run;&lt;BR /&gt;2          OPTIONS PAGENO=MIN;&lt;BR /&gt;3          %LET _CLIENTTASKLABEL='Program';&lt;BR /&gt;4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;BR /&gt;5          %LET _CLIENTPROJECTPATH='C:\Users\5604829\Desktop\Documents\Comparing files.egp';&lt;BR /&gt;6          %LET _CLIENTPROJECTPATHHOST='MMD5CG24212BN';&lt;BR /&gt;7          %LET _CLIENTPROJECTNAME='Comparing files.egp';&lt;BR /&gt;8          %LET _SASPROGRAMFILE='';&lt;BR /&gt;9          %LET _SASPROGRAMFILEHOST='';&lt;BR /&gt;10         &lt;BR /&gt;11         ODS _ALL_ CLOSE;&lt;BR /&gt;12         OPTIONS DEV=SVG;&lt;BR /&gt;13         GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14         %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16         %mend;&lt;BR /&gt;17         FILENAME EGHTML TEMP;&lt;BR /&gt;18         ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19             OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20             %HTML5AccessibleGraphSupported&lt;BR /&gt;21             ENCODING='utf-8'&lt;BR /&gt;22             STYLE=HTMLBlue&lt;BR /&gt;23             NOGTITLE&lt;BR /&gt;24             NOGFOOTNOTE&lt;BR /&gt;25             GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26         ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27         &lt;BR /&gt;28         Proc sort data=existing;&lt;BR /&gt;29         by DM9_Consumer_ID;&lt;BR /&gt;30         run;&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 104291 observations read from the data set WORK.EXISTING.&lt;BR /&gt;NOTE: The data set WORK.EXISTING has 104291 observations and 81 variables.&lt;BR /&gt;NOTE: Compressing data set WORK.EXISTING decreased size by 46.38 percent. &lt;BR /&gt;      Compressed is 571 pages; un-compressed would require 1065 pages.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;      real time           1.47 seconds&lt;BR /&gt;      user cpu time       0.68 seconds&lt;BR /&gt;      system cpu time     0.26 seconds&lt;BR /&gt;      memory              73047.96k&lt;BR /&gt;      OS Memory           101816.00k&lt;BR /&gt;      Timestamp           06/27/2024 12:52:44 PM&lt;BR /&gt;      Step Count                        11  Switch Count  5&lt;BR /&gt;      Page Faults                       1&lt;BR /&gt;      Page Reclaims                     26109&lt;BR /&gt;      Page Swaps                        0&lt;BR /&gt;      Voluntary Context Switches        22&lt;BR /&gt;      Involuntary Context Switches      186&lt;BR /&gt;      Block Input Operations            0&lt;BR /&gt;      Block Output Operations           0&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;31         &lt;BR /&gt;32         Proc sort data=revised;&lt;BR /&gt;33         by DM9_Consumer_ID;&lt;BR /&gt;34         run;&lt;BR /&gt;&lt;BR /&gt;2                                                          The SAS System                              10:52 Thursday, June 27, 2024&lt;BR /&gt;&lt;BR /&gt;NOTE: There were 104291 observations read from the data set WORK.REVISED.&lt;BR /&gt;NOTE: The data set WORK.REVISED has 104291 observations and 81 variables.&lt;BR /&gt;NOTE: Compressing data set WORK.REVISED decreased size by 46.85 percent. &lt;BR /&gt;      Compressed is 566 pages; un-compressed would require 1065 pages.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;      real time           1.38 seconds&lt;BR /&gt;      user cpu time       0.68 seconds&lt;BR /&gt;      system cpu time     0.25 seconds&lt;BR /&gt;      memory              73043.28k&lt;BR /&gt;      OS Memory           101816.00k&lt;BR /&gt;      Timestamp           06/27/2024 12:52:45 PM&lt;BR /&gt;      Step Count                        12  Switch Count  5&lt;BR /&gt;      Page Faults                       1&lt;BR /&gt;      Page Reclaims                     26690&lt;BR /&gt;      Page Swaps                        0&lt;BR /&gt;      Voluntary Context Switches        25&lt;BR /&gt;      Involuntary Context Switches      160&lt;BR /&gt;      Block Input Operations            0&lt;BR /&gt;      Block Output Operations           0&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;35         &lt;BR /&gt;36         Data differences;&lt;BR /&gt;37         merge existing (in=a) revised (in=b);&lt;BR /&gt;38         by _all_;&lt;BR /&gt;39         if a and b and (existing ne revised);&lt;BR /&gt;40         run;&lt;BR /&gt;&lt;BR /&gt;NOTE: Variable existing is uninitialized.&lt;BR /&gt;NOTE: Variable revised is uninitialized.&lt;BR /&gt;NOTE: There were 104291 observations read from the data set WORK.EXISTING.&lt;BR /&gt;NOTE: There were 104291 observations read from the data set WORK.REVISED.&lt;BR /&gt;NOTE: The data set WORK.DIFFERENCES has 0 observations and 83 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;      real time           1.35 seconds&lt;BR /&gt;      user cpu time       0.80 seconds&lt;BR /&gt;      system cpu time     0.07 seconds&lt;BR /&gt;      memory              2049.46k&lt;BR /&gt;      OS Memory           31136.00k&lt;BR /&gt;      Timestamp           06/27/2024 12:52:47 PM&lt;BR /&gt;      Step Count                        13  Switch Count  5&lt;BR /&gt;      Page Faults                       0&lt;BR /&gt;      Page Reclaims                     218&lt;BR /&gt;      Page Swaps                        0&lt;BR /&gt;      Voluntary Context Switches        34&lt;BR /&gt;      Involuntary Context Switches      106&lt;BR /&gt;      Block Input Operations            0&lt;BR /&gt;      Block Output Operations           0&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;41         &lt;BR /&gt;42         Proc print data=differences;&lt;BR /&gt;43         run;&lt;BR /&gt;&lt;BR /&gt;NOTE: No observations in data set WORK.DIFFERENCES.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;      real time           0.03 seconds&lt;BR /&gt;      user cpu time       0.00 seconds&lt;BR /&gt;3                                                          The SAS System                              10:52 Thursday, June 27, 2024&lt;BR /&gt;&lt;BR /&gt;      system cpu time     0.00 seconds&lt;BR /&gt;      memory              905.28k&lt;BR /&gt;      OS Memory           31136.00k&lt;BR /&gt;      Timestamp           06/27/2024 12:52:47 PM&lt;BR /&gt;      Step Count                        14  Switch Count  0&lt;BR /&gt;      Page Faults                       0&lt;BR /&gt;      Page Reclaims                     56&lt;BR /&gt;      Page Swaps                        0&lt;BR /&gt;      Voluntary Context Switches        13&lt;BR /&gt;      Involuntary Context Switches      2&lt;BR /&gt;      Block Input Operations            0&lt;BR /&gt;      Block Output Operations           0&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;44         &lt;BR /&gt;45         %LET _CLIENTTASKLABEL=;&lt;BR /&gt;46         %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;47         %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;48         %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;49         %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;50         %LET _SASPROGRAMFILE=;&lt;BR /&gt;51         %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;52         &lt;BR /&gt;53         ;*';*";*/;quit;run;&lt;BR /&gt;54         ODS _ALL_ CLOSE;&lt;BR /&gt;55         &lt;BR /&gt;56         &lt;BR /&gt;57         QUIT; RUN;</description>
      <pubDate>Thu, 27 Jun 2024 12:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933886#M41976</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2024-06-27T12:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933887#M41977</link>
      <description>Both datasets have all variables in common.</description>
      <pubDate>Thu, 27 Jun 2024 12:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933887#M41977</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2024-06-27T12:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933903#M41978</link>
      <description>&lt;PRE&gt;NOTE: Variable existing is uninitialized.
NOTE: Variable revised is uninitialized.&lt;/PRE&gt;
&lt;P&gt;This tells you that these variables do not exist in the datasets and can therefore not be used to indicate anything.&lt;/P&gt;
&lt;P&gt;Comparisons must be explicitly coded in a DATA step; arrays can help in this, but you must rename the common variables from one dataset to avoid the collision.&lt;/P&gt;
&lt;P&gt;All this is why you're better off with PROC COMPARE.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 13:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/933903#M41978</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-27T13:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two excel files to find the different values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/934172#M41991</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You have mentioned "&lt;SPAN&gt;I did a proc compare step but it shows 50 records and says the max limit has reached."&lt;BR /&gt;This is the default and can be overridden with different otpions.&lt;BR /&gt;Have a look at the documentation here.&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0c1y14wyd3u7yn1dmfcpaejllsn.htm" target="_blank"&gt;SAS Help Center: Syntax: PROC COMPARE PROC COMPARE Statement&lt;/A&gt;&lt;BR /&gt;In particular have a look at this example&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1f136xdchlfrtn1663tmzklctb6.htm#n1f136xdchlfrtn1663tmzklctb6" target="_blank"&gt;SAS Help Center: Comparing Values of Observations Using an Output Data Set (OUT=)&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 02:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparing-two-excel-files-to-find-the-different-values/m-p/934172#M41991</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2024-06-30T02:46:22Z</dc:date>
    </item>
  </channel>
</rss>

