<?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 searching string through programs in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51159#M13993</link>
    <description>I want to search through a bunch of sas programs and find one word strings. The ouput dataset called found contains the job that has the matching string.&lt;BR /&gt;
This is one way I approached it but get stock when trying to output or using the filevar:&lt;BR /&gt;
&lt;BR /&gt;
I created a proglist text file that contains all my programs ( more than a 100) which I loaded them into a sas data set named progs.  I take this progs set and &lt;BR /&gt;
&lt;BR /&gt;
data progs;&lt;BR /&gt;
infile proglist;&lt;BR /&gt;
input @1 program  $88.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename name '/dir/';&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data found;&lt;BR /&gt;
set progs;&lt;BR /&gt;
prog =  '/dir/'||program;&lt;BR /&gt;
infile name filevar=prog  end=done;&lt;BR /&gt;
do while (not done);&lt;BR /&gt;
if index(_INFILE_, "FINDTHIS") &amp;gt; 0 then do; found = 1;output; end;&lt;BR /&gt;
end;&lt;BR /&gt;
run;</description>
    <pubDate>Thu, 02 Jul 2009 14:11:42 GMT</pubDate>
    <dc:creator>jplarios</dc:creator>
    <dc:date>2009-07-02T14:11:42Z</dc:date>
    <item>
      <title>searching string through programs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51159#M13993</link>
      <description>I want to search through a bunch of sas programs and find one word strings. The ouput dataset called found contains the job that has the matching string.&lt;BR /&gt;
This is one way I approached it but get stock when trying to output or using the filevar:&lt;BR /&gt;
&lt;BR /&gt;
I created a proglist text file that contains all my programs ( more than a 100) which I loaded them into a sas data set named progs.  I take this progs set and &lt;BR /&gt;
&lt;BR /&gt;
data progs;&lt;BR /&gt;
infile proglist;&lt;BR /&gt;
input @1 program  $88.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
filename name '/dir/';&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data found;&lt;BR /&gt;
set progs;&lt;BR /&gt;
prog =  '/dir/'||program;&lt;BR /&gt;
infile name filevar=prog  end=done;&lt;BR /&gt;
do while (not done);&lt;BR /&gt;
if index(_INFILE_, "FINDTHIS") &amp;gt; 0 then do; found = 1;output; end;&lt;BR /&gt;
end;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 02 Jul 2009 14:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51159#M13993</guid>
      <dc:creator>jplarios</dc:creator>
      <dc:date>2009-07-02T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: searching string through programs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51160#M13994</link>
      <description>Your SAS program needs an INPUT; statement to load the input buffer before you can reference _INFILE_.  &lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 02 Jul 2009 15:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51160#M13994</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-02T15:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: searching string through programs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51161#M13995</link>
      <description>Scott,&lt;BR /&gt;
Thank you!&lt;BR /&gt;
Juan</description>
      <pubDate>Thu, 02 Jul 2009 19:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51161#M13995</guid>
      <dc:creator>jplarios</dc:creator>
      <dc:date>2009-07-02T19:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: searching string through programs</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51162#M13996</link>
      <description>Juan -&lt;BR /&gt;
  If you only wanted to get one observation per file then you could add a little more logic to your do loop.&lt;BR /&gt;
&lt;BR /&gt;
found=0;&lt;BR /&gt;
do while (not done and not found);&lt;BR /&gt;
  if index(_INFILE_, "FINDTHIS") &amp;gt; 0 then do; found = 1;output; end;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
- Tom</description>
      <pubDate>Tue, 07 Jul 2009 01:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/searching-string-through-programs/m-p/51162#M13996</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-07T01:47:22Z</dc:date>
    </item>
  </channel>
</rss>

