<?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: a date interval in if then statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728201#M28268</link>
    <description>&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if year(eksd)=2014 then ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Mar 2021 14:27:40 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-03-22T14:27:40Z</dc:date>
    <item>
      <title>a date interval in if then statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728193#M28265</link>
      <description>&lt;P&gt;Hi. So I am working on a hughe database on a secure server. why I can not copy-pasty codes into the browser.&lt;/P&gt;&lt;P&gt;anyways as I am working with health economics I need to multiply all results with a year factor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so for instance I made a variable totalmedicine I get a number and then if it comes from 2014 I have to multiply that number with 1.083 to get the equivalent amount in 2020. I have to do that for all years 2014-2019.&lt;/P&gt;&lt;P&gt;then I make a code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data allst3;&lt;/P&gt;&lt;P&gt;set all;&lt;/P&gt;&lt;P&gt;totalmedicin=eksp+tilpris;&lt;/P&gt;&lt;P&gt;if eksd &amp;gt;20131231 and eksd&amp;lt;20150101 then totalmedicin=totalmedicin*1.083;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And so on for all the years and factors&lt;/P&gt;&lt;P&gt;when I run the code with or without the if then statement I get the same results in totalmedicin, what am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728193#M28265</guid>
      <dc:creator>Jannie_D</dc:creator>
      <dc:date>2021-03-22T14:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: a date interval in if then statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728195#M28266</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if eksd &amp;gt;'31DEC2013'd and eksd&amp;lt;'01JAN2015'd then totalmedicin=totalmedicin*1.083;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The D after the quoted date indicates SAS should interpret this as an actual SAS date value. Of course, this assumes that EKSD is an actual SAS date value.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728195#M28266</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-22T14:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: a date interval in if then statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728198#M28267</link>
      <description>&lt;P&gt;...or the "SAS way"&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if '31DEC2013'd &amp;lt; eksd &amp;lt; '01JAN2015'd then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;B&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728198#M28267</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-03-22T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: a date interval in if then statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728201#M28268</link>
      <description>&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if year(eksd)=2014 then ...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Mar 2021 14:27:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/a-date-interval-in-if-then-statement/m-p/728201#M28268</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-22T14:27:40Z</dc:date>
    </item>
  </channel>
</rss>

