<?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: Recode new variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573228#M161799</link>
    <description>&lt;P&gt;Thank you. This works.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 21:45:53 GMT</pubDate>
    <dc:creator>aowais</dc:creator>
    <dc:date>2019-07-12T21:45:53Z</dc:date>
    <item>
      <title>Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573199#M161785</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a variable from two others which should be missing if both are missing, '1' if both are '1' and '0' otherwise. I know how to do this in longhand (see below), but is there a shorter way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data two; set one;&lt;/P&gt;&lt;P&gt;if var1 = . and var2 = . then new_var = .;&lt;/P&gt;&lt;P&gt;else if var1 = 1 and var2 = 1 then new_var = 1;&lt;/P&gt;&lt;P&gt;else new_var = 0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 19:45:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573199#M161785</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-07-12T19:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573202#M161787</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if coalesce(var1,var2)&amp;gt;. then new_var=var1=var2=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jul 2019 19:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573202#M161787</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-12T19:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573214#M161792</link>
      <description>Same answer as your previous question here:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Recode-multiple-variables/m-p/573178" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Recode-multiple-variables/m-p/573178&lt;/A&gt;</description>
      <pubDate>Fri, 12 Jul 2019 20:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573214#M161792</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T20:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573227#M161798</link>
      <description>&lt;P&gt;I tried that, but it didn't work.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 21:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573227#M161798</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-07-12T21:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573228#M161799</link>
      <description>&lt;P&gt;Thank you. This works.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 21:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573228#M161799</guid>
      <dc:creator>aowais</dc:creator>
      <dc:date>2019-07-12T21:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recode new variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573230#M161800</link>
      <description>Do you understand the calculations happening there? You may want to look into IFN() as well, especially for dealing with a single variable, which has a fourth(or 5th) parameter to deal with MISSING.</description>
      <pubDate>Fri, 12 Jul 2019 21:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recode-new-variable/m-p/573230#M161800</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-12T21:49:26Z</dc:date>
    </item>
  </channel>
</rss>

