<?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: How to read over multiple lines/record ... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807367#M318312</link>
    <description>&lt;P&gt;Please see the section entitled "Line Pointer Controls" &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0w3hkircglkogn1eqp3l9rwetlu" target="_self"&gt;here&lt;/A&gt;. Essentially using a / or the # operator lets your INPUT statement read from multiple lines.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2022 12:41:44 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-04-12T12:41:44Z</dc:date>
    <item>
      <title>How to read over multiple lines/record ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807366#M318311</link>
      <description>&lt;P&gt;Get file with record over 4 lines(sample below)... How to read-in over lines (var names do not matter, just var1/2/3/...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GAS 6246.00 2203 5111 &lt;BR /&gt;1135 18.17%&lt;BR /&gt;2204 6134 &lt;BR /&gt;112 1.79%&lt;BR /&gt;PORK 12.40 2203 11215 &lt;BR /&gt;1185 9.56%&lt;BR /&gt;2205 14210 &lt;BR /&gt;-1810 -14.60%&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 12:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807366#M318311</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-04-12T12:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to read over multiple lines/record ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807367#M318312</link>
      <description>&lt;P&gt;Please see the section entitled "Line Pointer Controls" &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0w3hkircglkogn1eqp3l9rwetlu" target="_self"&gt;here&lt;/A&gt;. Essentially using a / or the # operator lets your INPUT statement read from multiple lines.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 12:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807367#M318312</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-04-12T12:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to read over multiple lines/record ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807409#M318333</link>
      <description>&lt;P&gt;IF every record takes the&amp;nbsp; same number of lines in the source then write a data step to read the data and your INFILE statement uses the N= option to specify that number. Then use the # in the INPUT statement to indicate which line to read specific variables from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   infile datalines n=4;
   input var1 $ varw var3 var5
        #2 var6 var7 :commax.
        #3 var8 var9
        #4 var10 var11 :commax.
   ;
   format var7 var11 percent8.2;
datalines;
GAS 6246.00 2203 5111
1135 18.17%
2204 6134
112 1.79%
PORK 12.40 2203 11215
1185 9.56%
2205 14210
-1810 -14.60%
;&lt;/PRE&gt;
&lt;P&gt;If your data has varying number of lines per record this likely won't work.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2022 15:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807409#M318333</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-12T15:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to read over multiple lines/record ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807701#M318483</link>
      <description>&lt;P&gt;What if the info is in a file?! I tried below, it goes wack thou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data example;&lt;BR /&gt;infile "C:\Users\24891\Desktop\sasOUT\20220301_copy.csv" n=4;&lt;BR /&gt;input var1 $ varw var3 var5&lt;BR /&gt;#2 var6 var7 :comma4.&lt;BR /&gt;#3 var8 var9&lt;BR /&gt;#4 var10 var11 :comma4.&lt;BR /&gt;;run;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 02:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807701#M318483</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-04-14T02:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to read over multiple lines/record ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807705#M318486</link>
      <description>&lt;P&gt;Whether a file or as in-line data it should work the same.&lt;/P&gt;
&lt;P&gt;How does it not work?&lt;/P&gt;
&lt;P&gt;Does the actual file not follow the pattern of your example lines?&lt;BR /&gt;Why does the file have a CSV extension?&amp;nbsp; The sample lines you showed look nothing like a CSV file there weren't any commas on any of the lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To look the beginning of the file run a simple data step to dump the first lines to the SAS log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile "C:\Users\24891\Desktop\sasOUT\20220301_copy.csv" obs=5;
  input;
  list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2022 04:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-over-multiple-lines-record/m-p/807705#M318486</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-14T04:47:20Z</dc:date>
    </item>
  </channel>
</rss>

