<?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 do I skip garbage lines from input file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280260#M56597</link>
    <description>&lt;P&gt;By the way, your original code has an issue. Be aware that if you hold the input record with a trailing '@' the pointer will not be at the beginning of the record for the next input statement. You will have to reset it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
else input @1 name $ age;
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jun 2016 18:45:16 GMT</pubDate>
    <dc:creator>jklaverstijn</dc:creator>
    <dc:date>2016-06-26T18:45:16Z</dc:date>
    <item>
      <title>How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280257#M56595</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;
&lt;P&gt;i few sample data placed in datalines, I just wanted to skip those lines which has got "name" and "age" values,&lt;/P&gt;
&lt;P&gt;i just wanted to read only real data.&lt;/P&gt;
&lt;P&gt;I tried this below code, but it's not cool, I am looking for some better options, like #N or / options to skip certain lines, but&lt;/P&gt;
&lt;P&gt;I do not know how to use above tools?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input value $ @;&lt;BR /&gt;if value eq "name" then delete;&lt;BR /&gt;else; input name $ age;&lt;BR /&gt;drop value;&lt;BR /&gt;datalines;&lt;BR /&gt;name age&lt;BR /&gt;Dharmu 20&lt;BR /&gt;Vivian 18&lt;BR /&gt;name age&lt;BR /&gt;Tina 20&lt;BR /&gt;Kath 21&lt;BR /&gt;name age&lt;BR /&gt;John 30&lt;BR /&gt;Tim 30&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2016 18:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280257#M56595</guid>
      <dc:creator>LittlesasMaster</dc:creator>
      <dc:date>2016-06-26T18:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280259#M56596</link>
      <description>&lt;P&gt;What's not to like about what you have? I think it's cool enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A shorter alternative would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ @;
if value eq "name" then delete;
else; input age;
datalines;
name age
Dharmu 20
Vivian 18
name age
Tina 20
Kath 21
name age
John 30
Tim 30
;
run;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jun 2016 18:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280259#M56596</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-06-26T18:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280260#M56597</link>
      <description>&lt;P&gt;By the way, your original code has an issue. Be aware that if you hold the input record with a trailing '@' the pointer will not be at the beginning of the record for the next input statement. You will have to reset it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
else input @1 name $ age;
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2016 18:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280260#M56597</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-06-26T18:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280261#M56598</link>
      <description>&lt;P&gt;Yes Thanks, I figured it out when saw the output, thanks for pointing that out,&lt;/P&gt;
&lt;P&gt;but can we use those line pointer to skip the lines, I mean just curius to learn that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2016 18:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280261#M56598</guid>
      <dc:creator>LittlesasMaster</dc:creator>
      <dc:date>2016-06-26T18:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280263#M56599</link>
      <description>&lt;P&gt;I would do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input @;
if _infile_ eq "name age" then input;
else do;
    input name $ age;
    output;
    end;
datalines;
name age
Dharmu 20
Vivian 18
name age
Tina 20
Kath 21
name age
John 30
Tim 30
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jun 2016 19:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280263#M56599</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-06-26T19:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280269#M56601</link>
      <description>&lt;P&gt;If you are positive of the pattern (one garbage line followed by two good lines), you can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data have;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input / name $ age;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;input name $ age;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;name age&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dharmu 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Vivian 18&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;name age&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tina 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kath 21&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;name age&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;John 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim 30&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if you don't know the pattern ahead of time, there's no way for you to tell SAS the pattern (through your programming statements) ahead of time.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2016 19:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280269#M56601</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-26T19:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I skip garbage lines from input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280270#M56602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/14488"&gt;@LittlesasMaster&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;but can we use those line pointer to skip the lines, I mean just curius to learn that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes you can. Use the forward slash in your INPUT statement. Or simply use another INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p0s16wvzu0z9q7n0zmxia30s6qyc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p0s16wvzu0z9q7n0zmxia30s6qyc.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Jan&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jun 2016 19:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-skip-garbage-lines-from-input-file/m-p/280270#M56602</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-06-26T19:56:10Z</dc:date>
    </item>
  </channel>
</rss>

