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;

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