<?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 to create a data set with all days of a month? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80948#M23343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Art!&lt;/P&gt;&lt;P&gt;your code works great after changing " format all days start end mmddyy10.;" to "format alldays start end mmddyy10.;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 04:28:26 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2012-04-12T04:28:26Z</dc:date>
    <item>
      <title>How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80943#M23338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables,start date and end date ,I want to create a data set with allthe dates between those two variables.please let me know how to create it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 02:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80943#M23338</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-04-12T02:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80944#M23339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Given the sample data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input date date9. v1;&lt;/P&gt;&lt;P&gt;format date date9.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;05jan2012 1&lt;/P&gt;&lt;P&gt;25jan2012 2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;two options: 1) simpler approach, if you have ETS:&lt;/P&gt;&lt;P&gt;proc timeseries data=have out=want;&lt;/P&gt;&lt;P&gt;id date interval=day;&lt;/P&gt;&lt;P&gt;var v1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) If you don't have ETS:&lt;/P&gt;&lt;P&gt;data want (drop=_:);&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;set have (firstobs=2 keep=date rename=date=_date)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; have (obs=1 drop=_all_);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;do while (intck('day',date,_date)&amp;gt;1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing (v1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date=intnx('day',date,1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 02:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80944#M23339</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-04-12T02:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80945#M23340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;informat start mmddyy10. end mmddyy10.;&lt;/P&gt;&lt;P&gt;format start mmddyy10. end mmddyy10.;&lt;/P&gt;&lt;P&gt;input id start end ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 01/05/2012 01/20/2012&lt;/P&gt;&lt;P&gt;2 02/05/2012 02/10/2012&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(drop=i);&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;do i=1 to (end-start);&lt;/P&gt;&lt;P&gt;days=intnx('day',start,i,'s');&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;format days mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 03:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80945#M23340</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-04-12T03:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80946#M23341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input startdate enddate;&lt;/P&gt;&lt;P&gt;informat startdate enddate date9.;&lt;/P&gt;&lt;P&gt;format startdate enddate date9.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;01jan2012 15jan2012&lt;/P&gt;&lt;P&gt;01feb2012 05feb2012&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set one;&lt;/P&gt;&lt;P&gt;x=intck('day',startdate,enddate);&lt;/P&gt;&lt;P&gt;do i =1 to x;&lt;/P&gt;&lt;P&gt;y=intnx('day',enddate,-i);&lt;/P&gt;&lt;P&gt;output;format y date9.;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop x i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 03:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80946#M23341</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-04-12T03:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80947#M23342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Using Linlin's data, why not something as simple as (untested):&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; informat start end mmddyy10.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; format allindays start end mmddyy10.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; input id start end ;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; do alldays=start to end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;1 01/05/2012 01/20/2012&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;2 02/05/2012 02/10/2012&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 03:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80947#M23342</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-12T03:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80948#M23343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Art!&lt;/P&gt;&lt;P&gt;your code works great after changing " format all days start end mmddyy10.;" to "format alldays start end mmddyy10.;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 04:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80948#M23343</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-04-12T04:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a data set with all days of a month?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80949#M23344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fixed!&amp;nbsp; Thanks for spotting it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 12:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-a-data-set-with-all-days-of-a-month/m-p/80949#M23344</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-12T12:27:46Z</dc:date>
    </item>
  </channel>
</rss>

