<?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 working on dates functionality in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786540#M251150</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i have given a code like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data acl;&lt;/P&gt;&lt;P&gt;x=ceil(0.55);&lt;/P&gt;&lt;P&gt;y=floor(1.30);&lt;/P&gt;&lt;P&gt;z=round(1959.896);&lt;/P&gt;&lt;P&gt;d= put(mdy(x,y,z)+365,date9.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I am getting the output with these values:&lt;/P&gt;&lt;P&gt;x=1 y=1 z=1960 z=31dec1960&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But why I am getting z value with in the same year even though i have given +365 days so this would result me with the value that is incremented to next year.&lt;/P&gt;&lt;P&gt;Kindly help me if I am missing anything here.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2021 18:11:13 GMT</pubDate>
    <dc:creator>meena_gowtham</dc:creator>
    <dc:date>2021-12-17T18:11:13Z</dc:date>
    <item>
      <title>working on dates functionality</title>
      <link>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786540#M251150</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i have given a code like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data acl;&lt;/P&gt;&lt;P&gt;x=ceil(0.55);&lt;/P&gt;&lt;P&gt;y=floor(1.30);&lt;/P&gt;&lt;P&gt;z=round(1959.896);&lt;/P&gt;&lt;P&gt;d= put(mdy(x,y,z)+365,date9.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I am getting the output with these values:&lt;/P&gt;&lt;P&gt;x=1 y=1 z=1960 z=31dec1960&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But why I am getting z value with in the same year even though i have given +365 days so this would result me with the value that is incremented to next year.&lt;/P&gt;&lt;P&gt;Kindly help me if I am missing anything here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 18:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786540#M251150</guid>
      <dc:creator>meena_gowtham</dc:creator>
      <dc:date>2021-12-17T18:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: working on dates functionality</title>
      <link>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786541#M251151</link>
      <description>&lt;P&gt;Leap years, 1960 is a leap year with 366 days, which is why you get Dec 31st.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  data acl;

x=ceil(0.55);

y=floor(1.30);

z=round(1959.896);

d= put(mdy(x,y,z)+365,date9.);

d2 = intnx('year', mdy(x, y, z), 1, 's');
format d2 date9.;

d3 = d2;
format d3 ddmmyys10.;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/409880"&gt;@meena_gowtham&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;i have given a code like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data acl;&lt;/P&gt;
&lt;P&gt;x=ceil(0.55);&lt;/P&gt;
&lt;P&gt;y=floor(1.30);&lt;/P&gt;
&lt;P&gt;z=round(1959.896);&lt;/P&gt;
&lt;P&gt;d= put(mdy(x,y,z)+365,date9.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I am getting the output with these values:&lt;/P&gt;
&lt;P&gt;x=1 y=1 z=1960 z=31dec1960&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why I am getting z value with in the same year even though i have given +365 days so this would result me with the value that is incremented to next year.&lt;/P&gt;
&lt;P&gt;Kindly help me if I am missing anything here.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 18:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786541#M251151</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-17T18:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: working on dates functionality</title>
      <link>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786542#M251152</link>
      <description>&lt;P&gt;If you want to increment by a YEAR then tell SAS to do that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;d_string= put(intnx('year',mdy(x,y,z),1,'s'),date9.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Dec 2021 18:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/working-on-dates-functionality/m-p/786542#M251152</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-17T18:32:29Z</dc:date>
    </item>
  </channel>
</rss>

