<?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 check this in a file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59623#M12929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ksharp for the colon modifier. I learned something. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 14:57:43 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2012-04-11T14:57:43Z</dc:date>
    <item>
      <title>How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59618#M12924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I need to check multiple log files if they are created today and to check if no error exists in log files without manually opening log files. Can this be done using SAS statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;basesas&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 14:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59618#M12924</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-04-10T14:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59619#M12925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are those log files from SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 16:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59619#M12925</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-10T16:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59620#M12926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes...SAS logs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 16:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59620#M12926</guid>
      <dc:creator>sasbasls</dc:creator>
      <dc:date>2012-04-10T16:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59621#M12927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming your log file all sit in the same directory under Windows, you could do :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let logPath=YOUR_LOG_PATH;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename toto PIPE "DIR ""&amp;amp;logPath.\*.log"" /n/o-d/t:c " console=min;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test(keep=logFile);&lt;BR /&gt;retain todayStr;&lt;BR /&gt;length logFile $200;&lt;BR /&gt;infile toto;&lt;BR /&gt;if _n_ = 1 then todayStr = put(today(),yymmddd10.);&lt;BR /&gt;input;&lt;BR /&gt;if substrn(_infile_,1,10)=todayStr then do;&lt;BR /&gt;logFile = substrn(_infile_,37);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename toto dummy;&lt;BR /&gt;data _null_;&lt;BR /&gt;set test;&lt;BR /&gt;logPath = cats("&amp;amp;logPath.\", logFile); &lt;BR /&gt;do until (_eof);&lt;BR /&gt;infile toto filevar=logPath end=_eof;&lt;BR /&gt;input;&lt;BR /&gt;if substrn(_infile_,1,6) = "ERROR:" then do;&lt;BR /&gt;&amp;nbsp; put "Error found in log file: " logFile " : " _infile_;&lt;BR /&gt;&amp;nbsp; _eof =&amp;nbsp; 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not fully tested... Not likely to work on UNIX - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 18:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59621#M12927</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-10T18:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59622#M12928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the code I wrote before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data _null_;
 infile '/spds_data6/temp/jh.txt' dlm=' ' length=len expandtabs;
 input row $varying200. len;
 if left(row) in: ('ERROR' 'WARNING') then put row;run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 06:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59622#M12928</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-11T06:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I check this in a file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59623#M12929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ksharp for the colon modifier. I learned something. - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 14:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-check-this-in-a-file/m-p/59623#M12929</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-11T14:57:43Z</dc:date>
    </item>
  </channel>
</rss>

