Hi,
I was wondering if there is a way to replace the Base and Compare values in the proc compare output, to enable easier review. Example - Base is replaced as QC, Compare is replaced as Production.
Thanks
something like this
%let mybase = thisone;
%let mycomp = thatone;
proc compare base=&mybase. compare=&mycomp.;
run;
if you are comparing to a production dataset the base should be assigned to the production table as a good rule of thumb.
that wont work. see the output below.
What I want is to replace that Base and Compare by QC and Production.
|| Planned Treatment for Period 01 (N)
|| Base Compare
USUBJID || TRT01PN TRT01PN Diff. % Diff
_________________ || _________ _________ _________ _________
that snippet of code doesn't look like SAS code.
A few links in how to do compressions using SAS are below with examples on the links.
https://www.sascrunch.com/proc-compare.html
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146741.htm
@shc1212 wrote:
that wont work. see the output below.
What I want is to replace that Base and Compare by QC and Production.
|| Planned Treatment for Period 01 (N)
|| Base Compare
USUBJID || TRT01PN TRT01PN Diff. % Diff
_________________ || _________ _________ _________ _________
Not easily, you could by modifying the template for the procedure but I highly suspect that's more work that it's worth. Instead, I would try to pipe the results to a data set, customize the names within the data set and then use PROC PRINT/REPORT to display the output.
You can create a small macro that does this easily.
%macro customCompare(source = , compare = );
proc compare base=&source. compare = &compare <other options as needed>;
....
run;
%mend customCompare;
And then you can call it each time as:
%customCompare(base = QC, compare=Production);
%customCompare(base = QC1, compare=Production2);
@shc1212 wrote:
Hi,
I was wondering if there is a way to replace the Base and Compare values in the proc compare output, to enable easier review. Example - Base is replaced as QC, Compare is replaced as Production.
Thanks
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.