<?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: compare values based on a unique identifier in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723829#M224689</link>
    <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;! this worked out great for me. Just a follow up question that I'm still trying to wrap my head around:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) how does creating a unique sort key (_seqno) prior to the proc sql help me achieve the desired output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 10:42:40 GMT</pubDate>
    <dc:creator>nanmz</dc:creator>
    <dc:date>2021-03-05T10:42:40Z</dc:date>
    <item>
      <title>compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723141#M224351</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still pretty much new to SAS and would appreciate any sort of guidance/pointers from the experts here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset that looks like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;A1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;B1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;C1&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.15&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.165&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;promo2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main aim is to flag (0 or 1) for rows where if their IDs are the same and having the same values in column C1, same values in column B1 &lt;STRONG&gt;BUT&amp;nbsp;&lt;/STRONG&gt;having different values in column A1, to be flagged as 1. Thus, the output that I'm looking for would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;B1&lt;/TD&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;Flag&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;0.15&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.12&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;promo1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;0.165&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;promo2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD&gt;0.18&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;promo2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "incorrect" values/rows to be flagged are of those highlighted in red.&amp;nbsp; I initially wanted to transpose the column from long to wide and have the table to be unique based on their ID. However the duplicate IDs have up to 60+ rows hence I feel that it is not as efficient having hundreds of columns that I might not even use. Is there any other alternative in approaching this? Would appreciate any form of input.&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 13:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723141#M224351</guid>
      <dc:creator>nanmz</dc:creator>
      <dc:date>2021-03-03T13:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723148#M224352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;This can be done with&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lepg&amp;amp;docsetTarget=p181g1p4bw3phkn1vt5p67xvynd5.htm&amp;amp;locale=en" target="_self"&gt;FIRST. and LAST. DATA Step Variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Although I'm not clear on what you are attempting to achieve. I don't understand why flag=1 in rows 2 &amp;amp; 7&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;ID&lt;/TD&gt;
&lt;TD width="52px"&gt;A1&lt;/TD&gt;
&lt;TD width="40px"&gt;B1&lt;/TD&gt;
&lt;TD width="66px"&gt;C1&lt;/TD&gt;
&lt;TD width="43px"&gt;Flag&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;a&lt;/TD&gt;
&lt;TD width="52px"&gt;0.12&lt;/TD&gt;
&lt;TD width="40px"&gt;30&lt;/TD&gt;
&lt;TD width="66px"&gt;promo1&lt;/TD&gt;
&lt;TD width="43px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#00FF00"&gt;b&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="52px"&gt;&lt;FONT color="#00FF00"&gt;0.12&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#00FF00"&gt;30&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="66px"&gt;&lt;FONT color="#00FF00"&gt;promo1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="43px"&gt;&lt;FONT color="#00FF00"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;b&lt;/TD&gt;
&lt;TD width="52px"&gt;&lt;FONT color="#FF0000"&gt;0.15&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;30&lt;/TD&gt;
&lt;TD width="66px"&gt;promo1&lt;/TD&gt;
&lt;TD width="43px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;b&lt;/TD&gt;
&lt;TD width="52px"&gt;0.12&lt;/TD&gt;
&lt;TD width="40px"&gt;30&lt;/TD&gt;
&lt;TD width="66px"&gt;promo1&lt;/TD&gt;
&lt;TD width="43px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;b&lt;/TD&gt;
&lt;TD width="52px"&gt;0.18&lt;/TD&gt;
&lt;TD width="40px"&gt;40&lt;/TD&gt;
&lt;TD width="66px"&gt;promo2&lt;/TD&gt;
&lt;TD width="43px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;c&lt;/TD&gt;
&lt;TD width="52px"&gt;0.12&lt;/TD&gt;
&lt;TD width="40px"&gt;30&lt;/TD&gt;
&lt;TD width="66px"&gt;promo1&lt;/TD&gt;
&lt;TD width="43px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#00FF00"&gt;c&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="52px"&gt;&lt;FONT color="#00FF00"&gt;0.18&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;&lt;FONT color="#00FF00"&gt;40&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="66px"&gt;&lt;FONT color="#00FF00"&gt;promo2&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="43px"&gt;&lt;FONT color="#00FF00"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;c&lt;/TD&gt;
&lt;TD width="52px"&gt;&lt;FONT color="#FF0000"&gt;0.165&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px"&gt;40&lt;/TD&gt;
&lt;TD width="66px"&gt;promo2&lt;/TD&gt;
&lt;TD width="43px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40px"&gt;c&lt;/TD&gt;
&lt;TD width="52px"&gt;0.18&lt;/TD&gt;
&lt;TD width="40px"&gt;40&lt;/TD&gt;
&lt;TD width="66px"&gt;
&lt;P&gt;promo2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="43px"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 14:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723148#M224352</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2021-03-03T14:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723174#M224365</link>
      <description>&lt;P&gt;You input test tables are each 9 observations.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;By comparing each possible pair of the two tables observations the output contains more observations then you posted as wanted:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table1;
  infile cards dlm='0920'x truncover;
  input ID $ A1 B1 c1 $;
