<?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 an 1/0 variable from a text using search words in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309375#M61241</link>
    <description>&lt;P&gt;Take a look at this:&amp;nbsp;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/index_function.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/index_function.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you could add: &amp;nbsp;If x &amp;gt; 0 then Expert=1; else Expert=0;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2016 18:33:55 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2016-11-04T18:33:55Z</dc:date>
    <item>
      <title>Creating an 1/0 variable from a text using search words</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309372#M61239</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset with the following information: firm_identifier, Year, Executive_Name, and Executive_biography. I want to create a new variable "Expert" that takes value 1 if the executive&amp;nbsp;has a law school degree, such as JD, LL.M., or LL.D., and/or has working experience as a lawyer at, for example, a law firm or as a legal counsel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any SAS code that could read the Executive_biography and create the variable? If so, can someone please share the code with me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The length of executive biographies varies: Some executives' bios are short (ten lines) while some have a long bio (almost a page long). Also the search words (&lt;SPAN&gt;JD, LL.M., LL.D.,&amp;nbsp;law firm or &amp;nbsp;legal counsel) can be placed anywhere in the bios. Also these search words can be in uppercase or lowercase.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;S&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 18:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309372#M61239</guid>
      <dc:creator>shalmali</dc:creator>
      <dc:date>2016-11-04T18:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an 1/0 variable from a text using search words</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309375#M61241</link>
      <description>&lt;P&gt;Take a look at this:&amp;nbsp;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/index_function.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/index_function.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, you could add: &amp;nbsp;If x &amp;gt; 0 then Expert=1; else Expert=0;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 18:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309375#M61241</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2016-11-04T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an 1/0 variable from a text using search words</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309595#M61249</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have a dataset with the following information: firm_identifier, Year, Executive_Name, and Executive_biography. I want to create a new variable "Expert" that takes value 1 if the executive&amp;nbsp;has a law school degree, such as JD, LL.M., or LL.D., and/or has working experience as a lawyer at, for example, a law firm or as a legal counsel.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using the following code to create Expert variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data Want;&lt;BR /&gt;set Have;&lt;BR /&gt;uline= upcase(&lt;SPAN&gt;Executive_b&lt;/SPAN&gt;iography);&lt;BR /&gt;if find(uline,"LL.M.") and find(uline,"JD") or find(uline,"LL.D.")or find(uline,"LAW FIRM")&lt;BR /&gt;or find(uline,"LEGAL COUNSEL")&lt;BR /&gt;then do;&lt;BR /&gt;Expert=1; &lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code creates&amp;nbsp;a new dataset where Expert =1. I want a dataset that has all the observations (i.e., Expert =1 and Expert =0). Can somebody please refine this code for me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your time.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;S&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 17:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309595#M61249</guid>
      <dc:creator>shalmali</dc:creator>
      <dc:date>2016-11-06T17:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an 1/0 variable from a text using search words</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309596#M61250</link>
      <description>&lt;P&gt;Thank you for the suggestion.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 17:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-an-1-0-variable-from-a-text-using-search-words/m-p/309596#M61250</guid>
      <dc:creator>shalmali</dc:creator>
      <dc:date>2016-11-06T17:10:54Z</dc:date>
    </item>
  </channel>
</rss>

