<?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 How to change YYYYMM to YYYYMMDD where DD is the last day of the month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759475#M240018</link>
    <description>&lt;P&gt;So I have this code that defines a variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Inc_Start = &amp;amp;&amp;amp;&amp;amp;Inc_Start_YYYY..&amp;amp;Inc_Start_MM;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whenever I use this, the variable works exactly as it should and I get the exact YYYYMM. However I want to be able to actually get YYYYMMDD where the DD is just the last day of the month. I currently am trying something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Inc_Start = %sysfunc(intnx(month, &amp;amp;&amp;amp;&amp;amp;Inc_Start_YYYY..&amp;amp;Inc_Start_MM, 0, e));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But this gives me the following log output:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;87         %PUT &amp;amp;Inc_Start;
SYMBOLGEN:  Macro variable INC_START resolves to 202130&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see that is YYYYDD and it skips the MM inbetween them! Any ideas? Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 19:51:48 GMT</pubDate>
    <dc:creator>mhoward2</dc:creator>
    <dc:date>2021-08-04T19:51:48Z</dc:date>
    <item>
      <title>How to change YYYYMM to YYYYMMDD where DD is the last day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759475#M240018</link>
      <description>&lt;P&gt;So I have this code that defines a variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Inc_Start = &amp;amp;&amp;amp;&amp;amp;Inc_Start_YYYY..&amp;amp;Inc_Start_MM;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Whenever I use this, the variable works exactly as it should and I get the exact YYYYMM. However I want to be able to actually get YYYYMMDD where the DD is just the last day of the month. I currently am trying something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Inc_Start = %sysfunc(intnx(month, &amp;amp;&amp;amp;&amp;amp;Inc_Start_YYYY..&amp;amp;Inc_Start_MM, 0, e));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But this gives me the following log output:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;87         %PUT &amp;amp;Inc_Start;
SYMBOLGEN:  Macro variable INC_START resolves to 202130&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see that is YYYYDD and it skips the MM inbetween them! Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759475#M240018</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-08-04T19:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to change YYYYMM to YYYYMMDD where DD is the last day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759481#M240019</link>
      <description>&lt;P&gt;So you first need to convert the YYYYMM to a SAS date before you can use it in the INTNX function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Inc_Start = &amp;amp;&amp;amp;&amp;amp;Inc_Start_YYYY..&amp;amp;Inc_Start_MM;
%let inc_start = %sysfunc(intnx(month,%sysfunc(inputn(&amp;amp;inc_start.,yymmn6.)),0,e),yymmddn8.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Untested, posted from my tablet.&lt;/P&gt;
&lt;P&gt;For tested code, we would need to know the contents of the macro variables you use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 20:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759481#M240019</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-04T20:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change YYYYMM to YYYYMMDD where DD is the last day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759493#M240021</link>
      <description>Thank you very much! I greatly appreciate the help!</description>
      <pubDate>Wed, 04 Aug 2021 20:13:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-YYYYMM-to-YYYYMMDD-where-DD-is-the-last-day-of-the/m-p/759493#M240021</guid>
      <dc:creator>mhoward2</dc:creator>
      <dc:date>2021-08-04T20:13:01Z</dc:date>
    </item>
  </channel>
</rss>

