<?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 Month Over Month Datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464908#M285141</link>
    <description>BTW, the tab labeled "OLD" is the tab to look at. Ignore tab labeled 'NEW" as it was included in the "OLD" tab. Thx</description>
    <pubDate>Thu, 24 May 2018 21:04:15 GMT</pubDate>
    <dc:creator>wheddingsjr</dc:creator>
    <dc:date>2018-05-24T21:04:15Z</dc:date>
    <item>
      <title>Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464907#M285140</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each month I run a running report from Jan 1. Each month new items are added to the sets of data. I would like to be able to write code that will automatically populate a column in the new table with "Y" or "N" which indicates whether or not a line is has already been recognized in the old table. I do this manually each month and it would be time consuming if I were able to do this. I am attaching examples for review (I cant seem to cut and paste w/o losing my format):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 21:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464907#M285140</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-24T21:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464908#M285141</link>
      <description>BTW, the tab labeled "OLD" is the tab to look at. Ignore tab labeled 'NEW" as it was included in the "OLD" tab. Thx</description>
      <pubDate>Thu, 24 May 2018 21:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464908#M285141</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-24T21:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464913#M285142</link>
      <description>&lt;P&gt;something like this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
if _n_=1 then do;
if 0 then set old;
   dcl hash H (dataset:'old',multidata:'y') ;
   h.definekey  ('MEMNO','BEGDATE','COMBO');
   h.definedone () ;
end;
set new;
if h.check()=0 then new_column='Y';
else new_column='N';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It appears you could even add&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;COUNT&lt;/TD&gt;&lt;TD&gt;UNIQDOS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;to the key variable list in the hash object and use the direct check method. Play around and let us know&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 May 2018 21:26:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464913#M285142</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-24T21:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464921#M285143</link>
      <description>&lt;P&gt;I'm not reading 9 pages to figure out your logic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you still inserting the record if it's new or are you just checking to see if it's new? If its the latter, change your process a little to make this easier, add a variable called monthProcessed to the data sets. Then you can sort and if there are duplicates, which you can check using First. and Last. (from previous question) to identify if a record is new this month and was present last month as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are instructions on how to get your data into the forum as a data step so you can get tested solutions back:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&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>Fri, 25 May 2018 00:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/464921#M285143</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-25T00:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466164#M285144</link>
      <description>&lt;P&gt;Hi Novinosrin and thanks for your help. Sorry for the delayed response but it was a long weekend here where I am. I brought in the old data and ran it against the new data using the code you provided. It creates and populates a column in my results but its putting a "N" in every row even though I know there are some that should have a "Y". I am not very versed with complex code as I basically just run a standard and saved script so some of the code you use I don't really understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this:&lt;/P&gt;&lt;P&gt;data UrineAnalysis1;&lt;BR /&gt;if _n_=1 then do;&lt;BR /&gt;if 0 then set Apr2018_TEST; (The old data I imported in)&lt;BR /&gt;dcl hash H (dataset:'Apr2018_TEST',multidata:'N') ;&lt;BR /&gt;h.definekey ('COMBO');&lt;BR /&gt;h.definedone () ;&lt;BR /&gt;end;&lt;BR /&gt;set UrineAnalysis; (the new data created)&lt;BR /&gt;if h.check()=0 then RETRACT='N';&lt;BR /&gt;else RETRACT='Y';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466164#M285144</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-30T18:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466166#M285145</link>
      <description>&lt;P&gt;Can you provide us with a more and better representative sample of your real plz?&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466166#M285145</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-30T18:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466171#M285146</link>
      <description>&lt;P&gt;Thanks Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466171#M285146</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-30T18:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466197#M285147</link>
      <description>&lt;P&gt;Here you go.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 18:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466197#M285147</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-30T18:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466208#M285148</link>
      <description>&lt;P&gt;Please test and let us know. Thank you&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data old;
input MEMNO 	COUNT	UNIQDOS	BEGDATE :mmddyy10.	COMBO ;
cards;
12345	1	1	01/03/18	1234543103
12345	.	0	01/03/18	1234543103
12345	2	1	01/05/18	1234543105
12345	3	1	01/07/18	1234543107
12345	4	1	01/09/18	1234543109
12345	5	1	01/10/18	1234543110
12345	.	0	01/10/18	1234543110
12345	6	1	01/12/18	1234543112
12345	7	1	01/13/18	1234543113
12345	8	1	01/14/18	1234543114
12345	9	1	01/16/18	1234543116
12345	10	1	01/17/18	1234543117
12345	11	1	01/19/18	1234543119
12345	.	0	01/19/18	1234543119
12345	12	1	01/21/18	1234543121
12345	13	1	01/23/18	1234543123
12345	14	1	01/24/18	1234543124
12345	15	1	01/26/18	1234543126
12345	16	1	01/27/18	1234543127
12345	17	1	01/28/18	1234543128
12345	18	1	01/30/18	1234543130
12345	19	1	01/31/18	1234543131
12345	20	1	02/02/18	1234543133
12345	.	0	02/02/18	1234543133
12345	21	1	02/04/18	1234543135
;


