<?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: How can I create a time series field between two dates? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640368#M190729</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options yearcutoff=2000;
 
%let indate=01/01/18;
%let outmon=12/18;

data toto;
sdate=input("&amp;amp;indate",ddmmyy8.);
emon=input("01/&amp;amp;outmon",ddmmyy8.);
edate=intnx ('month',emon,0,'E');
days=edate-sdate;
do i=0 to days;
datest=sdate+i;
output;
end;
format datest ddmmyy8.;
keep datest;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;it is not optimal but it works&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;have a nice day.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 10:39:44 GMT</pubDate>
    <dc:creator>kelxxx</dc:creator>
    <dc:date>2020-04-16T10:39:44Z</dc:date>
    <item>
      <title>How can I create a time series field between two dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640354#M190721</link>
      <description>&lt;P&gt;I want to create a time series field between two dates such that there is only one entry for each month and the day in that entry is the last day of that specific month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For ex:-&lt;/P&gt;
&lt;P&gt;Input:-&lt;/P&gt;
&lt;P&gt;Start Date = 01/01/18 &amp;nbsp; &amp;nbsp;&amp;nbsp;End Date = 31/12/20&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:-&lt;/P&gt;
&lt;P&gt;31/01/18&lt;/P&gt;
&lt;P&gt;28/02/18&lt;/P&gt;
&lt;P&gt;31/03/18&lt;/P&gt;
&lt;P&gt;30/04/18&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;31/10/20&lt;/P&gt;
&lt;P&gt;30/11/20&lt;/P&gt;
&lt;P&gt;31/12/20&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 10:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640354#M190721</guid>
      <dc:creator>Saurabh_Rana</dc:creator>
      <dc:date>2020-04-16T10:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a time series field between two dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640363#M190724</link>
      <description>&lt;P&gt;Use the intnx() function to calculate your end-of-period values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;cur_date = intnx('month',start_date,0,'e');
do while (cur_date le end_date);
  output;
  cur_date = intnx('month',cur_date,1,'e');
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is, of course, assumed that start_date and end_date contain SAS date values.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 10:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640363#M190724</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-16T10:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a time series field between two dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640368#M190729</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options yearcutoff=2000;
 
%let indate=01/01/18;
%let outmon=12/18;

data toto;
sdate=input("&amp;amp;indate",ddmmyy8.);
emon=input("01/&amp;amp;outmon",ddmmyy8.);
edate=intnx ('month',emon,0,'E');
days=edate-sdate;
do i=0 to days;
datest=sdate+i;
output;
end;
format datest ddmmyy8.;
keep datest;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;it is not optimal but it works&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f5f5; color: rgba(0, 0, 0, 0.87); font-family: 'Roboto',arial,sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px;"&gt;have a nice day.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 10:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-create-a-time-series-field-between-two-dates/m-p/640368#M190729</guid>
      <dc:creator>kelxxx</dc:creator>
      <dc:date>2020-04-16T10:39:44Z</dc:date>
    </item>
  </channel>
</rss>

