Sorry yes I guess I wasn't clear enough but after working through it this is the solution I wanted
data have;
input USUBJID $ LBSTNRC :$40. LBNRIND :$14. AVALC :$200.;
infile datalines dlm = '|';
datalines;
1001|Negative|NORMAL|Negative
1001|5.0, 6.0, 7.0, 8.0|NORMAL|6.0
1001|6.0, 7.0, 8.0, 9.0|NORMAL|7.0
1001|5.0, 6.0, 7.0, 8.0|NORMAL|5.0
1001|Negative|ABNORMAL|5
1001|None, Occasional, 1-2|NORMAL|Occasional
1001|None, Occasional, 1-5|NORMAL|None
;
data want;
length anrind $20.;
set have;
* ANRIND *;
if lbstnrc ne '' and index(lbstnrc,',')>0 then do;
if findw(lbstnrc,strip(avalc),', ',' ,')>0 then anrind ='Normal';
end;
else anrind ='Abnormal';
run;
... View more