<?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: date+1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799797#M314528</link>
    <description>&lt;P&gt;A SAS Date is an integer. So adding 1 will give you the next day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The put statement converts the numeric SAS variable into character.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 10:55:15 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-03-03T10:55:15Z</dc:date>
    <item>
      <title>date+1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799795#M314526</link>
      <description>&lt;P&gt;what does&lt;/P&gt;&lt;P&gt;put(fdate+1,date9.) mean?&lt;/P&gt;&lt;P&gt;what does it mean to add 1 here?&lt;/P&gt;&lt;P&gt;say fdate is 31Aug2021&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 10:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799795#M314526</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-03-03T10:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: date+1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799797#M314528</link>
      <description>&lt;P&gt;A SAS Date is an integer. So adding 1 will give you the next day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The put statement converts the numeric SAS variable into character.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 10:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799797#M314528</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-03-03T10:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: date+1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799826#M314550</link>
      <description>&lt;P&gt;Assuming fdate is a date value (i.e. number of days since 01jan1960), then to represent 31aug2021, the underlying value of date is 22523.&amp;nbsp; That can be revealed by running this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   fdate='31aug2021'd;
   put fdate=;
   put fdate=date9. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which generates this log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;6761  data _null_;
6762    fdate='31aug2021'd;
6763    put fdate=;
6764    put fdate=date9.;
6765  run;

fdate=22523
fdate=31AUG2021
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But you ask about the put function (unlike the put statements above).&amp;nbsp; AS&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;says, it calculates the first argument (i.e. adding 1 to the value 22523, getting 22524), and converts it to a character string using the date9. format, yielding the character "01sep2021":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  fdate='31aug2021'd;
  z=put(fdate+1,date9.);
  put z=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run these programs and take a look at the log.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 12:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799826#M314550</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2022-03-03T12:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: date+1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799838#M314555</link>
      <description>&lt;P&gt;Here's the documentation links with good examples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0mlfb88dkhbmun1x08qbh5xbs7e.htm" target="_self"&gt;PUT Function&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/basess/p0er6damfbjifwn1ih1b1tacw5zj.htm" target="_self"&gt;Working with Dates in the SAS System&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 13:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-1/m-p/799838#M314555</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-03-03T13:39:20Z</dc:date>
    </item>
  </channel>
</rss>