cards;
a	0.12	30	promo1
b	0.12	30	promo1
b	0.15	30	promo1
b	0.12	30	promo1
b	0.18	40	promo2
c	0.12	30	promo1
c	0.18	40	promo2
c	0.165	40	promo2
c	0.18	40	promo2
;run;
data table2;
  infile cards dlm='0920'x truncover;
  input ID $ A1 B1 c1 $;
cards;
a	0.12	30	promo1	
b	0.12	30	promo1	
b	0.15	30	promo1	
b	0.12	30	promo1	
b	0.18	40	promo2	
c	0.12	30	promo1	
c	0.18	40	promo2	
c	0.165	40	promo2	
c	0.18	40	promo2  
;run;
proc sql;
  create table want as
  select a.*,
  case when (a.a1 ne b.a1) 
      then 1 else 0 end as flag 
  from table1 as a
  left join table2 as b
  on (a.ID=b.ID and a.c1=b.c1 and a.b1=b.b1);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;AS for the first compare method mentioned:&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 15:26:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723174#M224365</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-03-03T15:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723176#M224367</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/370510"&gt;@nanmz&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this to obtain your desired result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data */

data have;
input ID $ A1 B1 C1 $;
cards;
a 0.12 30 promo1
b 0.12 30 promo1
b 0.15 30 promo1
b 0.12 30 promo1
b 0.18 40 promo2
c 0.12 30 promo1
c 0.18 40 promo2
c 0.165 40 promo2
c 0.18 40 promo2
;

/* Create a unique sort key */

data _tmp / view=_tmp;
set have;
_seqno=_n_;
run;

/* Flag groups of observations with inconsistent A1 values */

proc sql;
create table want(drop=_seqno) as
select *, count(distinct A1)&amp;gt;1 as Flag
from _tmp
group by ID, B1, C1
order by _seqno;
drop view _tmp;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 15:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723176#M224367</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-03T15:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723829#M224689</link>
      <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;! this worked out great for me. Just a follow up question that I'm still trying to wrap my head around:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) how does creating a unique sort key (_seqno) prior to the proc sql help me achieve the desired output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 10:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723829#M224689</guid>
      <dc:creator>nanmz</dc:creator>
      <dc:date>2021-03-05T10:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723830#M224690</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I wanted to flag rows 2 and 7 as well because they belong in the same group (i.e. rows 2,3, and 4 are in the same group, rows 7, 8 and 9 are in the same group as well). My goal is to find inaccuracies in column A1 in terms of their value as I don't have an external lookup table that would be able to map column A1, B1 and C1 respectively.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 10:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723830#M224690</guid>
      <dc:creator>nanmz</dc:creator>
      <dc:date>2021-03-05T10:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: compare values based on a unique identifier</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723839#M224693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/370510"&gt;@nanmz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;! this worked out great for me. Just a follow up question that I'm still trying to wrap my head around:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) how does creating a unique sort key (_seqno) prior to the proc sql help me achieve the desired output?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome. I introduced the sort key just to ensure that the sort order of WANT is the same as that of HAVE. If there's another suitable sort key&amp;nbsp;in your real data, you can use it instead of &lt;FONT face="courier new,courier"&gt;_seqno&lt;/FONT&gt; (and omit the intermediate DATA step). Also, if you don't care about the sort order of WANT, you can omit everything related to &lt;FONT face="courier new,courier"&gt;_seqno&lt;/FONT&gt; as well and thus simplify the code and reduce run time.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 11:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-values-based-on-a-unique-identifier/m-p/723839#M224693</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-05T11:05:30Z</dc:date>
    </item>
  </channel>
</rss>

