<?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: Reading data from multiple lines in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69096#M19812</link>
    <description>Either you will need to have a fixed-format record or declare some delimiter-character that will be used to parse each record to create individual pieces, even as much with your header-row which appears cumbersome to deal with, from your data example.  One approach would be to load the input buffer which populates special-named SAS variable _INFILE_  and then use a DO UNTIL(FOREVER); /  END;  code-paragraph along with SCAN function to assign variables (over compensating for length and type to get the data loaded first in to a SAS file).  Then using another special variable _N_ assign an OBSNUM variable to track and re-connnect disjoint field-values, back into some purposeful orientation, possibly using PROC TRANSPOSE I would expect.&lt;BR /&gt;
&lt;BR /&gt;
Suggest the OP get the individual "component piece" parsing down first, then tackle how to reassemble pieces into usable data-rows, as needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 01 Sep 2010 21:12:54 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-09-01T21:12:54Z</dc:date>
    <item>
      <title>Reading data from multiple lines</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69094#M19810</link>
      <description>Very basic question but could not find on the forums with the search.&lt;BR /&gt;
I have a dataset that has different information on different lines. How can I read in the info in a "linear" way.&lt;BR /&gt;
Example:&lt;BR /&gt;
601   Part#  Part Name    Code1 Code2&lt;BR /&gt;
603   Model Info1 Info2 Info3&lt;BR /&gt;
604   Region Sales1 Sales2&lt;BR /&gt;
601   Part#  Part Name   Code1 Code 2&lt;BR /&gt;
602   Next Level Part &lt;BR /&gt;
603   Model Info1 Info2 Info3&lt;BR /&gt;
604&lt;BR /&gt;
etc.&lt;BR /&gt;
I want to pick out Part# Part Name Model Region as a single record for processing but there is no common "thread" in each line to tie to. There are also not always lines for each occurence, in this case part numbers.&lt;BR /&gt;
What have I missed?&lt;BR /&gt;
 Thanks.</description>
      <pubDate>Wed, 01 Sep 2010 19:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69094#M19810</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-01T19:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data from multiple lines</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69095#M19811</link>
      <description>You can approach this more than one way.  Using the INPUT statement you will probably want to be familiar with the trailing @ to read part of an input line while holding onto the line itself.  Also you may want to use the # which allows you to read multiple input lines.&lt;BR /&gt;
&lt;BR /&gt;
The key is to read a portion of the input line, hold it with a trailing @ and then use logic to decide how to proceed with that specific line and subsequent lines for that observation.</description>
      <pubDate>Wed, 01 Sep 2010 20:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69095#M19811</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-09-01T20:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data from multiple lines</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69096#M19812</link>
      <description>Either you will need to have a fixed-format record or declare some delimiter-character that will be used to parse each record to create individual pieces, even as much with your header-row which appears cumbersome to deal with, from your data example.  One approach would be to load the input buffer which populates special-named SAS variable _INFILE_  and then use a DO UNTIL(FOREVER); /  END;  code-paragraph along with SCAN function to assign variables (over compensating for length and type to get the data loaded first in to a SAS file).  Then using another special variable _N_ assign an OBSNUM variable to track and re-connnect disjoint field-values, back into some purposeful orientation, possibly using PROC TRANSPOSE I would expect.&lt;BR /&gt;
&lt;BR /&gt;
Suggest the OP get the individual "component piece" parsing down first, then tackle how to reassemble pieces into usable data-rows, as needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 01 Sep 2010 21:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-data-from-multiple-lines/m-p/69096#M19812</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-09-01T21:12:54Z</dc:date>
    </item>
  </channel>
</rss>

