10-09-2017 11:58 AM
I have been using Proc Compare for a long time and I kind of ignoring this issue...
For clinical trials, USUBJID can be long as 20+ but I have to use USUBJID as ID variable when I use Proc Compare.
I am using linesize as 155 so there are plenty of blank space in my output. However, Proc Compare uses only limited length for ID value, Base value, and Compare value like 20. Is there any option or simple way to extend the length?
Yes, I know I can use OUT= option but it is much easier to use side-by-side comparison for so many variables for clinical trials data. I know, I know, I can transpose the OUT data, but I am a lazy guy to list all the variables. For validation purpose, I have to check all variables in both data and it can be 100+ variables. I also tried format the ID variable but no effect.
For ID statement, I can split the variable into 2 and use both to ID statement and work, but that will not be the ultimate solution.
If there is easy solution for this, please let me know. Or is there any future SAS Institute plan to enhance this issue? I have been using SAS for more than 30 years but it's hard to believe if SAS Institute hasn't come up with any simple solution.
10-09-2017 01:20 PM
Please provide a small dummy data example, incorporated into a DATA step with INPUT statement, and a PROC COMPARE that demonstrates the problem.
10-09-2017 01:50 PM
10-09-2017 02:49 PM
10-09-2017 05:02 PM
Thanks, but ODS output is not much different than using OUT= option.
Yeah, the main issue is that it's hard for me to see what is actually different from the reports since Proc Compare print out 20 characters. I have to check source data to confirm or using OUT= option to see each chopped variables.
Too much work for me. I wish I can use format or length to control the reports just like Proc Print.
10-13-2017 07:14 PM
I regularly deal with ID variables that are 21 characters long. I don't use PROC COMPARE, for the reasons you have mentioned.
Instead, I write a macro and use SASHELP.VCOLUMN to get the list of variables to compare.
proc sql; select b.usubjid, b.treat as base_treat, c.treat as compare_treat from base as b, compare c where b.usubjid=c.usubjid and base_treat ne compare_treat; quit;