<?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: Date function with only month and year? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346802#M258841</link>
    <description>What day?&lt;BR /&gt;Just use 1&lt;BR /&gt;Every month has 1&lt;BR /&gt;Pun intended</description>
    <pubDate>Mon, 03 Apr 2017 18:51:24 GMT</pubDate>
    <dc:creator>PatrickCuba</dc:creator>
    <dc:date>2017-04-03T18:51:24Z</dc:date>
    <item>
      <title>Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/109943#M258837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi I'm trying to create a new variable using a month and year variable. I believe I should use the format Monyy7. but I am not sure what function to use. Typically I would use MDY ( Month, Day, Year).... but I do not have the day so I am a bit stumpped especially since MY (Month, year) does not work. See the example below....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data female;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data female;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date = MDY (Month, day, year);&amp;nbsp;&amp;nbsp;&amp;nbsp; --------&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt; ????date = MY (month, year)?????&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;format Date monyy7.;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format Date monyy7.;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 17:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/109943#M258837</guid>
      <dc:creator>branbran</dc:creator>
      <dc:date>2012-12-28T17:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/109944#M258838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case of this, you will have to artificially plug in a day number: data=mdy(month,1,year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: more clarification: if you let SAS to choose base on your limited information, SAS will pick the first day of the month:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; month=7; year=2012;&lt;/P&gt;&lt;P&gt; date1=input(catx('-',month,year),ANYDTDTE.);&lt;/P&gt;&lt;P&gt; date2=mdy(month,1,year);&lt;/P&gt;&lt;P&gt; put "date1=" date1 date9. "&amp;nbsp; date2=" date2 date9.;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2012 17:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/109944#M258838</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-12-28T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346747#M258839</link>
      <description>&lt;P&gt;this is the exact problem i am having now except I want sas to choose the end of the month. Im working with gdp time series data that is the total for the month at the end of the month. I plan to put them into proc expand to get them to daily and calculate a moving average so if sas assumes the 1st day that will mess me up. why cant they do date=my(month,year)&amp;nbsp;? i tried exactly what the original poster tried bc that would have been so logical &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 16:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346747#M258839</guid>
      <dc:creator>Josie1</dc:creator>
      <dc:date>2017-04-03T16:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346774#M258840</link>
      <description>&lt;P&gt;nevermind. your original solution looks like it works for me instead of data9. format i used &lt;SPAN&gt;yymmn6.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 17:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346774#M258840</guid>
      <dc:creator>Josie1</dc:creator>
      <dc:date>2017-04-03T17:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346802#M258841</link>
      <description>What day?&lt;BR /&gt;Just use 1&lt;BR /&gt;Every month has 1&lt;BR /&gt;Pun intended</description>
      <pubDate>Mon, 03 Apr 2017 18:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346802#M258841</guid>
      <dc:creator>PatrickCuba</dc:creator>
      <dc:date>2017-04-03T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date function with only month and year?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346804#M258842</link>
      <description>I got it to give me the dates in YYYYMM using the original solution that was there. But Im using a gdp data series where the observations represent the total at the end of the month. Im trying to convert from end of month monthly observations to daily in proc expand now that I have them in the right format&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Apr 2017 18:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-function-with-only-month-and-year/m-p/346804#M258842</guid>
      <dc:creator>Josie1</dc:creator>
      <dc:date>2017-04-03T18:55:15Z</dc:date>
    </item>
  </channel>
</rss>

