<?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 if text contains certain words in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427495#M105448</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input col $50.;
datalines;
DEC16 Estimates do not reflect adoption
Mar17 Estimates reflect adoption
JUN15 Estimates do not reflect adoption
SEP17 Estimates reflect adoption
;

data want;
set have;
if findw(col,'Estimates do not reflect')&amp;gt;0 then dummy=1;
else if findw(col,'Estimates reflect')&amp;gt;0 then dummy=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 14 Jan 2018 02:15:41 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-01-14T02:15:41Z</dc:date>
    <item>
      <title>Creating a dummy variable if text contains certain words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427493#M105447</link>
      <description>&lt;P&gt;Dear SAS community:&lt;/P&gt;&lt;P&gt;I have a dataset and would like to create a column in my data that is a dummy variable equal to 1 if the text contains "Estimates do not reflect" and equal to 0 if the text is "Estimates reflect". How is this possible?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input col $50.;
datalines;
DEC16 Estimates do not reflect adoption
Mar17 Estimates reflect adoption
JUN15 Estimates do not reflect adoption
SEP17 Estimates reflect adoption
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Jan 2018 01:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427493#M105447</guid>
      <dc:creator>Agent1592</dc:creator>
      <dc:date>2018-01-14T01:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable if text contains certain words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427495#M105448</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input col $50.;
datalines;
DEC16 Estimates do not reflect adoption
Mar17 Estimates reflect adoption
JUN15 Estimates do not reflect adoption
SEP17 Estimates reflect adoption
;

data want;
set have;
if findw(col,'Estimates do not reflect')&amp;gt;0 then dummy=1;
else if findw(col,'Estimates reflect')&amp;gt;0 then dummy=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Jan 2018 02:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427495#M105448</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-14T02:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable if text contains certain words</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427496#M105449</link>
      <description>&lt;P&gt;find works--&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if find(col,'Estimates do not reflect')&amp;gt;0 then dummy=1;
else if find(col,'Estimates reflect')&amp;gt;0 then dummy=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Jan 2018 02:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-dummy-variable-if-text-contains-certain-words/m-p/427496#M105449</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-14T02:19:47Z</dc:date>
    </item>
  </channel>
</rss>