data new;
input MEMNO	RETRACT $	COUNT	UNIQDOS	BEGDATE  :mmddyy10.	COMBO;
drop retract;
cards;
12345	Y	1	1	01/03/18	1234543103
12345	Y	.	0	01/03/18	1234543103
12345	Y	2	1	01/05/18	1234543105
12345	Y	3	1	01/07/18	1234543107
12345	Y	4	1	01/09/18	1234543109
12345	Y	5	1	01/10/18	1234543110
12345	Y	.	0	01/10/18	1234543110
12345	Y	6	1	01/12/18	1234543112
12345	Y	7	1	01/13/18	1234543113
12345	Y	8	1	01/14/18	1234543114
12345	Y	9	1	01/16/18	1234543116
12345	Y	10	1	01/17/18	1234543117
12345	Y	11	1	01/19/18	1234543119
12345	Y	.	0	01/19/18	1234543119
12345	Y	12	1	01/21/18	1234543121
12345	Y	13	1	01/23/18	1234543123
12345	Y	14	1	01/24/18	1234543124
12345	Y	15	1	01/26/18	1234543126
12345	Y	16	1	01/27/18	1234543127
12345	Y	17	1	01/28/18	1234543128
12345	Y	18	1	01/30/18	1234543130
12345	Y	19	1	01/31/18	1234543131
12345	Y	20	1	02/02/18	1234543133
12345	Y	.	0	02/02/18	1234543133
12345	Y	21	1	02/04/18	1234543135
12345	N	22	1	02/06/18	1234543137
12345	N	23	1	02/07/18	1234543138
12345	N	24	1	02/09/18	1234543140
12345	N	.	0	02/09/18	1234543140
12345	N	25	1	02/11/18	1234543142
12345	N	26	1	02/13/18	1234543144
12345	N	27	1	02/16/18	1234543147
12345	N	.	0	02/16/18	1234543147
12345	N	28	1	02/18/18	1234543149
12345	N	29	1	02/21/18	1234543152
12345	N	.	0	02/21/18	1234543152
;

data want;
if _n_=1 then do;
if 0 then set old;
   dcl hash H (dataset:'old') ;
   h.definekey  ('MEMNO','count','UNIQDOS','BEGDATE','COMBO');
   h.definedone () ;
end;
set new;
if h.check()=0 then retract='Y';
else retract='N';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 May 2018 19:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466208#M285148</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-30T19:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466260#M285149</link>
      <description>&lt;P&gt;Hi again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested this and it isnt working. Its ok though. I automated a pretty good amount of the process (took it from a 3-4 hour process down to 20 mins.) So manually going through the monthly reports for dupes wont be that bad, I have done it that way for 2 years now so its no big deal. But thanks for all of your help.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 21:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466260#M285149</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-30T21:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466262#M285150</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;Ok That makes me feel bad. One last try please at least for the sake of my satisfaction:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 create table want as
 select *, 'Y' as retract from
   (select *  from new
         intersect
         select * from old)
   union
select *,'N' as retract from (select *  from new
         except
         select * from old)
order by memno, begdate;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 21:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466262#M285150</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-30T21:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466263#M285151</link>
      <description>&lt;P&gt;What about a straight merge? You'll have to recreate your sort after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data old;
input MEMNO 	COUNT	UNIQDOS	BEGDATE :mmddyy10.	COMBO ;
cards;
12345	1	1	01/03/18	1234543103
12345	.	0	01/03/18	1234543103
12345	2	1	01/05/18	1234543105
12345	3	1	01/07/18	1234543107
12345	4	1	01/09/18	1234543109
12345	5	1	01/10/18	1234543110
12345	.	0	01/10/18	1234543110
12345	6	1	01/12/18	1234543112
12345	7	1	01/13/18	1234543113
12345	8	1	01/14/18	1234543114
12345	9	1	01/16/18	1234543116
12345	10	1	01/17/18	1234543117
12345	11	1	01/19/18	1234543119
12345	.	0	01/19/18	1234543119
12345	12	1	01/21/18	1234543121
12345	13	1	01/23/18	1234543123
12345	14	1	01/24/18	1234543124
12345	15	1	01/26/18	1234543126
12345	16	1	01/27/18	1234543127
12345	17	1	01/28/18	1234543128
12345	18	1	01/30/18	1234543130
12345	19	1	01/31/18	1234543131
12345	20	1	02/02/18	1234543133
12345	.	0	02/02/18	1234543133
12345	21	1	02/04/18	1234543135
;


