<?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: Data step question: Line length including carriage returns and/or line feeds in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574400#M162295</link>
    <description>&lt;P&gt;The file is ascii. I can go into it with UltraEdit and read the text. I can't use Notepad++ as the file is over 1GB so Notepadd++ can't open it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I count the bytes and include the carriage return and line feeds. Can I include a count variable in the loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think every line has a line feed so I use that as the end of line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can experiment with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 23:03:48 GMT</pubDate>
    <dc:creator>JohnKeighley</dc:creator>
    <dc:date>2019-07-17T23:03:48Z</dc:date>
    <item>
      <title>Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574328#M162263</link>
      <description>&lt;P&gt;I am using SAS 9.4 M5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading a text file with approximately 700,000,000 lines of data as text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to know the number of bytes from beginning of the file to the current line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The application has been used in the Windows and Unix environments so one line might have a carriage return and line feed at the end while the next line only has a line feed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The application stores one variable per line so they are variable length records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lines vary in length from 0 bytes(no data) to 1950 bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I initially assumed that every line would have both characters so I added 2 to the length of every line and kept a running total.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, approximately 100,000,000 lines only have one character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has PHI so I can't post an example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code shown doesn't calculate the running total.The text string doesn't include the control characters and I don't know how to read the file and get a count with those characters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data pristine;&lt;BR /&gt;infile "R:\test\file1.txt" firstobs=2 truncover lrecl=2000 length=lv ignoredoseof;&lt;BR /&gt;input @1 v1 $varying2000. lv;&lt;BR /&gt;linelen=lv;&lt;BR /&gt;line=_n_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code gives me a length excluding special characters.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 18:59:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574328#M162263</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-17T18:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574364#M162275</link>
      <description>&lt;P&gt;Why not just ask the operating system how big the file is?&lt;/P&gt;
&lt;P&gt;Or read it as a binary file and count the number of bytes?&lt;/P&gt;
&lt;P&gt;or read it using TERMSTR=LF and add one byte per line?&amp;nbsp; You might need to remove CR's.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574364#M162275</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-17T21:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574368#M162277</link>
      <description>&lt;P&gt;This file has over 1,00,000 records in it of two lengths. 1001 lines for one type and 304 lines for the other type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pointers are used to jump to each record. Some of the pointers in the index file have been corrupted. I am trying to recover the pointers which is the physical location in the file in bytes counting the carriage returns and line feeds. I need to count every byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a record is saved multiple times they are daisy chained together in the file. Approximately 500 pointers have been corrupted. The data hasn't changed. Just lost the ability to look up the record from the application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't read any files using binary format. Can I convert it to bytes after reading it? From your reply I would say yes. Can you point me to some example code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574368#M162277</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-17T21:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574375#M162279</link>
      <description>&lt;P&gt;Sounds like the file actually is a binary file.&amp;nbsp; Does it really have CR and LF characters in it anyway?&lt;/P&gt;
&lt;P&gt;You can use the RECFM=N to read the file byte by byte.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile 'myfile' recfm=n ;
do row=1 by 1 until (ch='0A'x);
   do col=1 by 1 until (ch='0A'x);
      input ch $char1. ;
      output;
   end;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574375#M162279</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-17T21:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574400#M162295</link>
      <description>&lt;P&gt;The file is ascii. I can go into it with UltraEdit and read the text. I can't use Notepad++ as the file is over 1GB so Notepadd++ can't open it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I count the bytes and include the carriage return and line feeds. Can I include a count variable in the loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think every line has a line feed so I use that as the end of line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can experiment with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 23:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574400#M162295</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-17T23:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574406#M162299</link>
      <description>&lt;P&gt;Doesn't matter if most (or all) of the bytes are valid ASCII codes.&amp;nbsp; If it has "pointers" then it is a binary format.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 00:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574406#M162299</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T00:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574409#M162300</link>
      <description>&lt;P&gt;I haven't use pointers since 1991 so I can't say much about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running the code and it appears to be working. I will post an update on the results by tomorrow.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 00:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574409#M162300</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T00:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574578#M162386</link>
      <description>&lt;P&gt;This has worked very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574578#M162386</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T14:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574583#M162389</link>
      <description>&lt;P&gt;If there are enough LFs in the data so that no "line" is longer than 32K bytes then you can simplify the process if you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lines (compress=yes);
  retain startpos 0;
  infile 'myfile' termstr=lf length=ll end=eof;
  line_length=ll;
  input line $varying32767. line_length ;
  output;
  startpos + line_length + 1;
  if eof then put 'Total File length=' startpos;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574583#M162389</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T14:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574622#M162407</link>
      <description>&lt;P&gt;I only need the line number and length so I changed your code to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="5"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;infile&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;recfm&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;=n ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; row=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; (ch=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="5"&gt;'0A'x&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; col=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; (ch=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="5"&gt;'0A'x&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; ch &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;$char1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; _n_=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; line=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; _n_&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="5"&gt; and col=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="5"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; line+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="5"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="5"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; test1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;=linelen line);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; test(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;=(col=linelen));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; line;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="5"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt; last.line;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="5"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="5"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="5"&gt;With your new suggestion, on the lines that have a crlf would the cr be embedded in the text string?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 15:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574622#M162407</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T15:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574625#M162409</link>
      <description>&lt;P&gt;I should have accepted your earlier code as the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't realize that it would select my reply as the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First time I have done that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 15:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574625#M162409</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T15:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574739#M162457</link>
      <description>&lt;P&gt;Not sure why you added another variable LINE to replicate the ROW variable.&amp;nbsp; Perhaps it shouldn't have a DO loop?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile test recfm=n ;
  line+1;
  do col=1 by 1 until (ch='0A'x);
    input ch $char1. ;
    output;
  end;
run;
proc summary data=test;
  by line ;
  var col;
  output out=test1 max=linelen;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you read data with LF only as the end-of-line marker then CR is treated the same as any other character.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574739#M162457</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574741#M162458</link>
      <description>&lt;P&gt;Doesn't really matter, but you should be able to change the which answer you mark as the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574741#M162458</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-18T19:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574747#M162459</link>
      <description>&lt;P&gt;This is code that I ran on a small test file that I created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'c:\data\test.txt'&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;infile&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;recfm&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=n ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; row=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; (ch=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'0A'x&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; col=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; (ch=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New"&gt;'0A'x&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; ch &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New"&gt;$char1.&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; _n_=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; n=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; _n_&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt; and col=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; n+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=test (&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;obs&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=linelen line);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; test(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;=(col=linelen n=line));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; line;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; last.line;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New"&gt;freq&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New"&gt; linelen;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;I have attached the data file.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:32:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574747#M162459</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T19:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data step question: Line length including carriage returns and/or line feeds</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574758#M162462</link>
      <description>&lt;P&gt;I have attached the output after changing the proc freq from a one way to a two-way with /list missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note, the row&amp;nbsp; variable kept value of 1 for the entire file.&lt;/P&gt;&lt;P&gt;That is why I dropped the row variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 19:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-question-Line-length-including-carriage-returns-and-or/m-p/574758#M162462</guid>
      <dc:creator>JohnKeighley</dc:creator>
      <dc:date>2019-07-18T19:45:08Z</dc:date>
    </item>
  </channel>
</rss>

