<?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: write in log of a main program and a sub program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820703#M323972</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that the subprog 1 writes "&lt;SPAN&gt;"The subprog 1 is started" inside the log file of the main prog&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but&amp;nbsp;"The subprog 1 is completed" is not writing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not writing it at all, or not writing it in the proper place (which is in the main program)?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 15:01:10 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-06-28T15:01:10Z</dc:date>
    <item>
      <title>write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820667#M323954</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have 3 programs. one main program that launch two sub programs. I would like 3 log files.&lt;/P&gt;
&lt;P&gt;I would like to obtain this 4 notes below inside the log of the main prog&lt;/P&gt;
&lt;P&gt;"The subprog 1 is started"&lt;/P&gt;
&lt;P&gt;"The subprog 1 is completed"&lt;/P&gt;
&lt;P&gt;"The subprog 2 is started"&lt;/P&gt;
&lt;P&gt;"The subprog 2 is completed"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so this is what I done but it does not work :&lt;/P&gt;
&lt;P&gt;in the main prog :&lt;/P&gt;
&lt;P&gt;PROC PRINTTO log='$GRPLOGS/mainprog.log' new;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;%include subprog1.sas&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%include subprog2.sas&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc printto;&lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the subprog1&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%PUT the prog 1 is started ;&lt;/P&gt;
&lt;P&gt;PROC PRINTTO LOG='$GRPLOGS/subprog1' NEW;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;%PUT the prog 1 is completed ;&lt;/P&gt;
&lt;P&gt;proc printto ;&lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the same for the subprog2 ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;many thanks a lot in advance&lt;/P&gt;
&lt;P&gt;kind regards&lt;/P&gt;
&lt;P&gt;Nasser&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 11:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820667#M323954</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2022-06-28T11:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820669#M323955</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have 3 programs. one main program that launch two sub programs. I would like 3 log files.&lt;/P&gt;
&lt;P&gt;I would like to obtain this 4 notes below inside the log of the main prog&lt;/P&gt;
&lt;P&gt;"The subprog 1 is started"&lt;/P&gt;
&lt;P&gt;"The subprog 1 is completed"&lt;/P&gt;
&lt;P&gt;"The subprog 2 is started"&lt;/P&gt;
&lt;P&gt;"The subprog 2 is completed"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so this is what I done but it does not work :&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What doesn't work? HINT: never tell us that something doesn't work and then not explain further. If there are errors in the log, show us the &lt;FONT color="#FF0000"&gt;entire&lt;/FONT&gt; log for this section of code. If the output is wrong, show us the incorrect output and then tell us what you would like to see.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 12:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820669#M323955</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-28T12:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820671#M323956</link>
      <description>&lt;P&gt;Have you tried using a data null step inside the sub programs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* After proc printto */
data _null_;
  file "$GRPSLOGS/mainprog.log" mod;
  put "The subprog 1 started";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The end-message can be written by a similar step.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 12:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820671#M323956</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-06-28T12:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820701#M323971</link>
      <description>&lt;P&gt;Hello PaigeMiller&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for you quick respons&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sorry for forgetting explanation on what does not work.&lt;/P&gt;
&lt;P&gt;My problem is that the subprog 1 writes "&lt;SPAN&gt;"The subprog 1 is started" inside the log file of the main prog&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but&amp;nbsp;"The subprog 1 is completed" is not writing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nasser&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 14:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820701#M323971</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2022-06-28T14:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820703#M323972</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that the subprog 1 writes "&lt;SPAN&gt;"The subprog 1 is started" inside the log file of the main prog&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but&amp;nbsp;"The subprog 1 is completed" is not writing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not writing it at all, or not writing it in the proper place (which is in the main program)?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 15:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820703#M323972</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-28T15:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820722#M323984</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Not writing it at all,&amp;nbsp;neithor in the log of the main prog, nor in the log of the sub prg 1&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 16:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820722#M323984</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2022-06-28T16:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820744#M323998</link>
      <description>&lt;P&gt;Show me the log for your code, from say 10 lines above to 10 lines below this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT the prog 1 is completed ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jun 2022 17:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/820744#M323998</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-06-28T17:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: write in log of a main program and a sub program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/821091#M324154</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* below : MAINPROG */

/* create the log of the mainprog */
PROC PRINTTO log='$GRPLOGS/MAINPROG.log' new;
RUN;

%INCLUDE '$GRPSBSAS/SUIVIS/CLIENT/RECOUV/CESSION/SUBPROG1.sas';                    


/*close the log of the main prog */
PROC PRINTTO;
RUN;



/* BELOW the SUBPROG1 */
%PUT the SUBPROG1 is started ;

/* create the log of the SUBPROG1 */
PROC PRINTTO LOG="$GRPLOGS/SUBPROG1.log" NEW;
RUN;

%put this is the SUBPROG1 ;

/* close the log of the SUBPROG1 */
PROC PRINTTO;
RUN;

%PUT the SUBPROG1 is completed ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello PaigeMiller&lt;/P&gt;
&lt;P&gt;please find the code of the prog main and sub prog 1.&lt;/P&gt;
&lt;P&gt;and this is below the entire log of the main prog. as you can notice, "started" appears but "completed" does not&amp;nbsp; !&lt;/P&gt;
&lt;P&gt;many Thanks .&lt;/P&gt;
&lt;P&gt;main log==&amp;gt;&lt;/P&gt;
&lt;P&gt;NOTE: PROCEDURE PRINTTO used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;23 &lt;BR /&gt;24 &lt;BR /&gt;25 %INCLUDE '$GRPSBSAS/SUIVIS/CLIENT/RECOUV/CESSION/SUBPROG1.sas';&lt;BR /&gt;NOTE: %INCLUDE (level 1) file $GRPSBSAS/SUIVIS/CLIENT/RECOUV/CESSION/SUBPROG1.sas is file &lt;BR /&gt;/data/crea/creapil/sbsas/SUIVIS/CLIENT/RECOUV/CESSION/SUBPROG1.sas.&lt;BR /&gt;26 +&lt;BR /&gt;27 +%PUT the SUBPROG1 is started ;&lt;BR /&gt;the SUBPROG1 is started&lt;BR /&gt;28 +&lt;BR /&gt;29 +/* create the log of the SUBPROG1 */&lt;BR /&gt;30 +PROC PRINTTO LOG="$GRPLOGS/SUBPROG1.log" NEW;&lt;BR /&gt;31 +RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 09:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/write-in-log-of-a-main-program-and-a-sub-program/m-p/821091#M324154</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2022-06-30T09:38:41Z</dc:date>
    </item>
  </channel>
</rss>

