<?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 read all dates formats values from rawfile ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80259#M256602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amir's proposed solution is pretty much your only hope. If somehow one of your date format isn't supported by the anydate format used, or (and you should spend some verification time on this) messes up years and days for some format, you are pretty much bound to importing them as character, creating a custom solution with a series of if covering all the different formats in your dataset to input them into a new numeric date variable with the proper format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*edit* If you have 6-digit dates that are always of the same form mdy, dym, ydm etc., look for the DATESTYLE= system option with your anydtdte format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jul 2013 12:16:56 GMT</pubDate>
    <dc:creator>Vince28_Statcan</dc:creator>
    <dc:date>2013-07-16T12:16:56Z</dc:date>
    <item>
      <title>how to read all dates formats values from rawfile ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80257#M256600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;input date &lt;STRONG&gt;forma&lt;/STRONG&gt;t;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;24/12/1990&lt;/P&gt;&lt;P&gt;24dec1990&lt;/P&gt;&lt;P&gt;12/24/1990&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 08:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80257#M256600</guid>
      <dc:creator>Paari</dc:creator>
      <dc:date>2013-07-16T08:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to read all dates formats values from rawfile ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80258#M256601</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;Have you tried using the &lt;SPAN style="font-family: 'courier new', courier;"&gt;anydtdte&lt;/SPAN&gt; format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#n04jh1fkv5c8zan14fhqcby7jsu4.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/63324/HTML/default/viewer.htm#n04jh1fkv5c8zan14fhqcby7jsu4.htm"&gt;SAS(R) 9.3 Formats and Informats: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;input date anydtdte10.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 11:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80258#M256601</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-07-16T11:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to read all dates formats values from rawfile ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80259#M256602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amir's proposed solution is pretty much your only hope. If somehow one of your date format isn't supported by the anydate format used, or (and you should spend some verification time on this) messes up years and days for some format, you are pretty much bound to importing them as character, creating a custom solution with a series of if covering all the different formats in your dataset to input them into a new numeric date variable with the proper format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*edit* If you have 6-digit dates that are always of the same form mdy, dym, ydm etc., look for the DATESTYLE= system option with your anydtdte format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 12:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80259#M256602</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-07-16T12:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to read all dates formats values from rawfile ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80260#M256603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have data as in your example:&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;input date &lt;STRONG&gt;forma&lt;/STRONG&gt;t;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;24/12/1990&lt;/P&gt;&lt;P&gt;12/24/1990&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How will you know the meaning of 07/03/1990 ? Any of the month/day 01 to 12 will be extemely problematical as to accuracy when the month/day and day/month is not entered with a fixed standard pattern.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 17:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80260#M256603</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-07-16T17:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to read all dates formats values from rawfile ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80261#M256604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;If there is really a case where YMD/DMY etc. can be different, then anydtdte won't work and you are stuck with a custom solution. That is, reading them as a string, using a bunch of ifs with substring or prx and using input(var, properformat.). Sadly though if there is no additionnal variable to allow to distinguish 03/07/1990 from 07/03/1990, there really isn't anything that you can do nor that SAS can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, in theory, anydtdte can still read all dates. It will read unambiguous dates (like 24/12/1990 vs 12/24/1990) properly but will use whatever the DATESTYLE= system option is set to for all ambiguous cases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jul 2013 18:37:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-read-all-dates-formats-values-from-rawfile/m-p/80261#M256604</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-07-16T18:37:01Z</dc:date>
    </item>
  </channel>
</rss>

