<?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 create a dummy variable based on if the value in one column can be found in another one? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226948#M5439</link>
    <description>Thanks so much! It works very well!</description>
    <pubDate>Wed, 23 Sep 2015 18:31:58 GMT</pubDate>
    <dc:creator>tomtom09</dc:creator>
    <dc:date>2015-09-23T18:31:58Z</dc:date>
    <item>
      <title>How to create a dummy variable based on if the value in one column can be found in another one?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226838#M5431</link>
      <description>&lt;P&gt;Hi guys. I have two columns value1 and value2, in value1, say, I have three observations a, b, c, in value2, I have 4 observations a, a, b,m, I want to create a dummy variable match for each row in value1, if the value can be found in value 2, then match=1 otherwise it is 0. So for this dataset, it should be 1,1,0. Can anyone help me with this? Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 02:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226838#M5431</guid>
      <dc:creator>tomtom09</dc:creator>
      <dc:date>2015-09-23T02:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy variable based on if the value in one column can be found in another one?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226851#M5432</link>
      <description>&lt;P&gt;Data A;&lt;BR /&gt;&amp;nbsp; Input value1 $ value2 $;&lt;BR /&gt;&amp;nbsp; Datalines;&lt;BR /&gt;a a&lt;BR /&gt;b a&lt;BR /&gt;c b&lt;BR /&gt;. m&lt;BR /&gt;;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data B;&lt;BR /&gt;&amp;nbsp; If _N_ eq 1 Then Do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Declare Hash H (Dataset:'A (Drop=value1 Rename=(value2=value1)');&lt;BR /&gt;&amp;nbsp;H.Definekey('value1');&lt;BR /&gt;&amp;nbsp;H.Definedone();&lt;BR /&gt;&amp;nbsp;If 0 Then Set A (Drop=value1 Rename=(value2=value1));&lt;BR /&gt;&amp;nbsp; End;&lt;BR /&gt;&amp;nbsp; Set A;&lt;BR /&gt;&amp;nbsp; dummy=1-Min(H.Find(),1);&lt;BR /&gt;Run;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 07:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226851#M5432</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2015-09-23T07:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy variable based on if the value in one column can be found in another one?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226878#M5434</link>
      <description>&lt;P&gt;Use PROC GLMMOD to create dummy variables.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 12:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226878#M5434</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-09-23T12:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy variable based on if the value in one column can be found in another one?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226948#M5439</link>
      <description>Thanks so much! It works very well!</description>
      <pubDate>Wed, 23 Sep 2015 18:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226948#M5439</guid>
      <dc:creator>tomtom09</dc:creator>
      <dc:date>2015-09-23T18:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a dummy variable based on if the value in one column can be found in another one?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226949#M5440</link>
      <description>&lt;P&gt;Thanks PaigeMiller!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2015 18:32:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-create-a-dummy-variable-based-on-if-the-value-in-one/m-p/226949#M5440</guid>
      <dc:creator>tomtom09</dc:creator>
      <dc:date>2015-09-23T18:32:25Z</dc:date>
    </item>
  </channel>
</rss>

