<?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: If Then Statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687367#M208660</link>
    <description>&lt;P&gt;&amp;nbsp;So if encounter 1 has dates 10jan2019 and 30 jan2019, and encounter 2 has dates&amp;nbsp;25jan2020 and 20feb2020, is that still NEWVAR=2 ?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 00:21:51 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-09-29T00:21:51Z</dc:date>
    <item>
      <title>If Then Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687361#M208657</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abcd;
input id date encounter;
cards;
1 09APR2012 1
1 11APR2012 1
1 26AUG2012 2
2 10MAY2015 1
2 15AUG2015 2
2 20AUG2015 2
2 02JAN2016 3
2 17MAR2016 4
3 12DEC2013 1
3 18JAN2014 2
4 09SEP2013 1&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have this dataset that has ID, Date, and encounter. If the dates are within 30 days apart, the encounter remains the same encounter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to say something like "if the person exists only once and has only one encounter, then newvar = 1"&lt;/P&gt;
&lt;P&gt;I also want to say "if the person exists multiple times and only has three or less encounters AND those three encounters occur within the same year (365 days), then newvar2 = 1"&lt;/P&gt;
&lt;P&gt;I also want to say "if the person exists multiple times and has three or more encounters AND those encounters occur within mutiple years, then newvar3 = 1"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not entirely sure where to start.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 22:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687361#M208657</guid>
      <dc:creator>mar0000</dc:creator>
      <dc:date>2020-09-28T22:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687367#M208660</link>
      <description>&lt;P&gt;&amp;nbsp;So if encounter 1 has dates 10jan2019 and 30 jan2019, and encounter 2 has dates&amp;nbsp;25jan2020 and 20feb2020, is that still NEWVAR=2 ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 00:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687367#M208660</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-29T00:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: If Then Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687424#M208682</link>
      <description>&lt;P&gt;Please fix your data step, so that it creates correct data.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statements/m-p/687424#M208682</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-29T06:23:41Z</dc:date>
    </item>
  </channel>
</rss>

