<?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 How to read date from a txt file? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174063#M264513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to read date from a txt file?&lt;/P&gt;&lt;P&gt;am trying to read this way.But saw some errors&lt;/P&gt;&lt;P&gt;File4.txt&lt;/P&gt;&lt;P&gt;1 arun joy 12/6/1989&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data g;&lt;/P&gt;&lt;P&gt;infile 'H:\SasWorkSpace\File4.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input no @2 name $9.&amp;nbsp; @12 dob&amp;nbsp;&amp;nbsp; ddmmyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 06:56:58 GMT</pubDate>
    <dc:creator>KrishnaChandra</dc:creator>
    <dc:date>2014-07-10T06:56:58Z</dc:date>
    <item>
      <title>How to read date from a txt file?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174063#M264513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to read date from a txt file?&lt;/P&gt;&lt;P&gt;am trying to read this way.But saw some errors&lt;/P&gt;&lt;P&gt;File4.txt&lt;/P&gt;&lt;P&gt;1 arun joy 12/6/1989&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data g;&lt;/P&gt;&lt;P&gt;infile 'H:\SasWorkSpace\File4.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input no @2 name $9.&amp;nbsp; @12 dob&amp;nbsp;&amp;nbsp; ddmmyy10.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 06:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174063#M264513</guid>
      <dc:creator>KrishnaChandra</dc:creator>
      <dc:date>2014-07-10T06:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to read date from a txt file?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174064#M264514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your informat was incorrect.&amp;nbsp; Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data g;&lt;/P&gt;&lt;P&gt;infile 'e:\test\File4.txt';&lt;/P&gt;&lt;P&gt;input no @2 name $9.&amp;nbsp; @12 dob&amp;nbsp;&amp;nbsp; ddmmyy9.;&lt;/P&gt;&lt;P&gt;format dob date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 07:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174064#M264514</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-10T07:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to read date from a txt file?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174065#M264515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got output.Thank you so much for your valuable information.Am a beginner in SAS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 07:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174065#M264515</guid>
      <dc:creator>KrishnaChandra</dc:creator>
      <dc:date>2014-07-10T07:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to read date from a txt file?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174066#M264516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We all have to start somewhere. We are here to help when we can.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 07:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174066#M264516</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-07-10T07:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to read date from a txt file?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174067#M264517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would use a colon (:) modifier on the ddmmyy10. informat instead of changing the informat length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data g;&lt;/P&gt;&lt;P&gt;infile&amp;nbsp; 'e:\test\File4.txt';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;format dob date9.;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The colon basically allows SAS to stop processing as soon as it hits the space in position 10, and translate the string of 9 characters instead of expecting all 10. The problem with the simple solution of changing the format length is that if you have a date longer than that like 14/10/2014, only reading 9 characters will give you incorrect results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps your understanding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Derek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 17:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-date-from-a-txt-file/m-p/174067#M264517</guid>
      <dc:creator>cov_derek</dc:creator>
      <dc:date>2014-07-24T17:01:22Z</dc:date>
    </item>
  </channel>
</rss>

