BookmarkSubscribeRSS Feed
anandbillava
Fluorite | Level 6
Hi
Is there any comparision record identifier which can be seen in the output result set of proc compare
Basically comapre output will be like this

base
compare
dif
base
compare
dif
I want to have a record identifier for this comparision that will uniquely tell this is the nth comparision.
comparision number
base 1
compare 1
dif 1
base 2
compare 2
dif 2
base 3
base 4
compare 4
dif 4

Is this possible please let me know.
4 REPLIES 4
ArtC
Rhodochrosite | Level 12
Be sure to include the BY and/or the ID statements. These values will also be added to your output observations.

[pre]data diffclass;
set sashelp.class;
if _n_= 1 then age=age+1;
if _n_= 2 then delete;
if _n_= 3 then weight = weight*2;
run;

proc compare data=sashelp.class
compare=diffclass
out=cmprdat
outbase outcomp
noprint outnoequal;
id name;
run;
proc print data=cmprdat;
run;[/pre]
anandbillava
Fluorite | Level 6
No this gives the observation number of base and compare dataset.
This is not the comparision record number.
ArtC
Rhodochrosite | Level 12
I am sorry, but I do not understand what you are asking for. What is the comparison record number?
sivaji
Fluorite | Level 6
Question is not clear! could you elaborate on the same. thanks

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 932 views
  • 0 likes
  • 3 in conversation