<?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: Simple Date Informat Question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108248#M258696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use the informats you mention.&amp;nbsp; Any other informat length may lead to undesired results, like in my example.&amp;nbsp; However, SAS is fairly intelligent and tries to make things work out for you even if you don't use the right informat, or if you have a situation where your data is messy and sometimes it is 2001-01-01 and sometimes it is 010101.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Oct 2013 16:02:13 GMT</pubDate>
    <dc:creator>snoopy369</dc:creator>
    <dc:date>2013-10-09T16:02:13Z</dc:date>
    <item>
      <title>Simple Date Informat Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108245#M258693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone. this is likely a very stupid question, but I cannot figure out why this is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I have a datafile which has dates in the format YYYYMMDD&amp;nbsp; so 20130110&amp;nbsp; for October 1st 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I read it in with an informat of YYMMDD8.&amp;nbsp; it works, however if I also read it in with the informat of YYMMDD10. it works. (noted a different users code doing this and I thought it was an error at first).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had always thought you needed back-slashes within your dates to allow YYMMDD10. to work with these dates. This appears to not be true, can anyone explain why this is?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly enough, even if I just specify YYMMDD.&amp;nbsp; with no distinct value this works... So If I was going to read in a date that was in YYYYMMDD format, but I did not know if it was going to have back-slashes or not, wouldn't I want to always specify the YYMMDD anyways?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108245#M258693</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-10-09T15:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Date Informat Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108246#M258694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope Oct 01 2013 would be 20131001 for YYMMDD? Using YYMMDD10 will take 10 characters and then attempt to convert using the YYMMDD informat.&amp;nbsp; So, if you only have 8, it will still work.&amp;nbsp; If you are reading from a text file and have two unrelated characters following those 8, it will look at those and try to make a date out of that (2013100178 or something) and fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108246#M258694</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-10-09T15:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Date Informat Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108247#M258695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the issue i'm having it, how does the system know that ALL of the following variables (all within one column) work for the yymmdd10. information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20110105&lt;/P&gt;&lt;P&gt;110105&lt;/P&gt;&lt;P&gt;2011-01-05&lt;/P&gt;&lt;P&gt;2011/01/05.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of these work, even though the second one is a true YYMMDD and the first one is a YYYYMMDD.&amp;nbsp; the other ones have identifiers within them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was always taught that to read in the first one, you would have to specify YYMMDD8. and the third and fourth would require a YYMMDD10. Apparently that's just not the case!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i'm assuming the system informat has code underneath that says "IF X variable long" then do following.&lt;/P&gt;&lt;P&gt;If x=10 then YYYY_mm_DD (where _ are any given delimiter).&lt;/P&gt;&lt;P&gt;If x=8 then YYYYMMDD&amp;nbsp; No delimiter.&lt;/P&gt;&lt;P&gt;IF x=6 then YYMMDD. &lt;/P&gt;&lt;P&gt;ENd;&lt;BR /&gt;ELSE invalid:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay well that's good to know that sas is actually more dynamic that I was originally told (and sas books) say it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks (and if my above statments are not correct, please let me know)!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 15:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108247#M258695</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-10-09T15:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Date Informat Question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108248#M258696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use the informats you mention.&amp;nbsp; Any other informat length may lead to undesired results, like in my example.&amp;nbsp; However, SAS is fairly intelligent and tries to make things work out for you even if you don't use the right informat, or if you have a situation where your data is messy and sometimes it is 2001-01-01 and sometimes it is 010101.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 16:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-Date-Informat-Question/m-p/108248#M258696</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2013-10-09T16:02:13Z</dc:date>
    </item>
  </channel>
</rss>

