<?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: Find SAS programs present in a folder ,having keyword 'Finance' inside it in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358013#M274321</link>
    <description>Could be simpler. &lt;BR /&gt;The required string was defined in mixed case so I expect it calls for a case sensitive search. The INPUT statement makes this really brief:&lt;BR /&gt;Data required_files( compress=yes) ;&lt;BR /&gt;Length filename filen $1000 ;&lt;BR /&gt;Retain filename ;&lt;BR /&gt;Infile "&amp;amp;folder/*.sas"  filename= filen lrecl= 32000  ;&lt;BR /&gt;INPUT @'Finance' ;&lt;BR /&gt;If filename= filen then delete ; * found earlier ;&lt;BR /&gt;   filename= filen ;&lt;BR /&gt;Run ;</description>
    <pubDate>Thu, 11 May 2017 18:36:24 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2017-05-11T18:36:24Z</dc:date>
    <item>
      <title>Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357891#M274316</link>
      <description>&lt;P&gt;Hello&amp;nbsp;All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warm greetings.&lt;/P&gt;&lt;P&gt;I appreared for a SAS developer interview recently ,and interviewer asked me this question .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;There is a folder in windows directory system.&lt;/P&gt;&lt;P&gt;it has many SAS programs,which may or may not contain keyword 'Finance' .&lt;/P&gt;&lt;P&gt;Write a SAS program to find out all such SAS programs from the folder.&lt;/P&gt;&lt;P&gt;X command utility cannot be used for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise .&lt;/P&gt;&lt;P&gt;Many thanks in advance for all the inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Neeraj Singh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 13:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357891#M274316</guid>
      <dc:creator>thisisneeraj</dc:creator>
      <dc:date>2017-05-11T13:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357893#M274317</link>
      <description>&lt;P&gt;What was your answer?&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 13:56:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357893#M274317</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-11T13:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357897#M274318</link>
      <description>&lt;P&gt;They do ask some tosh don't they. &amp;nbsp;Anyways, you can do it with DOPEN and DREAD:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n1xxcn6l9bttm4n1emt96vjv7fw7.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n1xxcn6l9bttm4n1emt96vjv7fw7.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 13:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357897#M274318</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-11T13:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357899#M274319</link>
      <description>&lt;P&gt;I did not give any answer. I was only able to think of X command utility and firing up a DOS command inside it.&lt;/P&gt;&lt;P&gt;but using SAS, i was speechles.. !! :'(&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 14:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357899#M274319</guid>
      <dc:creator>thisisneeraj</dc:creator>
      <dc:date>2017-05-11T14:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357910#M274320</link>
      <description>&lt;P&gt;You can use next code to serach for text files, including sas programs or logs, containing any desired given string:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let search_string = rename;
%let suffix = sas;
%let root=/folders/myshortcuts/My_Folders/;
filename finp ("&amp;amp;root.sas_help/*.&amp;amp;suffix"); 

data results;
     length fname _filepath $200;
     infile finp filename = _filepath eov=_eov truncover;
     input a_line $200.;
     fname = _filepath;
     
     if _eov=1 then do;
       _n=0;

       _eov=0;
     end;
     _n+1;
     
     if find(a_line,"&amp;amp;search_string",'i')
     then output;
     keep _n a_line fname;
run;     
   
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you are not using linux platform you may need adapt it to your OS.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 14:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/357910#M274320</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-05-11T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358013#M274321</link>
      <description>Could be simpler. &lt;BR /&gt;The required string was defined in mixed case so I expect it calls for a case sensitive search. The INPUT statement makes this really brief:&lt;BR /&gt;Data required_files( compress=yes) ;&lt;BR /&gt;Length filename filen $1000 ;&lt;BR /&gt;Retain filename ;&lt;BR /&gt;Infile "&amp;amp;folder/*.sas"  filename= filen lrecl= 32000  ;&lt;BR /&gt;INPUT @'Finance' ;&lt;BR /&gt;If filename= filen then delete ; * found earlier ;&lt;BR /&gt;   filename= filen ;&lt;BR /&gt;Run ;</description>
      <pubDate>Thu, 11 May 2017 18:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358013#M274321</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-05-11T18:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358030#M274322</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/74597"&gt;@thisisneeraj&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I did not give any answer. I was only able to think of X command utility and firing up a DOS command inside it.&lt;/P&gt;
&lt;P&gt;but using SAS, i was speechles.. !! :'(&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FYI - That's part of the 'question' how do you respond to things you don't know the answer to, the interviewers want that information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;don't know the correct answer is, "I don't know but I would do X, Y, Z to find out". Or "My first option would be use an OS tool, but if I had to use SAS I would try reading the file in and searching manually, but the processing time would be much longer. I know this isn't an efficient method, but it would work".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is using something like Windows Search. &amp;nbsp;Unless the job was for an advanced programmer that's what I would be looking for at any rate.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 19:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358030#M274322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-11T19:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Find SAS programs present in a folder ,having keyword 'Finance' inside it</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358172#M274323</link>
      <description>&lt;P&gt;Yes good point made by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;here. &amp;nbsp;Often questions are designed to see if you can do something, not necessarily how you do things. &amp;nbsp;Quite often we see questions on here which start with something like "I have to use xyz". &amp;nbsp;Knowing how to use a tool is one thing, knowing when to use a tool is another. &amp;nbsp;I mean I could ask, "You are only allowed to use paint, please explain how you would write a report". &amp;nbsp;Now you could fix on SAS and say well I would write a datastep which creates an array of pixels, thus drawing the commands to create the picture. &amp;nbsp;Or you could say, why not use an application designed specifically create to create pictures, there are many out there varying costs, knowledge levels, lets do an assessment on how one of those could integrate into the currentflow best.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 08:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Find-SAS-programs-present-in-a-folder-having-keyword-Finance/m-p/358172#M274323</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-12T08:10:16Z</dc:date>
    </item>
  </channel>
</rss>

