<?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: Saving log files in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132188#M35930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try to use the procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc printto log="~/test.log";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Nov 2013 02:30:36 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2013-11-04T02:30:36Z</dc:date>
    <item>
      <title>Saving log files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132187#M35929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to save the log file of a SAS program to a network drive every time the code runs. The saved log file name would contain the date &amp;amp; time that it was generated in order to have a unique name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions on how to do this please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 02:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132187#M35929</guid>
      <dc:creator>PTD_SAS</dc:creator>
      <dc:date>2013-11-04T02:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Saving log files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132188#M35930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can try to use the procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc printto log="~/test.log";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 02:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132188#M35930</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-11-04T02:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Saving log files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132189#M35931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagadish, that answered my question!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fethon Naoum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 04:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132189#M35931</guid>
      <dc:creator>PTD_SAS</dc:creator>
      <dc:date>2013-11-04T04:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Saving log files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132190#M35932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;another approach you might like requires no code, just options you could put into the invocation command, or into one of the config files that sas uses when it starts&lt;/P&gt;&lt;P&gt;T&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;hese are the options&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-logparm (rollover=session write=immediate)&lt;/P&gt;&lt;P&gt;-log "...your path.../altlog.#Y-#m-d.#H-#M-#s.###p.#a.log"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the -LOG option which defines an alternative log file with these #directives which are replaced with year/month/day/time/processID values that are defined in the documentation for the option LOGPARM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on which release of SAS you use, they will also work for the -ALTLOG option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although the LOGPARM option was introduced to support the continuous working of SAS servers, with ROLLOVER= AUTO,&amp;nbsp; ROLLOVER=SESSION provides the more-normal handling that a new LOG is written for each SAS session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although you might not need or want it, I left in a feature I copied from my working environments (for this example) because you might appreciate it too.&lt;/P&gt;&lt;P&gt;WRITE=IMMEDIATE ensures the log file is written directly new info should appear in the log, and not delayed until the write buffer is full.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Nov 2013 09:45:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132190#M35932</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-11-04T09:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Saving log files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132191#M35933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Peter, that's an elegant way of doing it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2013 22:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Saving-log-files/m-p/132191#M35933</guid>
      <dc:creator>PTD_SAS</dc:creator>
      <dc:date>2013-11-05T22:40:53Z</dc:date>
    </item>
  </channel>
</rss>

