<?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 Writing logs from rsubmit separately in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684453#M207418</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am working with rsubmits in SAS EG to parallelize my code, submitting batches of 20 at a time (see screenshot). Currently the whole log just goes into one file, I am wondering if there is a way to have each remote session write a log to a different file so that the log doesn't get extremely long.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Sep 2020 01:23:14 GMT</pubDate>
    <dc:creator>cfrey73</dc:creator>
    <dc:date>2020-09-17T01:23:14Z</dc:date>
    <item>
      <title>Writing logs from rsubmit separately</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684453#M207418</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am working with rsubmits in SAS EG to parallelize my code, submitting batches of 20 at a time (see screenshot). Currently the whole log just goes into one file, I am wondering if there is a way to have each remote session write a log to a different file so that the log doesn't get extremely long.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 01:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684453#M207418</guid>
      <dc:creator>cfrey73</dc:creator>
      <dc:date>2020-09-17T01:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Writing logs from rsubmit separately</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684468#M207419</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-09-16 at 9.20.24 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49476i205B17CEA1D1E6A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-09-16 at 9.20.24 PM.png" alt="Screen Shot 2020-09-16 at 9.20.24 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 01:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684468#M207419</guid>
      <dc:creator>cfrey73</dc:creator>
      <dc:date>2020-09-17T01:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Writing logs from rsubmit separately</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684470#M207420</link>
      <description>&lt;P&gt;That's an extremely useful technique, having each sub-process write to a separate log.&amp;nbsp; The way I do it is to set up an ALTLOG.&amp;nbsp; Enterprise Guide can be a bit of a pain with RSUBMIT.&amp;nbsp; It's hard to read the output in the regular log -- and then nearly impossible in the Project Log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I do is first set up a macro variable with the commands I want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET		Cmd_String				=	!sascmdv -logparm 'write=immediate rollover=session'  -memsize 8G 
-altlog &amp;amp;Log_Path\sub_process_logs\&amp;amp;Pgm._#Y-#m-#d_#H-#M-#s_#p.log;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SAS uses the value of the cmd option to launch RSUBMITed jobs. The existing value of the SAS cmd option can be brought in via !sascmdv.&amp;nbsp; All I'm doing is appending some parameters to the end of the existing cmd string, one of which is an ALTLOG parameter.&amp;nbsp; The #Y #m and such are log directives that embed a date time stamp and the Process ID in the log file name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I set the SAS cmd option to the value of the string I just created in the macro variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTION		SASCMD					=	"&amp;amp;Cmd_String";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I execute my RSUBMIT just as I normally would:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;RSUBMIT	PROCESS=&amp;amp;Process_Name		WAIT=NO	PERSIST=NO;
	%INC	"&amp;amp;Pgm_Path\&amp;amp;Pgm..sas";
ENDRSUBMIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During execution, I can monitor the jobs via the sub-process logs as they execute because I specified WRITE=IMMEDIATE in my logparm.&amp;nbsp; And of course afterwards, it's a lot easier to work with the logs since each sub-process has it's own log.&amp;nbsp; The date time stamps allow me to keep runs separate even if I need to move, copy, or archive the jobs.&amp;nbsp; During execution the Process ID helps me look at my Task Manager to see which processes are still running, how much CPU they're using, etc.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1600308786702.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49478i26C781CF38D7518E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1600308786702.png" alt="jimbarbour_0-1600308786702.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 02:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-logs-from-rsubmit-separately/m-p/684470#M207420</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-17T02:16:58Z</dc:date>
    </item>
  </channel>
</rss>

