When running a Proc Compare, I get the warning message: "WARNING: No matching observations were found."
Is there any way to suppress this log message?
The BASE and COMPARE data sets both have 0 observations each, but they do have similar columns and column attributes. I am interested in producing a Proc Compare output, but, also, have no warning message, at the same time.
There is no PROC COMPARE or SAS System option I am aware of that can suppress printing WARNING or ERROR messages to the log. @Sajid01 suggested reviewing SAS Usage Note 24487: Warning messages in the SAS® log cannot be suppressed. For example:
proc sql;
create table table1 like sashelp.cars(keep=Make--MSRP);
create table table2 like sashelp.cars(keep=Make--Origin Invoice);
quit;
proc compare base=table1 compare=table2;
run;
SAS Log:
54 proc compare base=table1 compare=table2; NOTE: Writing HTML Body file: sashtml7.htm 55 run; NOTE: No observations in data set WORK.TABLE1. NOTE: No observations in data set WORK.TABLE2. WARNING: No matching observations were found. NOTE: There were 0 observations read from the data set WORK.TABLE1. NOTE: There were 0 observations read from the data set WORK.TABLE2. NOTE: PROCEDURE COMPARE used (Total process time): real time 0.57 seconds cpu time 0.25 seconds
Results:
The COMPARE Procedure Comparison of WORK.TABLE1 with WORK.TABLE2 (Method=EXACT) Data Set Summary Dataset Created Modified NVar NObs WORK.TABLE1 16NOV23:07:22:23 16NOV23:07:22:23 6 0 WORK.TABLE2 16NOV23:07:22:23 16NOV23:07:22:23 5 0 Variables Summary Number of Variables in Common: 4. Number of Variables in WORK.TABLE1 but not in WORK.TABLE2: 2. Number of Variables in WORK.TABLE2 but not in WORK.TABLE1: 1. |
proc printto log=_temporary_;
run;
proc compare base=table1 compare=table2;
run;
proc printto;
run;
you get the same results, but the log is much more sparse:59 proc printto log=_temporary_; 60 run; NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.01 seconds
There is no PROC COMPARE or SAS System option I am aware of that can suppress printing WARNING or ERROR messages to the log. @Sajid01 suggested reviewing SAS Usage Note 24487: Warning messages in the SAS® log cannot be suppressed. For example:
proc sql;
create table table1 like sashelp.cars(keep=Make--MSRP);
create table table2 like sashelp.cars(keep=Make--Origin Invoice);
quit;
proc compare base=table1 compare=table2;
run;
SAS Log:
54 proc compare base=table1 compare=table2; NOTE: Writing HTML Body file: sashtml7.htm 55 run; NOTE: No observations in data set WORK.TABLE1. NOTE: No observations in data set WORK.TABLE2. WARNING: No matching observations were found. NOTE: There were 0 observations read from the data set WORK.TABLE1. NOTE: There were 0 observations read from the data set WORK.TABLE2. NOTE: PROCEDURE COMPARE used (Total process time): real time 0.57 seconds cpu time 0.25 seconds
Results:
The COMPARE Procedure Comparison of WORK.TABLE1 with WORK.TABLE2 (Method=EXACT) Data Set Summary Dataset Created Modified NVar NObs WORK.TABLE1 16NOV23:07:22:23 16NOV23:07:22:23 6 0 WORK.TABLE2 16NOV23:07:22:23 16NOV23:07:22:23 5 0 Variables Summary Number of Variables in Common: 4. Number of Variables in WORK.TABLE1 but not in WORK.TABLE2: 2. Number of Variables in WORK.TABLE2 but not in WORK.TABLE1: 1. |
proc printto log=_temporary_;
run;
proc compare base=table1 compare=table2;
run;
proc printto;
run;
you get the same results, but the log is much more sparse:59 proc printto log=_temporary_; 60 run; NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.01 seconds
Hello @Sarah-R
Please have a look at this http://support.sas.com/kb/24/487.html
As@SASJedi suggested you may forward the log output to an external file.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.