BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PierreYvesILY
Pyrite | Level 9

hello,

 

I want to compare 2 datasets, and obtain a 3rd dataset where all observations different between both of them are listed.

- ORB_TAB_NPKENN : first dataset; it contains the second one entirely

- ORB_TAB_2: second dataset.

- DIFF_NPKENN: dataset that has to be produced, containing all the lines that are present in  ORB_TAB_NPKENN and absent in ORB_TAB_2.

 

I tried the following first, but I get a very weird result (it seems all variables are resetted or so). Only the names of the variables are correct.

I have no clue how I could perform the desired control.

 

/* TEST - comparaison ORB_TAB_NPKENN et ORB_TAB_2 */

proc compare base=orb_tab_npkenn out=diff_npkenn

compare=orb_tab_2;

run;

 

Result:

Diff_NPKENN.PNG

How should I proceed?

Thx in advance,

PY

1 ACCEPTED SOLUTION

Accepted Solutions
pau13rown
Lapis Lazuli | Level 10

try eg:

 

data check;

merge ORB_TAB_NPKENN (in=a) ORB_TAB_2 (in=b);

by ....;

if a and not b then output;

run;

View solution in original post

2 REPLIES 2
pau13rown
Lapis Lazuli | Level 10

try eg:

 

data check;

merge ORB_TAB_NPKENN (in=a) ORB_TAB_2 (in=b);

by ....;

if a and not b then output;

run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 537 views
  • 1 like
  • 2 in conversation