<?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 covert character mmddyy to numeric ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568189#M159890</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;have pointed out, MMDDYY10. is the correct informat in this situation.&lt;/P&gt;
&lt;P&gt;However, if in doubt, you can use the ANYDTDTE&lt;EM&gt;w&lt;/EM&gt;. informat with a sufficiently long &lt;EM&gt;w&lt;/EM&gt;, which is quite darn good at recognizing various character date patterns with a garden variety of delimiters used. For example, run this step for a demo:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;                                            
  retain dlmstr " ~!#$%^&amp;amp;*()-_=+[]{}\|;:.&amp;lt;&amp;gt;?" ;          
  length cdate $ 10 ;                                    
  do i = 1 to length (dlmstr) ;                          
    cdate = catx (char (dlmstr, i), "09", "11", "2001") ;
    ndate = input (cdate, anydtdte10.) ;                 
    put cdate ndate yymmdd10. ;                          
  end ;                                                  
run ;                                                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jun 2019 05:45:47 GMT</pubDate>
    <dc:creator>hashman</dc:creator>
    <dc:date>2019-06-23T05:45:47Z</dc:date>
    <item>
      <title>How to covert character mmddyy to numeric ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568114#M159865</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to convert&amp;nbsp;character mmddyy to numeric, here is my data :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;03/31/1980 (format$10)&lt;/P&gt;&lt;P&gt;06/30/1980&lt;/P&gt;&lt;P&gt;12/31/1980&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try my best to convert it to YYMMDDN8. , but it still doesn't work. I hope that somebody could help me to solve this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 09:25:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568114#M159865</guid>
      <dc:creator>YuWeiLee</dc:creator>
      <dc:date>2019-06-22T09:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert character mmddyy to numeric ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568116#M159866</link>
      <description>&lt;P&gt;You have an MDY order in the date, so use the mmddyy10. informat.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 09:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568116#M159866</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-22T09:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert character mmddyy to numeric ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568118#M159867</link>
      <description>You must create a new variable:&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;newvar = input(date, mmddyy10.) ;&lt;BR /&gt;format newvar yymmddn8.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;If you want to keep the original variable name, you could add:&lt;BR /&gt;&lt;BR /&gt;drop date;&lt;BR /&gt;RENAME newvar = date;</description>
      <pubDate>Sat, 22 Jun 2019 11:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568118#M159867</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-22T11:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to covert character mmddyy to numeric ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568189#M159890</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;have pointed out, MMDDYY10. is the correct informat in this situation.&lt;/P&gt;
&lt;P&gt;However, if in doubt, you can use the ANYDTDTE&lt;EM&gt;w&lt;/EM&gt;. informat with a sufficiently long &lt;EM&gt;w&lt;/EM&gt;, which is quite darn good at recognizing various character date patterns with a garden variety of delimiters used. For example, run this step for a demo:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_ ;                                            
  retain dlmstr " ~!#$%^&amp;amp;*()-_=+[]{}\|;:.&amp;lt;&amp;gt;?" ;          
  length cdate $ 10 ;                                    
  do i = 1 to length (dlmstr) ;                          
    cdate = catx (char (dlmstr, i), "09", "11", "2001") ;
    ndate = input (cdate, anydtdte10.) ;                 
    put cdate ndate yymmdd10. ;                          
  end ;                                                  
run ;                                                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 05:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-covert-character-mmddyy-to-numeric/m-p/568189#M159890</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-06-23T05:45:47Z</dc:date>
    </item>
  </channel>
</rss>

