<?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 Problem using yymmdd11. informat in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11462#M1072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1='2011-AUG-12';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date2=input(date1,anydtdte11.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;format date2 mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2011 18:23:08 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2011-12-09T18:23:08Z</dc:date>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11458#M1068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a text variable containg dates in the format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YYYY-MMM-DD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2011-FEB-14&lt;/P&gt;&lt;P&gt;2002-SEP-22&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to convert these to SAS dates using input statement but get invalid data message for the INPUT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on how to get this working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1='2011-AUG-12';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date2=input(date1,yymmdd11.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 12:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11458#M1068</guid>
      <dc:creator>slolay</dc:creator>
      <dc:date>2011-12-09T12:50:19Z</dc:date>
    </item>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11459#M1069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know of a format, but you can write a function to make a SAS date value out of the string, see sample below:&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;fcmp&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;outlib&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=work.myFunctions.dates;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; xDate( date $);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; dlm $ &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dlm = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"-"&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year = scan(date, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, dlm);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; month = scan(date, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;2&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, dlm);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; day = scan(date, &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;3&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, dlm);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newDate = cats(day, month, year);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newDate_N = input(newDate, &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;(newDate_N);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;endsub&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;options&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cmplib&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;=(work.myFunctions)&lt;BR /&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; testFunction;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; date1 = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;'2011-AUG-12'&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; date2 = xDate(date1);&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; date2 &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;date9.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 15:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11459#M1069</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2011-12-09T15:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11460#M1070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about: &lt;/P&gt;&lt;P&gt;data test;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1='2011-AUG-12';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date2=input(substr(date1,10,2)||substr(date1,6,3)||substr(date1,1,4),date9.); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put date1= date2= ; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 16:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11460#M1070</guid>
      <dc:creator>jcheema</dc:creator>
      <dc:date>2011-12-09T16:28:32Z</dc:date>
    </item>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11461#M1071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anydtdte11.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 18:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11461#M1071</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-09T18:07:00Z</dc:date>
    </item>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11462#M1072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date1='2011-AUG-12';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date2=input(date1,anydtdte11.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;format date2 mmddyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2011 18:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11462#M1072</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-12-09T18:23:08Z</dc:date>
    </item>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11463#M1073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - does the job!...now to read up on it......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 11:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11463#M1073</guid>
      <dc:creator>slolay</dc:creator>
      <dc:date>2011-12-12T11:05:28Z</dc:date>
    </item>
    <item>
      <title>Problem using yymmdd11. informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11464#M1074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not a lot to look up on it (&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002605538.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002605538.htm&lt;/A&gt;), but the anydtdte informat appears to be able to read dates that give all of the other date informats problems.&amp;nbsp; A useful system option to supplement it is the:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options datestyle=mdy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in order to guide the informat regarding the order of the three date parts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 13:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-yymmdd11-informat/m-p/11464#M1074</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-12T13:55:51Z</dc:date>
    </item>
  </channel>
</rss>

