<?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: Generating Days of the Month in a Dataset Given Year and Month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668370#M200334</link>
    <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Glad to help&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 13:53:45 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-07-10T13:53:45Z</dc:date>
    <item>
      <title>Generating Days of the Month in a Dataset Given Year and Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668358#M200329</link>
      <description>&lt;P&gt;Suppose I have two global macro variables called year and month that a user can change as need (or automatically set). I would like SAS to automatically create a dataset that has one variable called date and it will populate all the days on the month. So if year was set to 2020 and month was set to 5, then the dataset would be automatically created with all the days for May (31 of them) as YYMMDDS8. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668358#M200329</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-10T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Days of the Month in a Dataset Given Year and Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668359#M200330</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let year = 2020;
%let month = 5;

data want;
    do dt = mdy(&amp;amp;month, 1, &amp;amp;year) by 1 while (month(dt)=&amp;amp;month);
       output;
    end;
    format dt yymmdds8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668359#M200330</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-10T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Days of the Month in a Dataset Given Year and Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668362#M200331</link>
      <description>&lt;P&gt;nice!&amp;nbsp; You original worked as well (I modified it to my needs...posted below for others).&amp;nbsp; Thanks for both!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let year = 2020;
%let month = 2;

data egtask.DATE_LIST;
   do DATE = intnx('month', mdy(&amp;amp;month, 1, &amp;amp;year), 0, 'b') to 
      intnx('month', mdy(&amp;amp;month, 1, &amp;amp;year), 0, 'e');
         output;
   end;
   format DATE yymmdds8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668362#M200331</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2020-07-10T13:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Days of the Month in a Dataset Given Year and Month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668370#M200334</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Glad to help&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 13:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-Days-of-the-Month-in-a-Dataset-Given-Year-and-Month/m-p/668370#M200334</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-10T13:53:45Z</dc:date>
    </item>
  </channel>
</rss>

