<?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 Creating new variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538387#M148212</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a variable based on responses from another variable as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;KN2 = 1 and 2, or 3, or 8, AND&amp;nbsp;KN3 = 1, 2, or 3 then I2 = 1; esle I2 = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm using the following code:&lt;/P&gt;&lt;P&gt;if ((kn2 = 1 and kn2 = 2) or kn2 in (3,8)) and kn3 in (1:3) then i2 = 1;&lt;BR /&gt;else i2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way to write this code? Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Feb 2019 19:13:21 GMT</pubDate>
    <dc:creator>aowais</dc:creator>
    <dc:date>2019-02-25T19:13:21Z</dc:date>
    <item>
      <title>Creating new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538387#M148212</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a variable based on responses from another variable as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if&amp;nbsp;KN2 = 1 and 2, or 3, or 8, AND&amp;nbsp;KN3 = 1, 2, or 3 then I2 = 1; esle I2 = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I'm using the following code:&lt;/P&gt;&lt;P&gt;if ((kn2 = 1 and kn2 = 2) or kn2 in (3,8)) and kn3 in (1:3) then i2 = 1;&lt;BR /&gt;else i2 = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way to write this code? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 19:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538387#M148212</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-02-25T19:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538390#M148213</link>
      <description>How is it possible for kn2 to be both 1 and 2 at the same time?&lt;BR /&gt;&lt;BR /&gt;You may need to understand the requirements better.</description>
      <pubDate>Mon, 25 Feb 2019 19:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538390#M148213</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-25T19:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538393#M148215</link>
      <description>Thanks, yes I misread the requirement.</description>
      <pubDate>Mon, 25 Feb 2019 19:20:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538393#M148215</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-02-25T19:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538399#M148217</link>
      <description>&lt;P&gt;What is the correct requirement then?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 19:33:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538399#M148217</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-02-25T19:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538408#M148223</link>
      <description>&lt;P&gt;The question was multiple response, and data were entered as needed; i.e. KN2 = 1 if respondant answered with 1 AND 2, or 3 or 8; 0 otherwise.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 19:54:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variable/m-p/538408#M148223</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-02-25T19:54:26Z</dc:date>
    </item>
  </channel>
</rss>

