<?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 can I infile the header as data? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287361#M59110</link>
    <description>&lt;P&gt;try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test; &lt;BR /&gt; infile "H:\file.tsv" obs=1 lrec=20000&amp;nbsp;pad;&lt;BR /&gt; input lines $1-20000;&amp;nbsp;&lt;BR /&gt; &lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2016 22:45:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-07-26T22:45:59Z</dc:date>
    <item>
      <title>How can I infile the header as data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287359#M59108</link>
      <description>&lt;P&gt;I'm trying to read a tab delimited file with the first row containing a header. &amp;nbsp;My goal is to get the header line only for a large number of&amp;nbsp;datasets that vary in size and construction.&amp;nbsp;Because the header lines are variable in length and can contain hundreds of fields, I can't set the&amp;nbsp;lrecl to the exact width of any header line. &amp;nbsp;When the input length upper limit is less than the length of the header line, the header line imports but is short of the last field; however, when I make the length longer than the length of the header line, so that it goes into line 2, it ignores the header line completely, and acts as though line 2 is the first line of the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code below shows basically what I'm trying to do. &amp;nbsp;I've tried everything I can think of without success. &amp;nbsp;Any feedback is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test; &lt;BR /&gt; infile "H:\file.tsv" firstobs=1;&lt;BR /&gt; input lines $1-20000; &lt;BR /&gt; if _N_ eq 1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 22:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287359#M59108</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2016-07-26T22:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I infile the header as data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287361#M59110</link>
      <description>&lt;P&gt;try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test; &lt;BR /&gt; infile "H:\file.tsv" obs=1 lrec=20000&amp;nbsp;pad;&lt;BR /&gt; input lines $1-20000;&amp;nbsp;&lt;BR /&gt; &lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 22:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287361#M59110</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-26T22:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I infile the header as data?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287364#M59113</link>
      <description>&lt;P&gt;It was the pad option that did it! &amp;nbsp;Thanks so much for your quick response. &amp;nbsp;Much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 22:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-infile-the-header-as-data/m-p/287364#M59113</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2016-07-26T22:51:59Z</dc:date>
    </item>
  </channel>
</rss>

