<?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: Changing month-year variable from character to date format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461606#M117446</link>
    <description>&lt;P&gt;A month and a year is not enough to convert to a SAS date.&amp;nbsp; Dates in SAS refer to a specific day.&amp;nbsp; If you are willing to use the first day of the month, you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdate = input( cats(aamn, '01', aayear), mmddyy8.);&lt;/P&gt;
&lt;P&gt;format sasdate yymmdd10.;&lt;/P&gt;</description>
    <pubDate>Fri, 11 May 2018 16:36:54 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-05-11T16:36:54Z</dc:date>
    <item>
      <title>Changing month-year variable from character to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461596#M117441</link>
      <description>&lt;P&gt;I &lt;EM&gt;concatenate&lt;/EM&gt; separate month and year variables into a single month-year variable, but the resulting variable is in a character format. I am trying to convert that into a SAS date variable to be able to &lt;EM&gt;calculate&lt;/EM&gt; intervals with other date variables.&lt;/P&gt;&lt;P&gt;I am successful in the first step, but unable to get the month-year variable into a SAS date format. Below are the error I am getting and the SAS output. Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Data two;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set one;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date=cats(aamn, aayear);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put date= ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format date mmyy7.; run;&amp;nbsp;&lt;/P&gt;&lt;P&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;&lt;/P&gt;&lt;P&gt;ERROR 48-59: The format $MMYYS was not found or could not be loaded.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;AAMN&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;AAYEAR&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;32003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2003&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12003&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2003&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 11 May 2018 16:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461596#M117441</guid>
      <dc:creator>ama220</dc:creator>
      <dc:date>2018-05-11T16:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing month-year variable from character to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461606#M117446</link>
      <description>&lt;P&gt;A month and a year is not enough to convert to a SAS date.&amp;nbsp; Dates in SAS refer to a specific day.&amp;nbsp; If you are willing to use the first day of the month, you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdate = input( cats(aamn, '01', aayear), mmddyy8.);&lt;/P&gt;
&lt;P&gt;format sasdate yymmdd10.;&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 16:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461606#M117446</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-05-11T16:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Changing month-year variable from character to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461616#M117452</link>
      <description>&lt;P&gt;or maybe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdate= mdy(aamn,1,aayear);&lt;/P&gt;
&lt;P&gt;format sasdate mmyyd.;&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 16:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/461616#M117452</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-11T16:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Changing month-year variable from character to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/462081#M117567</link>
      <description>&lt;P&gt;Thank you, your code worked for me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 15:20:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/462081#M117567</guid>
      <dc:creator>ama220</dc:creator>
      <dc:date>2018-05-14T15:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing month-year variable from character to date format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/462086#M117572</link>
      <description>&lt;P&gt;Thanks, your code is great. Because I needed to limit to the month and year, I found the other code more appreciate to my needs. I really appreciate your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 15:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-month-year-variable-from-character-to-date-format/m-p/462086#M117572</guid>
      <dc:creator>ama220</dc:creator>
      <dc:date>2018-05-14T15:22:58Z</dc:date>
    </item>
  </channel>
</rss>

