<?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: creating a dummy variable based on a list of elements in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215889#M5213</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Xia, your posts are very helpful, (as well as the posts of the other users)!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually tried to do this myself and even experimented with prxmatch, but even the smallest syntax inaccuracy can make the whole code not work (or work in an unintended way ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 May 2015 13:02:44 GMT</pubDate>
    <dc:creator>ilikesas</dc:creator>
    <dc:date>2015-05-17T13:02:44Z</dc:date>
    <item>
      <title>creating a dummy variable based on a list of elements</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215887#M5211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suppose that I have the folllowing table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid rgb(0, 0, 0); width: 535px; height: 113px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;text&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;The banks and financial companies&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;The bankers association&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;First bank of England&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;financial banking institutions&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If either the element "banks" or "financial" is present in an entry, then the new dummy variable =1, else 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the table should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="150" style="border: 1px solid rgb(0, 0, 0); width: 681px; height: 152px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;text&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;The banks and financial companies&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;The bankers association&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;First bank of England&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;financial banking institutions&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 02:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215887#M5211</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2015-05-17T02:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: creating a dummy variable based on a list of elements</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215888#M5212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input text &amp;amp; $50.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;The banks and financial companies&lt;/P&gt;&lt;P&gt;The bankers association&lt;/P&gt;&lt;P&gt;First bank of England&lt;/P&gt;&lt;P&gt;financial banking institutions&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; if prxmatch('/\bbanks\b|\bfinancial\b/i',text) then dummy=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else dummy=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 05:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215888#M5212</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-05-17T05:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: creating a dummy variable based on a list of elements</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215889#M5213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Xia, your posts are very helpful, (as well as the posts of the other users)!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually tried to do this myself and even experimented with prxmatch, but even the smallest syntax inaccuracy can make the whole code not work (or work in an unintended way ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 May 2015 13:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/creating-a-dummy-variable-based-on-a-list-of-elements/m-p/215889#M5213</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2015-05-17T13:02:44Z</dc:date>
    </item>
  </channel>
</rss>

