data work.old;
length id instance 8 group term term_2 $20;
input id group instance term term_2 ;
infile datalines dlm="," dsd;
datalines;
1, 1, 1, AAAA, one
1, 2 indirect, 2, CCCC, seven
1, 2 indirect, 3, DDDD, seven
2, 1, 1, ASFD, two
2, 2 indirect, 2, DDA, three
3, 2 direct, 1, ERQE, one
4, 1, 1, ABCD, seven
4, 1, 2, ABCD, five
;
data work.new;
length id instance 8 group term term_2 $20;
input id group instance term term_2 ;
infile datalines dlm="," dsd;
datalines;
1, 1, 1, AAAA, one
1, 2 indirect, 2, CCCC, seven
1, 2 indirect, 3, DDDD, seven
1, 2 indirect, 4, DFDD, two
2, 1, 1, ASFD, two
2, 2 indirect, 2, DDA, three
3, 2 direct, 1, ERQE, one
4, 1, 1, ABCD, seven
4, 1, 2, ABCD, five
4, 2 direct, 3, CCCC, one
5, 1, 1, ERQE, seven
;
data want;
if _n_=1 then do;
if 0 then set old;
declare hash h(dataset:'old');
h.definekey(all:'yes');
h.definedone();
end;
set new;
flagT=1;
if h.check()=0 then flagT=0;
run;
... View more