<?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: How to output specific part of 'Code'  log into different log file ( Is it possible) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954875#M372943</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, The reason behind it is that the data is blinded now, So every time, we have to check which model will be suitable when new data is delivered. To check data every time, I created a macro to check&amp;nbsp; (gatekeeping). My gate-keeping code causes the warnings in logs.&amp;nbsp; If I know the data I will run the code separate and choose the right method.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure I grasp what you are trying to say. But in any event, I still feel there might be (or might not be) underlying ethics issues here, and so I'm just going to stay out of this discussion.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jan 2025 22:51:05 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-01-01T22:51:05Z</dc:date>
    <item>
      <title>How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954866#M372937</link>
      <description>&lt;P&gt;Thanks for your input and Ideas. I encountered the following scenario. I would like to know if this is possible.&lt;/P&gt;
&lt;P&gt;I am running a PROC mixed procedure, before I ran,&amp;nbsp; I am checking for Model structure type that fits for the data, if the convergence criteria won't meet then I am doing the alternative procedures.&lt;/P&gt;
&lt;P&gt;Since I wanted a clean log, is it possible when convergence criteria won't meet, I want that log need to go into the different file, and the remaining should go to one file. is It possible to achieve. My aim is keep the log clean and at the same time have another log file. I am open to alternative options.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;***************************************************************
***************************************************************
Code to create the QC1 dataset
***************************************************************;
***---MMRM ---***
%macro mmrm(var =);

*** Check if TYPE =UN works or not***;
/*options nonotes nosource DKROCOND = nowarn;*/
ods output convergencestatus=cs LSmeans=lsmn Diffs = LSMDiff FitStatistics = fit;
/*ods exclude all;*/
proc mixed data = qc1 method = reml;
 class usubjid trtn avisitn agegroup;
 model &amp;amp;var = trtn avisitn trtn*avisitn agegroup base /ddfm = kenwardroger solution;
 repeated avisitn/subject=usubjid type=un;
 lsmeans trtn*avisitn avisitn/diff cl;
run;
/*ods exclude none; /* Resume output */*/;
/*options notes source DKROCOND = warn;*/
******* ****************************************************************
Looking the above MMRM log have to be in different file
If convergence criteria met, then no issue; if not it is generating 
Warnings in LOG
************************************************************************;
proc sql noprint;
 select strip(upcase(reason)) into: criteria separated by "" from work.cs;
quit;
%put &amp;amp;criteria.;

%if %index(&amp;amp;criteria.,CONVERGENCE CRITERIA MET.) %then
 %do;
	 ods output LSmeans=lsmn Diffs = LSMDiff FitStatistics = fit;
	 proc mixed data = qc1 method = reml;
	 class usubjid trtn avisitn;
	 model &amp;amp;var = trtn avisitn trtn*avisitn agegroup base /ddfm = kr;
	 repeated avisitn/subject=usubjid type=un;
	 lsmeans trtn*avisitn avisitn/diff cl;
	 run;
 %end;

%else %do;
	%let type = %str(CS TOEP AR);
	%do ord = 1 %to 3;
		 ods output convergencestatus=cs LSmeans=lsmn Diffs = LSMDiff FitStatistics = fit;
		 proc mixed data = qc1 method = reml;
		 class usubjid trtn avisitn;
		 model &amp;amp;var = trtn avisitn trtn*avisitn agegroup base /ddfm = kr;
		 repeated avisitn/subject=usubjid type=%scan(&amp;amp;type,&amp;amp;ord) %if &amp;amp;ord=3 %then(1);;
		 lsmeans trtn*avisitn avisitn/diff cl;
		 run;
		 proc sql noprint;
		 select strip(upcase(reason)) into :criteria separated by "" from work.cs;
		 quit;

		data data&amp;amp;ord;
		 length type $20;
		 set fit;
		 if Descr='AIC (Smaller is Better)';
		 criteria="&amp;amp;criteria";
		 type="%scan(&amp;amp;type,&amp;amp;ord)";
		run;
	 %end;
%end;

data all0;
 set data1 data2 data3;
 if index(criteria, 'CONVERGENCE CRITERIA MET.');
run;

proc sql;
 select count(distinct criteria) into :nobs from all0;
quit;
proc sort data = all0;
 by criteria value type;
run;
data all;
 set all0;
 by criteria value type;
 if first.criteria;
