<?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: Maximum record length problem (LRECL in infile statement) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95584#M20123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;mkeintz - you were right, the problem was with the file (shame on me I didn't checked it earlier...). Once again many thanks for help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2012 12:00:35 GMT</pubDate>
    <dc:creator>ssomak</dc:creator>
    <dc:date>2012-08-22T12:00:35Z</dc:date>
    <item>
      <title>Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95579#M20118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi all,&lt;/P&gt;&lt;P&gt;I've got a problem with maximum record length. When I'm trying to create data set from external file in the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "path_to_my_file"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LRECL=22000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENCODING="UTF-8"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TERMSTR=CRLF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MISOVER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* columns here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS is setting maximum record length to 14977 - this is what I see in log:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTE: The infile "path_to_my_file" is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=path_to_my_file,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,&lt;STRONG&gt;LRECL=132006&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File Size (bytes)=103939281,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=02 sierpień 2012 14:38:59,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=02 sierpień 2012 14:38:36&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTE: 6939 records were read from the infile "path_to_my_file".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;The minimum record length was 14977.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 14977.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As noted above, LRECL is set to 132006 (instead of 22000 as I coded) and max record length is 14977.&lt;/P&gt;&lt;P&gt;Whats more, when I doing the same in SAS DI using &lt;EM&gt;'File-&amp;gt;New-&amp;gt;Fixed Width'&lt;/EM&gt; and setting 'Logical record length' to 22000, then, in code preview, LRECL is also set to 14977...&lt;/P&gt;&lt;P&gt;Anyone have some idea what's going on?&lt;/P&gt;&lt;P&gt;I will be grateful for any help.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Kamil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 11:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95579#M20118</guid>
      <dc:creator>ssomak</dc:creator>
      <dc:date>2012-08-16T11:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95580#M20119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The infile note is, I believe, constructed before actual data is processed (note the report on number of records encountered and .maximum/minimum lengths observed followed that note).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I suspect that the file was created as recfm=V and (maximum) lrecl of 132006.&amp;nbsp; At least that's how it might have been done in the old mainframe days: the file header would have had such metadata in it and SAS reports it.&amp;nbsp; Are you running SAS on z/OS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, when you set your LRECL to 22000, you were only telling SAS that 22000 is the maximum expected length (after all the record format is "V" - for "variable length").&amp;nbsp; After processing SAS reported that all the records turned out to be 14,977 bytes long, even though SAS was prepared for up to 22000 bytes and the operating system would have supported up to 132006 bytes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 12:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95580#M20119</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2012-08-16T12:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95581#M20120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which version of SAS are you on and with which operating system?&amp;nbsp; The following might be relevant:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/kb/37/173.html"&gt;http://support.sas.com/kb/37/173.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 12:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95581#M20120</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-08-16T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95582#M20121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;Thanks for your answers! Unfortunatelly I still don't know how to correctly import this file ('wide' .txt file). I'm using SAS 9.2 under Windows enviroment. Do you have any idea how should I implement data step to correctly import such a file?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Kamil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 07:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95582#M20121</guid>
      <dc:creator>ssomak</dc:creator>
      <dc:date>2012-08-17T07:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95583#M20122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You haven't identified the problem yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And note the LRECL has not been "set" by SAS to 14,977.&amp;nbsp; It already is that length (at least that's the distance between consecutive CRLF's in the input file) - SAS is just telling you about the incoming data.&amp;nbsp; If you are saying that input data ought to be 22,000 then you should confer with the person who created it, because it's short by 7,023. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that's not the issue, the you should tell us what the input data looks like, what you expected to produce, and what you got.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 14:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95583#M20122</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2012-08-17T14:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Maximum record length problem (LRECL in infile statement)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95584#M20123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;mkeintz - you were right, the problem was with the file (shame on me I didn't checked it earlier...). Once again many thanks for help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 12:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Maximum-record-length-problem-LRECL-in-infile-statement/m-p/95584#M20123</guid>
      <dc:creator>ssomak</dc:creator>
      <dc:date>2012-08-22T12:00:35Z</dc:date>
    </item>
  </channel>
</rss>

