Hi ,
My code wants to find whether string1(smq) is in the string2(AEDECOD) or not?
which doesn't work normally, why? how to change the code?
************smq list***********
SMQ
**bleep** fissure haemorrhage
**bleep** haemorrhage
**bleep** ulcer haemorrhage
Anastomotic haemorrhage
Anastomotic ulcer haemorrhage
......
;
**********what I have**********;
data have;
input subjid $ 1-7 aeseq 9 aestdtc $ 13-21 AEDECOD $ 25-57;
cards;
01-004 1 2018/10/8 Anaemia
01-004 2 2018/10/8 Hyperkalaemia
01-004 3 2018/10/8 Peritoneal dialysis complication
01-006 1 2018/11/27 Blood phosphorus increased
01-007 1 2018/12/18 Faeces discoloured
01-016 1 2019/3/26 Diarrhoea
01-016 2 2019/3/29 Diarrhoea
01-018 1 2019/4/16 Arteriovenous fistula occlusion
01-018 2 2019/3/13 Faeces discoloured
01-018 3 2019/4/16 Hyperparathyroidism
01-018 4 2019/4/24 Rash
01-020 1 2019/3/19 Pruritus generalised
01-031 1 2019/6/13 Constipation
01-032 1 2019/7/20 Mouth ulceration
01-033 1 2019/8/12 Herpes zoster
01-037 1 2019/8/8 Vertigo
01-040 1 2019/8/9 Diarrhoea
01-040 2 2019/8/30 Insomnia
01-042 1 2019/9/11 Faeces discoloured
01-043 1 2019/9/11 Faeces discoloured
;
run;
***here just list three kinds of smq to test the code;
%let smq=**bleep** fissure haemorrhage/**bleep** haemorrhage/**bleep** ulcer haemorrhage/;
***find the smq in the AEDECOD;
%macro find_smq(in, out);
data &out;
set ∈
if find("&smq",AEDECOD,"i") or index("&smq",AEDECOD) then AESIFL="Y";
if AESIFL="Y";
run;
%mend;
%find_smq(have, want);
... View more