BookmarkSubscribeRSS Feed
Mikeyjh
Calcite | Level 5

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?

3 REPLIES 3
data_null__
Jade | Level 19

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.

Mikeyjh
Calcite | Level 5

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?

data_null__
Jade | Level 19

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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1519 views
  • 0 likes
  • 2 in conversation