data new;
input MEMNO	RETRACT $	COUNT	UNIQDOS	BEGDATE  :mmddyy10.	COMBO;
drop retract;
cards;
12345	Y	1	1	01/03/18	1234543103
12345	Y	.	0	01/03/18	1234543103
12345	Y	2	1	01/05/18	1234543105
12345	Y	3	1	01/07/18	1234543107
12345	Y	4	1	01/09/18	1234543109
12345	Y	5	1	01/10/18	1234543110
12345	Y	.	0	01/10/18	1234543110
12345	Y	6	1	01/12/18	1234543112
12345	Y	7	1	01/13/18	1234543113
12345	Y	8	1	01/14/18	1234543114
12345	Y	9	1	01/16/18	1234543116
12345	Y	10	1	01/17/18	1234543117
12345	Y	11	1	01/19/18	1234543119
12345	Y	.	0	01/19/18	1234543119
12345	Y	12	1	01/21/18	1234543121
12345	Y	13	1	01/23/18	1234543123
12345	Y	14	1	01/24/18	1234543124
12345	Y	15	1	01/26/18	1234543126
12345	Y	16	1	01/27/18	1234543127
12345	Y	17	1	01/28/18	1234543128
12345	Y	18	1	01/30/18	1234543130
12345	Y	19	1	01/31/18	1234543131
12345	Y	20	1	02/02/18	1234543133
12345	Y	.	0	02/02/18	1234543133
12345	Y	21	1	02/04/18	1234543135
12345	N	22	1	02/06/18	1234543137
12345	N	23	1	02/07/18	1234543138
12345	N	24	1	02/09/18	1234543140
12345	N	.	0	02/09/18	1234543140
12345	N	25	1	02/11/18	1234543142
12345	N	26	1	02/13/18	1234543144
12345	N	27	1	02/16/18	1234543147
12345	N	.	0	02/16/18	1234543147
12345	N	28	1	02/18/18	1234543149
12345	N	29	1	02/21/18	1234543152
12345	N	.	0	02/21/18	1234543152
;



proc sort data=old; by memno count uniqdos begdate combo;
proc sort data=new; by memno count uniqdos begdate combo;run;

data want;
merge old (in=a) new(in=b);
by memno count uniqdos begdate combo;

if a and b then previousMonth='Y';
else if b then  previousMonth='N';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 May 2018 21:40:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466263#M285151</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-30T21:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466455#M285152</link>
      <description>&lt;P&gt;Novinosrin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looked as if it wanted to work..lol...but I got a ton of either&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#FF0000"&gt;ERROR: Column 20 from the first contributor of INTERSECT is not the same type as its counterpart from the second.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;or&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#FF0000"&gt;ERROR: Numeric expression requires a numeric format.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 14:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466455#M285152</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-31T14:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466496#M285153</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It combined both tables and just added the N but not the Y&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 15:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466496#M285153</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-31T15:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466497#M285154</link>
      <description>&lt;P&gt;Novinosrin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think you are on to something. The OLD table I am using is an excel import. Could that be why the formats are coming up as different?&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 15:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466497#M285154</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-31T15:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466500#M285155</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It combined both tables and just added the N but not the Y&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No it didn't, there are Y and N in the files.&lt;/P&gt;
&lt;P&gt;Run the exact code as posted and you get Y and N.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If it's not matching your data, then that means your data does not match the demo data.&lt;/STRONG&gt; You can run proc contents on the data sets and compare the information - variable, types and formats to make sure the match.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 15:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466500#M285155</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-31T15:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466515#M285156</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;Ok, Now it's time for us to know the data and metadata(data about data) . Can you find out&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. do both the old and new tables have the same variables and types(char and numeric)&lt;/P&gt;&lt;P&gt;2. you could run proc contents to find that out&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 15:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466515#M285156</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-31T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466557#M285157</link>
      <description>&lt;P&gt;Novinosrins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It was mentioned to me that instead of importing the previous months excel report, that I just run that report in SAS so I dont have to import. I did that and now I have just a few lines that give the error previously mentioned and i think I know why. In the middle stages of my code I add a few columns to my final table. I think I need to do those steps AFTER I do the steps that you recommended. I am going to give that a shot and let you know how that works out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 17:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466557#M285157</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-31T17:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466559#M285158</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114971"&gt;@wheddingsjr&lt;/a&gt;&amp;nbsp;Ok, some progress after all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I reiterate the logic in both approaches:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.Hash&amp;nbsp; : takes in all vars as key i.e each record makes in unique&lt;/P&gt;&lt;P&gt;2. sql : set operators&amp;nbsp; same as above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In essence we compare record to record&lt;/P&gt;&lt;P&gt;hash.check=0 finds it&amp;nbsp; as the same as intersect when we choose all vars as key&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore,if one var is not the same (any additional), both approaches will fail.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 17:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466559#M285158</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-31T17:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Month Over Month Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466578#M285159</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;All I have to say is that you are a genius. Everything worked out absolutely perfect. Because I just wrote the previous months data into my code and moved your union, intersect, except code further up in the script, I was able to include my add-on columns later in the process. I manually did this at the beginning of the month and just compared it with the new automated process and they are identical. Thank you very very much for your patience and your desire to help me. It is much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 18:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-Month-Over-Month-Datasets/m-p/466578#M285159</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2018-05-31T18:27:48Z</dc:date>
    </item>
  </channel>
</rss>

