BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Salah
Quartz | Level 8

Hi

 

I am so desperate to find a way to stop (NOTE: GCONV convergence criterion satisfied) 
from showing up in my log file. I tried some options with no luck, 

options nonotes;
proc iml;

......

options notes;

quit

I also tried %odsoff. The problem is that it is very time-consuming when I am using 10,000 simulations and 500 bootstraps. 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Great. That shows that 
OPTIONS NONOTES;

is working correctly. You can use it in conjunction with other statements that suppress output during your simulation.

View solution in original post

10 REPLIES 10
quickbluefish
Barite | Level 11

There is probably some simple way, but if you're desperate, you could use PROC PRINTTO to redirect the log (right before your IML step) to a separate file (e.g., iml_log.txt), then read in that text file with DATA _NULL_ and use PUT statements to write out all lines that do not contain the offensive message.

 

Something like:

 

** other code here... ;

* redirect log for the IML step;
proc printto log="/your/dir/iml_log.txt"; run;

proc IML;
...;
quit;

* redirect log back to default;
proc printto; run;

* read in your IML log ;
filename iml "/your/dir/iml_log.txt";

* conditionally write out messages from your IML log to the default log ;
data _null_;
infile iml dsd truncover firstobs=1;
length logline $500;
input logline;
if logline^="NOTE: GCONV convergence criterion satisfied" then put logline;
run;

 

Salah
Quartz | Level 8

Thank you for your reply. I prefer a shorter way if there is any? I used to use %odson and %odsoff, and it was working fine. I am just so surprised that it stops working, and I don't know why?

quickbluefish
Barite | Level 11
Are you just trying to turn the log completely off for the IML steps, or do you just want to suppress that particular message? And are you running multiple PROC IML steps in your code, or just one?
Salah
Quartz | Level 8

Just GCONV convergence criterion satisfied.

quickbluefish
Barite | Level 11

You can just create your own versions of those macros, I guess, store them somewhere, and %include them in your programs that contain IML steps.

 

** the macros (note they've been given default values so the calls are simpler - change as needed) ;

%macro odsoff2(outdir=%str(/home/xxxxx/sasuser.v94));
	proc printto log="&outdir/_templog.txt" new; run;
%mend; *odsoff2;

%macro odson2(
	indir=%str(/home/xxxxx/sasuser.v94), 
	ignorelist=Division by zero detected|Some other message to ignore|Another msg
	);
	proc printto; run;
	filename tlog "&indir/_templog.txt";
	data _null_;
	infile tlog dsd truncover firstobs=1;
	length logline $500;
	input logline;
	%if %length(&ignorelist) %then %do;
		%let csv=%sysfunc(tranwrd("%sysfunc(tranwrd(%cmpres(&ignorelist),|,%str(,)))",%str(,),%str(",")));
		array T {%sysfunc(countW(&ignorelist,|))} $500 _temporary_ (&csv);
		isOK=1;
		do i=1 to dim(T);
			if prxmatch(cats("/" || strip(T[i]) || "/i"),logline) then do;
				isOK=0;
				leave;
			end;
		end;
		if isOK then put logline;
	%end;
	run;
%mend;

** testing them (in another program) ;

%include "/home/xxxx/sasuser.v94/ods_onoff.sas";

data test;
do i=1 to 5;
	y=ranuni(0);
	output;
end;
run;

%odsoff2;

data no_log;
do i=1 to 15;
	x=i/mod(i,3);  * this will produce some division by zero notes ;
	output;
end;
run;

%odson2;

data more;
do i=1 to 10;
	x=ranuni(0);
	output;
end;
run;

** take a look at the log - there should be no 'Division by zero' type notes.  But if you highlight and run that specific data step (DATA NO_LOG...), you will get those notes.

Rick_SAS
SAS Super FREQ

OPTIONS NONOTES;

should turn off all notes. Here is an example from the documentation, along with the SAS log. You can see that there are no notes associated with the optimization in the log:

 

proc iml;
start F_ROSEN(x);
   y1 = 10 * (x[2] - x[1] * x[1]);
   y2 =  1 - x[1];
   f  = 0.5 * (y1 * y1 + y2 * y2);
   return(f);
finish F_ROSEN;
x = {-1.2 1};
opt = {0 2 . 2};

option nonotes;
do i = 1 to 10;
   call nlpqn(rc, xr, "F_ROSEN", x, opt);
end;
options notes;
quit;
8985  proc iml;
NOTE: IML Ready
8986  start F_ROSEN(x);
8987     y1 = 10 * (x[2] - x[1] * x[1]);
8988     y2 =  1 - x[1];
8989     f  = 0.5 * (y1 * y1 + y2 * y2);
8990     return(f);
8991  finish F_ROSEN;
NOTE: Module F_ROSEN defined.
8992  x = {-1.2 1};
8993  opt = {0 2 . 2};
8994
8995  option nonotes;
8996  do i = 1 to 10;
8997     call nlpqn(rc, xr, "F_ROSEN", x, opt);
8998  end;
8999  options notes;
9000  quit;
NOTE: Exiting IML.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.10 seconds
      cpu time            0.06 seconds

If you are seeing something different, then please provide a sample log (for a small number of simulations) and the details about how you are submitting SAS: EG? SAS Studio? ODA? Batch? etc

Salah
Quartz | Level 8

Thank you for your reply. I did use the 

options nonotes;
options notes;

but unfortunately, it didn't work. This makes me wonder if there's something in my code that's preventing it from working. 

Rick_SAS
SAS Super FREQ

Run exactly the code I sent you and report your log.

Salah
Quartz | Level 8

I ran your code, and my log is an exact replica of yours.

Rick_SAS
SAS Super FREQ

Great. That shows that 
OPTIONS NONOTES;

is working correctly. You can use it in conjunction with other statements that suppress output during your simulation.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 10 replies
  • 178 views
  • 1 like
  • 3 in conversation