BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sarah-R
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
SAS Super FREQ

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.                                         
 
To temporarily re-direct the log output using PROC PRINTTO (also suppressing all of the other log information generated by PROC COMPARE). For example:
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

 

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

2 REPLIES 2
SASJedi
SAS Super FREQ

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.                                         
 
To temporarily re-direct the log output using PROC PRINTTO (also suppressing all of the other log information generated by PROC COMPARE). For example:
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

 

Check out my Jedi SAS Tricks for SAS Users
Sajid01
Meteorite | Level 14

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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1173 views
  • 1 like
  • 3 in conversation