<?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: dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912079#M359609</link>
    <description>&lt;P&gt;The&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1anshj9oarqccn15eulfy9mnszl.htm" target="_blank" rel="noopener"&gt;MONYY&lt;/A&gt;&amp;nbsp;format is for date values. SAS date values are&amp;nbsp;&lt;STRONG&gt;counts of days&lt;/STRONG&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jan 2024 08:51:21 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2024-01-19T08:51:21Z</dc:date>
    <item>
      <title>dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912073#M359605</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where put(B.MONYYYY,MONYY7.)=put(a.default_mth+1,MONYY7.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in this command does 1 means add one month?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 08:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912073#M359605</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2024-01-19T08:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912074#M359606</link>
      <description>&lt;P&gt;1 DAY&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input MONYYYY : date9. default_mth : date9.;
*format MONYYYY default_mth monyy7.;
cards;
21FEB2024 20FEB2024
;
run;

data want;
 set have;
 where put(/*B.*/MONYYYY,MONYY7.)=put(/*a.*/default_mth+1,MONYY7.);
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 08:16:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912074#M359606</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-01-19T08:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912079#M359609</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1anshj9oarqccn15eulfy9mnszl.htm" target="_blank" rel="noopener"&gt;MONYY&lt;/A&gt;&amp;nbsp;format is for date values. SAS date values are&amp;nbsp;&lt;STRONG&gt;counts of days&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 08:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912079#M359609</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-19T08:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912088#M359612</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where put(B.MONYYYY,MONYY7.)=put(a.default_mth+1,MONYY7.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in this command does 1 means add one month?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You've got already the answer that +1 adds one day to a SAS date value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The comparison then first writes the SAS date values as a string using a format that prints month and year. So what this selection logic obviously is doing is to only select rows where both dates are within the same month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way to write this expression would be:&lt;/P&gt;
&lt;PRE&gt;where intck('month',B.MONYYYY, a.default_mth+1)=0&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 11:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dates/m-p/912088#M359612</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-19T11:06:17Z</dc:date>
    </item>
  </channel>
</rss>

