<?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 only the obs from text file except the string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55117#M11746</link>
    <description>data test;&lt;BR /&gt;
 infile datalines;&lt;BR /&gt;
 input @;&lt;BR /&gt;
 if substr(_infile_,1,2) = 'NB' then delete;&lt;BR /&gt;
 input a b c e;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2 3 4&lt;BR /&gt;
4 5 6 8&lt;BR /&gt;
2 3 4 5&lt;BR /&gt;
NB: There are 5 observations inserted&lt;BR /&gt;
;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 20 Oct 2008 11:58:51 GMT</pubDate>
    <dc:creator>GertNissen</dc:creator>
    <dc:date>2008-10-20T11:58:51Z</dc:date>
    <item>
      <title>reading only the obs from text file except the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55115#M11744</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
The below is my text file and I would like to read all the observations except the string "NB: There are 5 observations inserted" &lt;BR /&gt;
&lt;BR /&gt;
there could be any number of observations and any number of blanks between the last obs and the string&lt;BR /&gt;
&lt;BR /&gt;
sample.txt&lt;BR /&gt;
&lt;BR /&gt;
1 2 3 4&lt;BR /&gt;
4 5 6 8&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
2 3 4 5&lt;BR /&gt;
......&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
NB: There are 5 observations inserted&lt;BR /&gt;
&lt;BR /&gt;
Revert me back if any doubts on question&lt;BR /&gt;
Thanks and Regards&lt;BR /&gt;
sam</description>
      <pubDate>Fri, 17 Oct 2008 10:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55115#M11744</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-10-17T10:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: reading only the obs from text file except the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55116#M11745</link>
      <description>Just do a subsetting IF together with SUBSTR(). It could be convenient to use the _INFILE_= option ont INFILE statement.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Fri, 17 Oct 2008 11:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55116#M11745</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-10-17T11:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: reading only the obs from text file except the string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55117#M11746</link>
      <description>data test;&lt;BR /&gt;
 infile datalines;&lt;BR /&gt;
 input @;&lt;BR /&gt;
 if substr(_infile_,1,2) = 'NB' then delete;&lt;BR /&gt;
 input a b c e;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 2 3 4&lt;BR /&gt;
4 5 6 8&lt;BR /&gt;
2 3 4 5&lt;BR /&gt;
NB: There are 5 observations inserted&lt;BR /&gt;
;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 20 Oct 2008 11:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-only-the-obs-from-text-file-except-the-string/m-p/55117#M11746</guid>
      <dc:creator>GertNissen</dc:creator>
      <dc:date>2008-10-20T11:58:51Z</dc:date>
    </item>
  </channel>
</rss>

