<?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: How to go through all IDs in a datset to flag those records that match a value in another variab in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542022#M149759</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID1 $ ID2 $;
cards;
A       B       1
B       A       1
C      G      0
E       .         0
F      H       0
;

proc sql;
create table want as
select a.*,(a.id1=b.id2) as Flag
from have a left join have b
on a.id1=b.id2;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Mar 2019 14:11:18 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2019-03-11T14:11:18Z</dc:date>
    <item>
      <title>How to go through all IDs in a datset to flag those records that match a value in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542017#M149758</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I Have a data set which has 2 Ids values: ID1 and ID2. I would like to set a flag for all the records where ID2 in ne record is ID1 in another record and vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID1&amp;nbsp; ID2&amp;nbsp; FLAG&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;BR /&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; G&amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;E&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;F&amp;nbsp; &amp;nbsp; &amp;nbsp; H&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any Idea ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;KC&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 14:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542017#M149758</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2019-03-11T14:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to go through all IDs in a datset to flag those records that match a value in another variab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542022#M149759</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID1 $ ID2 $;
cards;
A       B       1
B       A       1
C      G      0
E       .         0
F      H       0
;

proc sql;
create table want as
select a.*,(a.id1=b.id2) as Flag
from have a left join have b
on a.id1=b.id2;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 14:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542022#M149759</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-11T14:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to go through all IDs in a datset to flag those records that match a value in another variab</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542030#M149761</link>
      <description>&lt;P&gt;thank you it worked. I was thinking about a loop or an array but this is easier.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 14:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-go-through-all-IDs-in-a-datset-to-flag-those-records-that/m-p/542030#M149761</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2019-03-11T14:32:29Z</dc:date>
    </item>
  </channel>
</rss>