run;
proc sql noprint;
 select strip(upcase(type)) into :typemin separated by "" from work.all;
quit;
ods output LSmeans=lsmn Diffs = LSMDiff;
proc mixed data = qc1 method = reml;
 class usubjid trtn avisitn;
 model &amp;amp;var = trtn avisitn trtn*avisitn agegroup base /ddfm = kr;
 %IF &amp;amp;typemin=%STR(AR) %THEN %LET typemin = ar(1);
 repeated avisitn/subject=usubjid type=&amp;amp;typemin.;
 lsmeans trtn*avisitn avisitn/diff cl;
run;
%mend;
%mmrm(var = aval);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1735766031318.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103417iA63FC46B2B5D828B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1735766031318.png" alt="SASuserlot_0-1735766031318.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 21:13:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954866#M372937</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2025-01-01T21:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954867#M372938</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Since I wanted a clean log&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Splitting the log to have one log for models that converge and another log for models that don't converge is an odd request and if I was a cynical person, I would say it sounds a little underhanded to me. But maybe its not underhanded at all. Could you explain further the reasoning behind splitting logs like this?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954867#M372938</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-01T22:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954868#M372939</link>
      <description>&lt;P&gt;Like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; I'd like to understand your purpose for splitting logs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My purposes for having SAS logs are to:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;keep a complete record of processing, available for review&lt;/LI&gt;
&lt;LI&gt;confirm that all processing completed successfully&lt;/LI&gt;
&lt;LI&gt;if problems are encountered, then be available as a troubleshooting resource&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Splitting logs would make my purposes just so much harder so that's why I'm interested in your purpose.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954868#M372939</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-01-01T22:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954869#M372940</link>
      <description>&lt;P&gt;Yes, The reason behind it is that the data is blinded now, So every time, we have to check which model will be suitable when new data is delivered. To check data every time, I created a macro to check&amp;nbsp; (gatekeeping). My gate-keeping code causes the warnings in logs.&amp;nbsp; If I know the data I will run the code separate and choose the right method.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954869#M372940</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2025-01-01T22:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954870#M372941</link>
      <description>&lt;P&gt;Thanks for responding. I provided some explanation for the&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; response. Please let&amp;nbsp; me know if it make any sense.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954870#M372941</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2025-01-01T22:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954872#M372942</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, The reason behind it is that the data is blinded now, So every time, we have to check which model will be suitable when new data is delivered. To check data every time, I created a macro to check&amp;nbsp; (gatekeeping). My gate-keeping code causes the warnings in logs.&amp;nbsp; If I know the data I will run the code separate and choose the right method.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure what the blinded status has to do with this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know that the log MIGHT generate WARNING statements then add your own NOTE or WARNING to the LOG so that users will not be confused by the WARNING into thinking the code did not work properly.&amp;nbsp; Either generate the note before hand, or if you can detect the situations that generate the warning after the fact then conditionally generate the note when it applies.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954872#M372942</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-01T22:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954875#M372943</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, The reason behind it is that the data is blinded now, So every time, we have to check which model will be suitable when new data is delivered. To check data every time, I created a macro to check&amp;nbsp; (gatekeeping). My gate-keeping code causes the warnings in logs.&amp;nbsp; If I know the data I will run the code separate and choose the right method.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure I grasp what you are trying to say. But in any event, I still feel there might be (or might not be) underlying ethics issues here, and so I'm just going to stay out of this discussion.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jan 2025 22:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954875#M372943</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-01-01T22:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954876#M372944</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;, thank you for your inputs.  I agree with both of you. I was thinking of clean log but what I forgot was ,it kind of hiding the information. Tha k you for sharing your thoughts. I will close this discussion.</description>
      <pubDate>Wed, 01 Jan 2025 23:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954876#M372944</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2025-01-01T23:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to output specific part of 'Code'  log into different log file ( Is it possible)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954878#M372945</link>
      <description>&lt;A href="https://blogs.sas.com/content/iml/2019/04/03/g-matrix-is-not-positive-definite.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2019/04/03/g-matrix-is-not-positive-definite.html&lt;/A&gt;</description>
      <pubDate>Thu, 02 Jan 2025 01:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-specific-part-of-Code-log-into-different-log-file/m-p/954878#M372945</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-02T01:23:01Z</dc:date>
    </item>
  </channel>
</rss>

