%macro mer(seq, select);
data lb1;
set lb;
seq=&seq;
run;
data supp;
set supplb;
if strip(qnam)=&select;
seq=input(idvarval,best.);
run;
proc sort data=lb1; by usubjid seq;
proc sort data=supp; by usubjid seq;
data test;
merge lb1(in=a) supp(in=b);
by usubjid seq;
if a & b;
run;
proc sort data = test out = test1
dupout = dups nodupkey;
by studyid rdomain usubjid idvar idvarval qnam qlabel qval qorig qeval;
run;
%mend;
data lb1;
set lb;
seq=&seq;
run;
data supp;
set supplb;
if strip(qnam)=&select;
seq=input(idvarval,best.);
run;
proc sort data=lb1; by usubjid seq;
proc sort data=supp; by usubjid seq;
data test;
merge lb1(in=a) supp(in=b);
by usubjid seq;
if a & b;
run;
proc sort data = test out = test1
dupout = dups nodupkey;
by studyid rdomain usubjid idvar idvarval qnam qlabel qval qorig qeval;
run;
%mend;
%mer(lbseq, 'CS');
No comments:
Post a Comment