<?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: Create record per month in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-record-per-month/m-p/905152#M44005</link>
    <description>&lt;P&gt;This solution assumes that the values of startdate and enddate are valid numeric SAS date values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    startdate='03JAN2022'd;
    enddate='05MAY2022'd;
run;
data want;
    set have;
    diff_months=intck('month',startdate,enddate);
    do i=0 to diff_months;
        if i=0 then newcolumn=startdate;
        else if i=diff_months then newcolumn=enddate;
        else newcolumn=intnx('month',startdate,i,'e');
        output;
    end;
    drop i diff_months;
    format newcolumn date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Nov 2023 12:21:20 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-11-29T12:21:20Z</dc:date>
    <item>
      <title>Create record per month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-record-per-month/m-p/905140#M44004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a dataset that I want to split based on 2 date columns. In this new column, the date for the intervening months should become the last day of that month&lt;BR /&gt;Example;&lt;BR /&gt;Start date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enddate&lt;BR /&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;Start date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Enddate&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NewColumn&lt;BR /&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 03jan2022&lt;/P&gt;&lt;P&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 28feb2022&lt;/P&gt;&lt;P&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 31mar2022&lt;/P&gt;&lt;P&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30apr2022&lt;/P&gt;&lt;P&gt;03Jan2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;05may2022&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 05may2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 11:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-record-per-month/m-p/905140#M44004</guid>
      <dc:creator>Jaap_K</dc:creator>
      <dc:date>2023-11-29T11:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create record per month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-record-per-month/m-p/905152#M44005</link>
      <description>&lt;P&gt;This solution assumes that the values of startdate and enddate are valid numeric SAS date values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    startdate='03JAN2022'd;
    enddate='05MAY2022'd;
run;
data want;
    set have;
    diff_months=intck('month',startdate,enddate);
    do i=0 to diff_months;
        if i=0 then newcolumn=startdate;
        else if i=diff_months then newcolumn=enddate;
        else newcolumn=intnx('month',startdate,i,'e');
        output;
    end;
    drop i diff_months;
    format newcolumn date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Nov 2023 12:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-record-per-month/m-p/905152#M44005</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-11-29T12:21:20Z</dc:date>
    </item>
  </channel>
</rss>

