<?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 Premature termination reading a text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77817#M16872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to read a file with 6.7M records, but my data step quits after only 105k with no errors.&amp;nbsp; There are control codes in the file that convinces SAS that the file has ended.&amp;nbsp; The file is an exported .csv file from the RapidSQL query tool on the same platform (WinXP, SAS 9.2).&amp;nbsp; (FYI, when I tried to read the data directly from the server via ODBC, it got stuck.&amp;nbsp; It ran overnight; I killed it and got no results.)&amp;nbsp; I can import the first million rows into excel, and, indeed it contains a funny character in the line that SAS stopped on.&amp;nbsp; It's character hex 1A, which is ctrl-z, the EOF character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q: Can control characters be cleaned out using SAS?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The (vastly simplified) code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data blah ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "textfile.csv" lrecl=32767 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An excerpt from the log:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The infile "&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile.csv&lt;/SPAN&gt;" is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=C:\Projects\xxx\&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile.csv&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=32767,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File Size (bytes)=962846799,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=16Jan2013:13:19:58,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=16Jan2013:13:04:55&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: 105454 records were read from the infile "&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile&lt;/SPAN&gt;.csv".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 128.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 146.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jan 2013 15:34:43 GMT</pubDate>
    <dc:creator>jdmarino</dc:creator>
    <dc:date>2013-01-17T15:34:43Z</dc:date>
    <item>
      <title>Premature termination reading a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77817#M16872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to read a file with 6.7M records, but my data step quits after only 105k with no errors.&amp;nbsp; There are control codes in the file that convinces SAS that the file has ended.&amp;nbsp; The file is an exported .csv file from the RapidSQL query tool on the same platform (WinXP, SAS 9.2).&amp;nbsp; (FYI, when I tried to read the data directly from the server via ODBC, it got stuck.&amp;nbsp; It ran overnight; I killed it and got no results.)&amp;nbsp; I can import the first million rows into excel, and, indeed it contains a funny character in the line that SAS stopped on.&amp;nbsp; It's character hex 1A, which is ctrl-z, the EOF character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q: Can control characters be cleaned out using SAS?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The (vastly simplified) code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data blah ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "textfile.csv" lrecl=32767 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An excerpt from the log:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The infile "&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile.csv&lt;/SPAN&gt;" is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=C:\Projects\xxx\&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile.csv&lt;/SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=32767,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File Size (bytes)=962846799,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=16Jan2013:13:19:58,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=16Jan2013:13:04:55&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: 105454 records were read from the infile "&lt;SPAN style="font-family: 'courier new', courier;"&gt;textfile&lt;/SPAN&gt;.csv".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 128.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 146.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 15:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77817#M16872</guid>
      <dc:creator>jdmarino</dc:creator>
      <dc:date>2013-01-17T15:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Premature termination reading a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77818#M16873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried including the ignoredoseof option in your infile statement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 15:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77818#M16873</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-01-17T15:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Premature termination reading a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77819#M16874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked!&amp;nbsp; SAS is such a multi-headed monster, "it takes a village" (this community) to tame it.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 15:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Premature-termination-reading-a-text-file/m-p/77819#M16874</guid>
      <dc:creator>jdmarino</dc:creator>
      <dc:date>2013-01-17T15:54:06Z</dc:date>
    </item>
  </channel>
</rss>

