*************************************************************************************************; * * CLIENT: ModernaTX, Inc. * PROTOCOL: mRNA-1273-P301 * * PURPOSE: Create analysis dataset adeff2 * * INPUT FILES: SDTM domains * OUTPUT FILES: ADEFF2.sas7bdat * * USAGE NOTES: * *************************************************************************************************; * Copyright 2020 Pharmaceutical Product Development, Inc. * All Rights Reserved. *************************************************************************************************; options noquotelenmax; %include "madam.sas"; **Assign global macro variable DSETNAME to reflect the name of the final ADaM dataset**; %global DSETNAME; %let dsetname = adeff2; %let adslvar=randdt dthdt studyid tr01sdt; proc format; value $ param 'BOD7D' = 'Burden of Disease Score in 7 Days' 'BOI7D' = 'Burden of Infection Score in 7 Days' 'BOD28D' = 'Burden of Disease Score in 28 Days' 'BOI28D' = 'Burden of Infection Score in 28 Days'; value awranged 1 = 'Randomization through 6 Months' 2 = 'After 6 Months through 12 Months' 3 = 'After 12 Months through 18 Months' 4 = 'After 18 Months through Completion' ; value awrangei 1 = 'Baseline through Month 1' 2 = 'After Month 1 through Month 2' 3 = 'After Month 2 through Month 7' 4 = 'After Month 7 through Month 13' 5 = 'After Month 13 through Month 25' ; run; data _eff; set adb.adeff; where paramcd in ('COVIDA', 'ASYMPINF') and APERIOD = 1 and . < ADT <= EFFCODT; run; proc sort data=_eff tagsort;by paramcd usubjid adt;run; data eff1(keep=usubjid adt1 paramcd1 avalc1); set _eff(where=(paramcd='COVIDA')); by usubjid adt; if first.usubjid; rename adt=adt1 paramcd=paramcd1 avalc=avalc1; run; data eff2(keep=usubjid adt2 paramcd2 avalc2); set _eff(where=(paramcd='ASYMPINF')); by usubjid adt; if first.usubjid; rename adt=adt2 paramcd=paramcd2 avalc=avalc2; run; data adsl; set adb.adsl; where randfl='Y'; keep usubjid &adslvar.; run; data ho; set trans.HO; where hooccur='Y' and hostdtc^='' and hoterm^='MEDICALLY ATTENDED'; hostdt=input(hostdtc, yymmdd10.); keep usubjid hostdt; run; proc sort data=ho tagsort; by usubjid hostdt;run; proc sort data=eff1 out=e1(keep=usubjid adt1);by usubjid;run; proc sort data=eff2 out=e2(keep=usubjid adt2);by usubjid;run; data ho1; merge ho(in=a) e1(in=b); by usubjid; if a and b; run; data ho1(keep=usubjid hody1); set ho1; where hostdt>=adt1>.; if n(hostdt, adt1)=2 then hody1=hostdt-adt1+1; run; proc sort data=ho1;by usubjid hody1;run; proc sort data=ho1 nodupkey;by usubjid;run; data ho2; merge ho(in=a) e1 e2; by usubjid; if a; run; data ho2(keep=usubjid hody2); set ho2; adt=coalesce(adt1,adt2); if n(hostdt, adt)=2 then hody2=hostdt-adt+1; if hody2>=1; run; proc sort data=ho2;by usubjid hody2;run; proc sort data=ho2 nodupkey;by usubjid;run; data all; merge adsl(in=a) eff1 eff2 ho1 ho2; by usubjid; if a; run; data bod; length paramcd $8.; set all; adt=adt1; if n(randdt, adt)=2 then EVENTMO1=(ADT-RANDDT+1)/30.4375; if n(dthdt, adt)=2 then dthdy=dthdt-adt+1; do paramcd = 'BOD7D', 'BOD28D'; if EVENTMO1>=18 or missing(ADT) then do; do awrangen=1 to 4; output; end; end; else if EVENTMO1>=12 then do; do awrangen=1 to 3; output; end; end; else if EVENTMO1>=6 then do; do awrangen=1 to 2; output; end; end; else do; do awrangen=1; output; end; end; end; run; data bod2; set bod; tardt=input(compress(paramcd,,'kd'),2.); awrange=put(awrangen,awranged.); if awrangen=1 then do;low=0; high=6;end; if awrangen=2 then do;low=6; high=12;end; if awrangen=3 then do;low=12; high=18;end; if awrangen=4 then do;low=18;end; if awrangen<4 then do; if avalc1^=:'Y' or EVENTMO1>high>. then aval=0; else if .low then do; if avalc1=:'Y' and .=13 or missing(ADT) then do; do awrangen=1 to 5; output; end; end; else if EVENTMO2>=7 then do; do awrangen=1 to 4; output; end; end; else if EVENTMO2>=2 then do; do awrangen=1 to 3; output; end; end; else if EVENTMO2>=1 then do; do awrangen=1 to 2; output; end; end; else do; do awrangen=1; output; end; end; end; run; data boi2; set boi; tardt=input(compress(paramcd,,'kd'),2.); awrange=put(awrangen,awrangei.); if awrangen=1 then do;low=0; high=1;end; if awrangen=2 then do;low=1; high=2;end; if awrangen=3 then do;low=2; high=7;end; if awrangen=4 then do;low=7; high=13;end; if awrangen=5 then do;low=13; high=25;end; if avalct^=:'Y' or EVENTMO2>high>. then aval=0; else if . dataset**; %* dod_vlm( type=ADAM, selmems=&DSETNAME, excmems=, specloc=&ADAM_SPEC_LOC, specname=&ADAM_SPEC, debug=N ); **Generate Enhanced Controlled Terminology for the ad dataset**; %* dod_enhcd_ct( type=ADAM, selmems=&DSETNAME, excmems=, specloc=&ADAM_SPEC_LOC, specname=&ADAM_SPEC, map_ct_nm=, map_ct_loc=, debug=N );