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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 461 views
  • 1 like
  • 2 in conversation