<?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 Addressing value if criteria met in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Addressing-value-if-criteria-met-in-data-step/m-p/605481#M175737</link>
    <description>&lt;P&gt;Attempting to create a new variable in a data step called top breed based on a breed column in previous data set. Data in breed column of old data varies, ie English Bulldog, American Bulldog, Labrador Mix, Labrador Retriever, Jack Russel Terrier, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to write if then index code so that if breed contains Bulldog, Lab, Terrier, Beagle, or Shepherd topbreed = 1. If not 0. I have only been able to figure out the the coding for one breed I am trying to assign a value for. Is there any ways to add multiple if then index clauses within the same data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data new variable;&lt;/P&gt;&lt;P&gt;set old variables;&lt;/P&gt;&lt;P&gt;if index(breed, 'Bulldog') then topbreed = 1;&lt;/P&gt;&lt;P&gt;else topbreed = 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to get: if index(breed, 'Bulldog', 'Lab', 'Terrier', 'Shepherd', 'Beagle') then .... with no success&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 18:26:11 GMT</pubDate>
    <dc:creator>cpmcn19</dc:creator>
    <dc:date>2019-11-19T18:26:11Z</dc:date>
    <item>
      <title>Addressing value if criteria met in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Addressing-value-if-criteria-met-in-data-step/m-p/605481#M175737</link>
      <description>&lt;P&gt;Attempting to create a new variable in a data step called top breed based on a breed column in previous data set. Data in breed column of old data varies, ie English Bulldog, American Bulldog, Labrador Mix, Labrador Retriever, Jack Russel Terrier, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to write if then index code so that if breed contains Bulldog, Lab, Terrier, Beagle, or Shepherd topbreed = 1. If not 0. I have only been able to figure out the the coding for one breed I am trying to assign a value for. Is there any ways to add multiple if then index clauses within the same data step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data new variable;&lt;/P&gt;&lt;P&gt;set old variables;&lt;/P&gt;&lt;P&gt;if index(breed, 'Bulldog') then topbreed = 1;&lt;/P&gt;&lt;P&gt;else topbreed = 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to get: if index(breed, 'Bulldog', 'Lab', 'Terrier', 'Shepherd', 'Beagle') then .... with no success&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 18:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Addressing-value-if-criteria-met-in-data-step/m-p/605481#M175737</guid>
      <dc:creator>cpmcn19</dc:creator>
      <dc:date>2019-11-19T18:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Addressing value if criteria met in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Addressing-value-if-criteria-met-in-data-step/m-p/605492#M175745</link>
      <description>This is still related to your previous question which is not marked as solved. Is there some reason you chose to open a new question? It helps to keep the discussion together so others know what's already been suggested.&lt;BR /&gt;&lt;BR /&gt;In general though, with cleaning data and data that's fuzzy it's a bit of an interative approach. Things you need to consider, which you currently are not, are case differences, spelling differences, partial matches, and fuzzy matching - which is likely what you need. I suspect using LIKE in a SQL query may be more efficient overall but less accurate.</description>
      <pubDate>Tue, 19 Nov 2019 19:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Addressing-value-if-criteria-met-in-data-step/m-p/605492#M175745</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-19T19:00:54Z</dc:date>
    </item>
  </channel>
</rss>

