<?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: Using dm statement to save log, how to replace old log automatically without dialog box? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862556#M340722</link>
    <description>&lt;P&gt;My code looks like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; dm "log; file ""%sysfunc(pathname(work))/__mylog.log"" replace;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I quote the command, and there is a semicolon to separate the log command from the file command, and I also quote the path.&amp;nbsp; So based on that, you could try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm 'log; file "P:\logs\ReportPrint.log" replace;' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It usually takes me some tinkering with the quotes etc, but should be doable.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 18:58:52 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-03-06T18:58:52Z</dc:date>
    <item>
      <title>Using dm statement to save log, how to replace old log automatically without dialog box?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862552#M340719</link>
      <description>&lt;P&gt;I'm using the following code to save the log after running my program.&amp;nbsp; The problem is that, if the log file already exists from a previous run, a dialog box pops up and asked if I want to Replace, Append, or Cancel.&amp;nbsp; I want it to replace by default.&amp;nbsp; This code runs without error, but the 'replace' command doesn't seem to do anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm log 'file "P:\logs\ReportPrint..log"' replace;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, I know that I can use proc printto to save the log, but I prefer the dm statement so I can watch the log update in SAS as it runs.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 18:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862552#M340719</guid>
      <dc:creator>Wolverine</dc:creator>
      <dc:date>2023-03-06T18:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using dm statement to save log, how to replace old log automatically without dialog box?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862555#M340721</link>
      <description>May not be a valid solution if running interactively, but ALTLOG is also a useful option to be aware of.</description>
      <pubDate>Mon, 06 Mar 2023 18:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862555#M340721</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-03-06T18:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using dm statement to save log, how to replace old log automatically without dialog box?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862556#M340722</link>
      <description>&lt;P&gt;My code looks like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; dm "log; file ""%sysfunc(pathname(work))/__mylog.log"" replace;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So I quote the command, and there is a semicolon to separate the log command from the file command, and I also quote the path.&amp;nbsp; So based on that, you could try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dm 'log; file "P:\logs\ReportPrint.log" replace;' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It usually takes me some tinkering with the quotes etc, but should be doable.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 18:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862556#M340722</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-03-06T18:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using dm statement to save log, how to replace old log automatically without dialog box?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862558#M340723</link>
      <description>&lt;P&gt;That works, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 19:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-dm-statement-to-save-log-how-to-replace-old-log/m-p/862558#M340723</guid>
      <dc:creator>Wolverine</dc:creator>
      <dc:date>2023-03-06T19:06:18Z</dc:date>
    </item>
  </channel>
</rss>

