Hi @RW9,
I know what you mean... let me clarify. I am programming SAS for several years now and still, I am learning new things. In this case however, I am sure, that I know exactly what I am doing.
As for your reference to merging. Please check the merge with multiple by values.
It might be personal preference, but for all SAS Programmers that I have been talking to, this is most inconvenient.
We tend to use SQL for most joins, which not only provides the expected results. It is also faster to implement and reasier to read. Only in rare cases we use the merge for its functionality and additional options within the data step. There are several papers out there, describing the pitfalls of the merge. (Yes, we do understand the merge, we just don't like it!)
Also, I know, that I could program the whole functionality myself in base code. My aspiration in this case is to understand some procedures a little bit better and use them when applicable. My thoughts are that the compare should fit for this problem only with the slight inconvenience of the warning message in the log.
The default proc compare behaviour is as follows (see this link, last paragraph):
Avoiding Duplicate ID Values
The observations in each data set should be uniquely labeled by the values of the ID variables. If PROC COMPARE finds two successive observations with the same ID values in a data set, then it does the following:
prints the warning Duplicate Observations for the first occurrence for that data set
prints the total number of duplicate observations found in the data set in the observation summary report
uses the duplicate observations in the base data set and the comparison data set to compare the observations on a one-to-one basis
Again, the proc compare does exactly the things I need for the given data, that I can't change. It also does perform as described in the documentation. My only question is: how do I suppress the warning? (since I know what I am doing)
Cheers,
mfab
... View more