<?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: infile strange text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188612#M35649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Bruno. It's perfect for what I need. Just I do not understand the use of the second &lt;SPAN style="color: #000000; font-family: Consolas; font-size: 15px; background-color: #ffffff;"&gt;@&lt;/SPAN&gt; in the first input statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 13:28:09 GMT</pubDate>
    <dc:creator>ciro</dc:creator>
    <dc:date>2014-02-27T13:28:09Z</dc:date>
    <item>
      <title>infile strange text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188609#M35646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear all,&lt;/P&gt;&lt;P&gt;I have to infile a text file like the one following.&lt;/P&gt;&lt;P&gt;At the moment I just need to have a dataset with one variable and one record for each row of the text file. So that following I can extract something from it (for instance I need all the codes following @I01)&lt;/P&gt;&lt;P&gt;I am not good with infile and input and my attempts have failed. I also tried to transform into excel and the import it into sas but without success.&lt;/P&gt;&lt;P&gt;any help is appreciated&lt;/P&gt;&lt;P&gt;thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;:R: John Smith, 999-7543,&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:John.Smith@gmail.com"&gt;John.Smith@gmail.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;:I:&lt;/P&gt;&lt;P&gt;//Q XYZRTSWPQ NSPRQLQ&lt;/P&gt;&lt;P&gt;//N L 01WOW13&lt;/P&gt;&lt;P&gt;@T&lt;/P&gt;&lt;P&gt;!BRR 08;LIM 20&lt;/P&gt;&lt;P&gt;@01@?30@02&lt;/P&gt;&lt;P&gt;!BRR -100;LIM 0&lt;/P&gt;&lt;P&gt;!LIM 68;BRR 2&lt;/P&gt;&lt;P&gt;@03&lt;/P&gt;&lt;P&gt;@A&lt;/P&gt;&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;CompanyName&lt;/P&gt;&lt;P&gt;Street Name &lt;/P&gt;&lt;P&gt;Town Name County Post Code &lt;/P&gt;&lt;P&gt;@I01100100100&lt;/P&gt;&lt;P&gt;@I02robqqgzr&lt;/P&gt;&lt;P&gt;@I03100100100&lt;/P&gt;&lt;P&gt;@A&lt;/P&gt;&lt;P&gt;Dear&lt;/P&gt;&lt;P&gt;CompanyNAme&lt;/P&gt;&lt;P&gt;Street Name &lt;/P&gt;&lt;P&gt;Town Name County PostCode &lt;/P&gt;&lt;P&gt;@I01200200200&lt;/P&gt;&lt;P&gt;@I02robfxmal&lt;/P&gt;&lt;P&gt;@I03200200200&lt;/P&gt;&lt;P&gt;@A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 09:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188609#M35646</guid>
      <dc:creator>ciro</dc:creator>
      <dc:date>2014-02-27T09:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: infile strange text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188610#M35647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since the outcome of the program is not exactly clear, I made one up myself, but it might give you a hint on the techniques to use.&lt;/P&gt;&lt;P&gt;With the trailing @ sign in the INPUT statement you can read a line from the file and keep it in the input buffer, so the next INPUT statement will read from the same input buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made up two record types, on that determines the beginning of a block of lines and one that ends the block of lines to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look, it might help you to get started with what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; want;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;truncover&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;* read record Type and keep input record ;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; @&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; recType &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;$4.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; @&lt;BR /&gt;&amp;nbsp; ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;* check for beginning of lines to read ;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; recType = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"@I01"&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; readLine;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readLine = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;* check for end of lines to read ;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; recType = &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"@A"&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; readLine;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readLine = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;* read lines and write to output ;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; readLine = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; textLine &lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;$32.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;output&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;cards4&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;&lt;SPAN&gt;:R: John Smith, 999-7543,&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:John.Smith@gmail.com"&gt;John.Smith@gmail.com&lt;/A&gt;&lt;BR /&gt;:I:&lt;BR /&gt;//Q XYZRTSWPQ NSPRQLQ&lt;BR /&gt;//N L 01WOW13&lt;BR /&gt;@T&lt;BR /&gt;!BRR 08;LIM 20&lt;BR /&gt;@01@?30@02&lt;BR /&gt;!BRR -100;LIM 0&lt;BR /&gt;!LIM 68;BRR 2&lt;BR /&gt;@03&lt;BR /&gt;@A&lt;BR /&gt;Dear&lt;BR /&gt;CompanyName&lt;BR /&gt;Street Name&lt;BR /&gt;Town Name County Post Code&lt;BR /&gt;@I01100100100&lt;BR /&gt;@I02robqqgzr&lt;BR /&gt;@I03100100100&lt;BR /&gt;@A&lt;BR /&gt;Dear&lt;BR /&gt;CompanyNAme&lt;BR /&gt;Street Name&lt;BR /&gt;Town Name County PostCode&lt;BR /&gt;@I01200200200&lt;BR /&gt;@I02robfxmal&lt;BR /&gt;@I03200200200&lt;BR /&gt;@A&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 10:57:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188610#M35647</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2014-02-27T10:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: infile strange text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188611#M35648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If at first you just want to make sure that you read everything that's in a line, try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let maxrl=500; * or any number that is appropriate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data infile1;&lt;/P&gt;&lt;P&gt;infile"xxxx" lrecl=&amp;amp;maxrl truncover;&lt;/P&gt;&lt;P&gt;input whole_line $&amp;amp;maxrl.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 12:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188611#M35648</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-02-27T12:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: infile strange text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188612#M35649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Bruno. It's perfect for what I need. Just I do not understand the use of the second &lt;SPAN style="color: #000000; font-family: Consolas; font-size: 15px; background-color: #ffffff;"&gt;@&lt;/SPAN&gt; in the first input statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 13:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188612#M35649</guid>
      <dc:creator>ciro</dc:creator>
      <dc:date>2014-02-27T13:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: infile strange text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188613#M35650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first @ in the input statement positions the cursor at column 1;&lt;/P&gt;&lt;P&gt;The second, trailing(!) @ tells SAS to keep the contents of the input buffer and not read a new line.&lt;/P&gt;&lt;P&gt;The input statement without the trailing @ switches to the next line of the infile after reading &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 13:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/infile-strange-text-file/m-p/188613#M35650</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-02-27T13:37:19Z</dc:date>
    </item>
  </channel>
</rss>

