BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is there a way we can persuade the normal output from proc compare to be nicely formatted. I don't mean taking output datasets and laying out their printing, but just from the native running of proc compare.
The procedure produces tables of comparison that look like candidates for the ODS approach.

PeterC
3 REPLIES 3
JuanVte
Calcite | Level 5
Hi PeterC,

I don't know any way to do that but it is true that this procedure output is awful. I have thought several times about to create a macro in order to do this task with a nicer output but it is still in my to do list.

Now, I am quite busy but if you are interested in doing that maybe we could arrange something!

Or perhaps somebody in this forum has already done it? 😉

Best regards,
Juanvte.
deleted_user
Not applicable
Juanvte
thank you, but ...

SAS9.2 documentation indicates PROC COMPARE supports ODS. I wouldn't recommend investing your time (or mine) on building this solution with such a short pay-back period.

PeterC
Sheri
Calcite | Level 5
Thanks for the ODS tip. I got very readable output with the code below:

PROC COMPARE BASE=Testfil.CurrentSCIP COMPARE=Testfil.NewSCIP OUTNOEQUAL
OUT=COMP OUTSTATS=COMPSTAT
BRIEF MAXPRINT=1 NOVALUES OUTNOEQUAL;
VAR SCIP1_d SCIP1_n SCIP2_d SCIP2_n SCIP3_d SCIP3_n n;
BY Patient_ID;
run;

ODS RTF FILE='L:\CoreMeasures\SCIP\Compare.RTF';
PROC PRINT DATA=COMP;
RUN;
ODS RTF CLOSE;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1499 views
  • 0 likes
  • 3 in conversation