Help using Base SAS procedures

Proc compare with no unique id

Reply
Contributor
Posts: 28

Proc compare with no unique id

Hi all,

I have a general question abour proc compare.

Is the output from proc compare correct when there is no row level unique id associated with the data but I do use a non-unique column as the ID? For example, if I have an Adverse Event dataset where there is no unique id defined but I use subject number as the ID - is the result of using subject number as the ID dependable? I can also manufacture an ID based on subject number,AE text and start date but this is not guarenteed to be unique 100% of the time.

Is there a way to create an ID across both base/compare datasets to resolve this problem?

Respected Advisor
Posts: 3,799

Re: Proc compare with no unique id

If you are doing QC of ADaM data for example use NO ID variable.  You should be able to create exact duplicate of ADAE and compare row by row.

Contributor
Posts: 28

Re: Proc compare with no unique id

Posted in reply to data_null__

Is "NO ID" an option or do you mean dont use an ID at all ? Smiley Happy

If no ID is defined how does the compare work?

Respected Advisor
Posts: 3,799

Re: Proc compare with no unique id

Don't use ID statement.  PROC COMPARE will compare record by record as if you said ID _N_; sort of.

If you are doing what I think you are, QCing ADaM data, I would use record level compare.  No ID statement.

Ask a Question
Discussion stats
  • 3 replies
  • 194 views
  • 0 likes
  • 2 in conversation