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;