<?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: finding path to current log file in a batch Windows job in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678499#M204794</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4784"&gt;@BenConner&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From within the running batch job you can retrieve the value of the &lt;A href="https://documentation.sas.com/?docsetId=hostwin&amp;amp;docsetTarget=n0u77ujp4vk4wvn1p5e8g6jmjkx7.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;LOG system option&lt;/A&gt;, i.e.,&lt;/P&gt;
&lt;PRE&gt;%sysfunc(getoption(log))&lt;/PRE&gt;
&lt;P&gt;will evaluate to the path of the log file.&amp;nbsp;This would, however, not reflect redirections of the log via PROC PRINTTO calls in the program, if any. But if you wrote a PROC PRINTTO step, you would likely know the path anyway.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2020 16:11:34 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-08-21T16:11:34Z</dc:date>
    <item>
      <title>finding path to current log file in a batch Windows job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678432#M204758</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I have a batch SAS job running in Windows, is there any way I can find out what the current path/name is of the log file it is generating?&lt;/P&gt;
&lt;P&gt;I need to pass that to a log analyzer that I call at the end of the job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 13:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678432#M204758</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2020-08-21T13:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: finding path to current log file in a batch Windows job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678497#M204792</link>
      <description>&lt;P&gt;How are you running the batch job?&lt;/P&gt;
&lt;P&gt;The command line used should allow you to set the output destination of the LOG or setting the Log options in the configuration file use or using proc printto&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example of a command line:&lt;/P&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="p16esisc4nrd5sn1ps5l6u8f79k6" class="xis-topic"&gt;
&lt;DIV id="p01fzykn6n0s73n164xasi1t3ii9" class="xis-subTopic"&gt;
&lt;DIV id="n1uadem2tlhar7n0zqz5gzu6phfj" class="xis-subSubTopic"&gt;
&lt;DIV id="p1e3clvilu8igtn1ab8x74gyaaoe" class="xis-topicContent"&gt;
&lt;DIV class="xis-listSteps"&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV id="n1oh83x010i0xdn14jrr2ued6kqt" class="xis-step"&gt;
&lt;DIV id="p04x7ukbf2ujo0n18ccrdynaxo2o" class="xis-paragraphFirst"&gt;&lt;CODE class="xis-codeDefaultStyle"&gt;"C:\Program Files\SASHome\SASFoundation\9.4\Sas.exe"-SYSIN                                       c:\job1.bat -NOSPLASH -ICON -PRINT c:\job1.lst –LOG c:\job1.log&lt;/CODE&gt;.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;CODE class="xis-codeDefaultStyle"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp; -Log sets the location of the log file to c:\job1.log &lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 15:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678497#M204792</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-21T15:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: finding path to current log file in a batch Windows job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678499#M204794</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4784"&gt;@BenConner&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From within the running batch job you can retrieve the value of the &lt;A href="https://documentation.sas.com/?docsetId=hostwin&amp;amp;docsetTarget=n0u77ujp4vk4wvn1p5e8g6jmjkx7.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;LOG system option&lt;/A&gt;, i.e.,&lt;/P&gt;
&lt;PRE&gt;%sysfunc(getoption(log))&lt;/PRE&gt;
&lt;P&gt;will evaluate to the path of the log file.&amp;nbsp;This would, however, not reflect redirections of the log via PROC PRINTTO calls in the program, if any. But if you wrote a PROC PRINTTO step, you would likely know the path anyway.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 16:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678499#M204794</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-08-21T16:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: finding path to current log file in a batch Windows job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678556#M204816</link>
      <description>&lt;P&gt;Perfect.&amp;nbsp; That's exactly what I was looking for.&amp;nbsp; Rather than the %sysfunc, I just used a simple data step to test with&amp;nbsp; but I think sysfunc would work better in the actual application.&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 19:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/finding-path-to-current-log-file-in-a-batch-Windows-job/m-p/678556#M204816</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2020-08-21T19:21:46Z</dc:date>
    </item>
  </channel>
</rss>

