BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Thalitacosta
Obsidian | Level 7
I have an "X" and "Y" database, in which they were supposed to be the same, but in "X there are more observations than in "Y". To better understand how observations over "X", I want to create a new database wich just those observations. Does anyone know the codes to do this?
1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Are X and Y in different data sets? If so, I suggest you use PROC COMPARE to compare the variables. Here is an example:

 

data A;
do x = 1 to 10;
   output;
end;
run;

data B;
input x @@;
datalines;
1 2 3 4 6 5 
;

proc compare base=A(keep=x) compare=B(keep=x);
run;

View solution in original post

1 REPLY 1
Rick_SAS
SAS Super FREQ

Are X and Y in different data sets? If so, I suggest you use PROC COMPARE to compare the variables. Here is an example:

 

data A;
do x = 1 to 10;
   output;
end;
run;

data B;
input x @@;
datalines;
1 2 3 4 6 5 
;

proc compare base=A(keep=x) compare=B(keep=x);
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 669 views
  • 2 likes
  • 2 in conversation