<?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 convert character MM/YYYY into date format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345757#M79593</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One follow up question - I tried to do this in one statement:&lt;/P&gt;&lt;P&gt;date1=input(date, mmyy10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the error message says "The informat MMYY was not fuond or could not be loaded."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up having to do this in two statements:&lt;/P&gt;&lt;P&gt;&amp;nbsp; date1=input(date,anydtdte7.);&lt;BR /&gt;&amp;nbsp; format date1 mmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why can't the input function accept mmyy10.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 14:24:58 GMT</pubDate>
    <dc:creator>dyxdyx</dc:creator>
    <dc:date>2017-03-30T14:24:58Z</dc:date>
    <item>
      <title>how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345594#M79512</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to convert a character variable (called Month_Year) into a date variable. It has a MM/YYYY format, e.g. 06/1986 corresponds to June 1986.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following statements but didn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;informat Month_Year mmyys10.;&lt;/P&gt;&lt;P&gt;Date = input(Month_Year, mmyys10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 00:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345594#M79512</guid>
      <dc:creator>dyxdyx</dc:creator>
      <dc:date>2017-03-30T00:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345601#M79515</link>
      <description>&lt;P&gt;The following will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
  input cdate $;
  cards;
06/1986
;

data want;
  set have;
  format date date9.;
  date=input(cdate,anydtdte7.);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 00:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345601#M79515</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-30T00:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345741#M79582</link>
      <description>&lt;P&gt;Hi art297,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Your code works but with a small problem - it added a day value to MM/YYYY.&amp;nbsp; e.g. it turned 06/1986 into 01JUN1986. Is it possible to convert into a date variable that has only month and year (no day) info in SAS? Does SAS have a date format that only has info on month and year?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 13:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345741#M79582</guid>
      <dc:creator>dyxdyx</dc:creator>
      <dc:date>2017-03-30T13:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345749#M79587</link>
      <description>&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#n19j5sob71nsa0n1lw9h53q3tfex.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#n19j5sob71nsa0n1lw9h53q3tfex.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 14:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345749#M79587</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-30T14:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345757#M79593</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One follow up question - I tried to do this in one statement:&lt;/P&gt;&lt;P&gt;date1=input(date, mmyy10.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the error message says "The informat MMYY was not fuond or could not be loaded."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up having to do this in two statements:&lt;/P&gt;&lt;P&gt;&amp;nbsp; date1=input(date,anydtdte7.);&lt;BR /&gt;&amp;nbsp; format date1 mmyy10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why can't the input function accept mmyy10.?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 14:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345757#M79593</guid>
      <dc:creator>dyxdyx</dc:creator>
      <dc:date>2017-03-30T14:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345764#M79596</link>
      <description>&lt;P&gt;You can't have a date without a day. &amp;nbsp;You can attach a format that only show the year and the month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;101  data _null_;
102    date = '01JUN1986'd ;
103    do fmt = 'YYMMDD10.','YYMM7.','YYMMS7.','MMYY7.','MMYYS7.';
104       str=putn(date,fmt);
105       put fmt= str= ;
106    end;
107  run;

fmt=YYMMDD10. str=1986-06-01
fmt=YYMM7. str=1986M06
fmt=YYMMS7. str=1986/06
fmt=MMYY7. str=06M1986
fmt=MMYYS7. str=06/1986
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2017 14:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345764#M79596</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-30T14:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345765#M79597</link>
      <description>&lt;P&gt;The assignment statement and the FORMAT statement are doing differnt things. The first is setting the value of a variable and the second is changing the metadata about the variable.&lt;/P&gt;
&lt;P&gt;You still need to use a FORMAT statement if you want to attach a format to a variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no INFORMAT named MMYY. &amp;nbsp;That is why you need to use the ANYDTDTE. informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 14:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345765#M79597</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-30T14:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert character MM/YYYY into date format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345980#M79685</link>
      <description>&lt;P&gt;Thanks! This makes sense.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 21:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-character-MM-YYYY-into-date-format/m-p/345980#M79685</guid>
      <dc:creator>dyxdyx</dc:creator>
      <dc:date>2017-03-30T21:45:57Z</dc:date>
    </item>
  </channel>
</rss>

