*************************************************************************************************; * * CLIENT: ModernaTX, Inc. * PROTOCOL: mRNA-1273-P201 * * PURPOSE: Create analysis dataset adsl * * INPUT FILES: SDTM domains * OUTPUT FILES: adsl.sas7bdat * * USAGE NOTES: * *************************************************************************************************; * Copyright 2020 Pharmaceutical Product Development, Inc. * All Rights Reserved. *************************************************************************************************; options noquotelenmax; **Assign global macro variable DSETNAME to reflect the name of the final ADaM dataset**; %global DSETNAME; %let dsetname = adsl; %include "_adsl_vars_.sas"; proc sort data=final dupout=dup nodup; by usubjid subjid; run; *** Dosing compliance and Dosing error; data doseerr_ex; merge final (keep=usubjid subjid arm actarm) trans.ex; by usubjid; length treat $25; if exdose=. then do; if exdostxt in ('>0-25','>25-<50', '>50-75') then exdose=50; else if exdostxt in ('>75-<100', '>100-125') or index(EXDOSTXT,'>125') then exdose=100; end; if extrt='PLACEBO' then do; treat='Placebo'; treatn=1; end; else if exdose=50 then do; treat='mRNA-1273 50 ug'; treatn=2; end; else if exdose=100 then do; treat='mRNA-1273 100 ug'; treatn=3; end; run; *** Dosing error; data doseerr; set doseerr_ex; if upcase(arm) ne upcase(treat) or exdostxt ne '' then doserofl='Y'; else doserofl='N'; keep usubjid subjid doserofl; run; proc sort data=doseerr out=doseerr_sub (keep=usubjid subjid doserofl) nodupkey; by subjid; where doserofl='Y'; run; *** Dosing compliance; /*a) both TRT01P and TRT01A are 'Placebo'; or*/ /*b) both TRT01P and TRT01A are 'mRNA-1273 50 ug' and there is no record in EX where EXTRT is 'Placebo' or (EXTRT is 'mRNA-1273' and EXDOSTXT contains '>0-25 ug', '>75-<100 ug' or '>100-125 ug', or '>125 ug or above'); or*/ /*c) both TRT01P and TRT01A are 'mRNA-1273 100 ug' and there is no record in EX where EXTRT is 'Placebo' or (EXTRT is 'mRNA-1273' and EXDOSTXT contains'>0-25 ug', '>25-<50 ug' or >50-75 ug'); */ data dosecompfl; set doseerr_ex; if actarm ne arm then dosecompfl='Y'; else if actarm=arm then do; if actarm='mRNA-1273 50 ug' then do; if EXTRT='PLACEBO' then dosecompfl='Y'; else if EXTRT='mRNA-1273' and (index(EXDOSTXT,'>0-25') or index(EXDOSTXT,'>75-<100') or index(EXDOSTXT,'>100-125') or index(EXDOSTXT,'>125')) then dosecompfl='Y'; end; if actarm='mRNA-1273 100 ug' then do; if EXTRT='PLACEBO' then dosecompfl='Y'; else if EXTRT='mRNA-1273' and (index(EXDOSTXT,'>0-25') or index(EXDOSTXT,'>25-<50') or index(EXDOSTXT,'>50-75') or index(EXDOSTXT,'>125')) then dosecompfl='Y'; end; end; if dosecompfl='Y' then doseerrs='Dosing error'; run; proc sort data=dosecompfl out=dosecompfl_sub (keep=usubjid subjid dosecompfl doseerrs) nodupkey; by subjid; where dosecompfl='Y'; run; *** Check ACTARM; proc sort data=doseerr_ex; by usubjid treatn; run; data actarm_chk; set doseerr_ex; by usubjid treatn; if last.usubjid; run; data actarm_chk_sub; set actarm_chk; if actarm ne treat; _war='Put Aler'||'t_R: ACTARM is not derived correctly.'; put _war subjid= ; run; data ex_chk; merge trans.ex actarm_chk_sub (in=a keep=usubjid actarm); by usubjid; if a; run; *** PP_LISTING; proc sql noprint; create table ppbabfl as select distinct usubjid,subjid,'Y' as PPBABFL from adb.pp_list where pvsbabfl='Y' order by usubjid,subjid; create table ppnabfl as select distinct usubjid,subjid,'Y' as PPNABFL from adb.pp_list where pvsnabfl='Y' order by usubjid,subjid; create table ppnab2fl as select distinct usubjid,subjid,'Y' as PPNAB2FL from adb.pp_list2 where pvsnabfl='Y' order by usubjid,subjid; create table _dvbabfl as select distinct usubjid,subjid,'Y' as _dvbabfl from adb.pp_list where pbabpdfl='Y' order by usubjid,subjid; create table _dvnabfl as select distinct usubjid,subjid,'Y' as _dvnabfl from adb.pp_list where pnabpdfl='Y' order by usubjid,subjid; select max(count(pbabreas,';')) into:_babn from adb.pp_list; select max(count(pnabreas,';')) into:_nabn from adb.pp_list; quit; %macro pp_listing; proc sort tagsort data=adb.pp_list out=pp_listing(keep=usubjid subjid pbabreas pnabreas); by usubjid subjid; run; data pp_listing2; length _war $200; set pp_listing; by usubjid subjid; array babn (%eval(&_babn.+1)) $200 _babn1 - _babn%eval(&_babn.+1); %do i=1 %to %eval(&_babn.+1); pbabreas = tranwrd(pbabreas,',',';'); _babn&i. = strip(scan(pbabreas,&i.,';')); if _babn&i.="Did not meet all eligibility criteria" then _b&i. = 1; else if _babn&i.="Did not receive Vaccination#1" then _b&i. = 2; else if _babn&i.="Did not receive Vaccination #2" then _b&i. = 3; else if _babn&i.="Did not receive Vaccination#2" then _b&i. = 3; else if _babn&i.="Vaccination #2 out of window" then _b&i. = 4; else if _babn&i.="There was no immunogenicity result at corresponding visit" then _b&i. = 5; else if _babn&i.="Serum collection out of window" then _b&i. = 6; else if _babn&i.="Not in Full Analysis Set" then _b&i. = 7; else if _babn&i.="Other study deviation" then _b&i. = 8; else if _babn&i.="COVID-19 infection at baseline" then _b&i. = 9; else if _babn&i.="Post-baseline COVID-19 infection prior to the visit" then _b&i. = 10; else if _babn&i.="Non study COVID-19 vaccine prior to the visit" then _b&i. = 11; else if _babn&i.="COVID-19 related prohibited med prior to the visit" then _b&i. = 12; else if ^missing(_babn&i.) then do; _war='Put Aler'||'t_R: PBABERS needs udpate.'; put _war subjid=; put _war _babn&i.=; end; %end; array nabn (%eval(&_nabn.+1)) $200 _nabn1 - _nabn%eval(&_nabn.+1); %do i=1 %to %eval(&_nabn.+1); pnabreas = tranwrd(pnabreas,',',';'); _nabn&i. = strip(scan(pnabreas,&i.,';')); if _nabn&i.="Did not meet all eligibility criteria" then _n&i. = 1; else if _nabn&i.="Did not receive Vaccination#1" then _n&i. = 2; else if _nabn&i.="Did not receive Vaccination#2" then _n&i. = 3; else if _nabn&i.="Did not receive Vaccination #2" then _n&i. = 3; else if _nabn&i.="Vaccination #2 out of window" then _n&i. = 4; else if _nabn&i.="There was no immunogenicity result at corresponding visit" then _n&i. = 5; else if _nabn&i.="Serum collection out of window" then _n&i. = 6; else if _nabn&i.="Not in Full Analysis Set" then _n&i. = 7; else if _nabn&i.="Other study deviation" then _n&i. = 8; else if _nabn&i.="COVID-19 infection at baseline" then _n&i. = 9; else if _nabn&i.="Post-baseline COVID-19 infection prior to the visit" then _n&i. = 10; else if _nabn&i.="Non study COVID-19 vaccine prior to the visit" then _n&i. = 11; else if _nabn&i.="COVID-19 related prohibited med prior to the visit" then _n&i. = 12; else if ^missing(_nabn&i.) then do; _war='Put Aler'||'t_R: PNABERS needs udpate.'; put _war subjid= ; put _war _nabn&i.=; end; %end; run; data pp_bab pp_nab; set pp_listing2; %do i=1 %to %eval(&_babn.+1); _bab = _babn&i.; _babn = _b&i.; output pp_bab; %end; %do i=1 %to %eval(&_nabn.+1); _nab = _nabn&i.; _nabn = _n&i.; output pp_nab; %end; run; %mend pp_listing; %pp_listing; proc sort tagsort data=pp_bab out=bab0(keep=usubjid subjid _bab _babn) nodupkey; by usubjid subjid _babn; where ^missing(_bab); run; data bab; length retain_bab $200; set bab0; by usubjid subjid; retain retain_bab; if first.subjid then retain_bab = _bab; else retain_bab = catx('; ',retain_bab,_bab); if last.subjid then output; run; proc sort tagsort data=pp_nab out=nab0(keep=usubjid subjid _nab _nabn) nodupkey; by usubjid subjid _nabn; where ^missing(_nabn); run; data nab; length retain_nab $200; set nab0; by usubjid subjid; retain retain_nab; if first.subjid then retain_nab = _nab; else retain_nab = catx('; ',retain_nab,_nab); if last.subjid then output; run; proc sort tagsort data=final; by usubjid subjid; run; data ppd29 (keep=usubjid subjid ppbd29fl ppnd29fl PPBD29ER PPND29ER); set adb.pp_list; if visittpt='Day 29'; rename pvsbabfl=ppbd29fl pvsnabfl=ppnd29fl pbabreas=PPBD29ER pnabreas=PPND29ER; run; data ppd57 (keep=usubjid subjid ppbd57fl ppnd57fl PPBD57ER PPND57ER); set adb.pp_list; if visittpt='Day 57'; rename pvsbabfl=ppbd57fl pvsnabfl=ppnd57fl pbabreas=PPBD57ER pnabreas=PPND57ER; run; data ppd209 (keep=usubjid subjid pbd209fl pnd209fl PBD209ER PND209ER); set adb.pp_list; if visittpt='Day 209'; rename pvsbabfl=pbd209fl pvsnabfl=pnd209fl pbabreas=PBD209ER pnabreas=PND209ER; run; /*PP nAb 2*/ %macro pp_listing2; proc sort tagsort data=adb.pp_list2 out=pp_listing (keep=usubjid subjid pnabreas); by usubjid subjid; run; data pp_listing2; length _war $200; set pp_listing; by usubjid subjid; array nabn (%eval(&_nabn.+1)) $200 _nabn1 - _nabn%eval(&_nabn.+1); %do i=1 %to %eval(&_nabn.+1); pnabreas = tranwrd(pnabreas,',',';'); _nabn&i. = strip(scan(pnabreas,&i.,';')); if _nabn&i.="Did not meet all eligibility criteria" then _n&i. = 1; else if _nabn&i.="Did not receive Vaccination#1" then _n&i. = 2; else if _nabn&i.="Did not receive Vaccination#2" then _n&i. = 3; else if _nabn&i.="Did not receive Vaccination #2" then _n&i. = 3; else if _nabn&i.="Vaccination #2 out of window" then _n&i. = 4; else if _nabn&i.="There was no immunogenicity result at corresponding visit" then _n&i. = 5; else if _nabn&i.="Serum collection out of window" then _n&i. = 6; else if _nabn&i.="Not in Full Analysis Set" then _n&i. = 7; else if _nabn&i.="Other study deviation" then _n&i. = 8; else if _nabn&i.="COVID-19 infection at baseline" then _n&i. = 9; else if _nabn&i.="Post-baseline COVID-19 infection prior to the visit" then _n&i. = 10; else if _nabn&i.="Non study COVID-19 vaccine prior to the visit" then _n&i. = 11; else if _nabn&i.="COVID-19 related prohibited med prior to the visit" then _n&i. = 12; else if ^missing(_nabn&i.) then do; _war='Put Aler'||'t_R: PNABERS needs udpate.'; put _war subjid= ; put _war _nabn&i.=; end; %end; run; data pp_nab2; set pp_listing2; %do i=1 %to %eval(&_nabn.+1); _nab2 = _nabn&i.; _nab2n = _n&i.; output pp_nab2; %end; run; %mend pp_listing2; %pp_listing2; proc sort tagsort data=pp_nab2 out=nab20(keep=usubjid subjid _nab2 _nab2n) nodupkey; by usubjid subjid _nab2n; where ^missing(_nab2n); run; data nab2; length retain_nab2 $200; set nab20; by usubjid subjid; retain retain_nab2; if first.subjid then retain_nab2 = _nab2; else retain_nab2 = catx('; ',retain_nab2,_nab2); if last.subjid then output; run; data pp2d29 (keep=usubjid subjid pn2d29fl PN2D29ER); set adb.pp_list2; if visittpt='Day 29'; rename pvsnabfl=pn2d29fl pnabreas=PN2D29ER; run; data pp2d57 (keep=usubjid subjid pn2d57fl PN2D57ER); set adb.pp_list2; if visittpt='Day 57'; rename pvsnabfl=pn2d57fl pnabreas=PN2D57ER; run; data pp2d209 (keep=usubjid subjid pn2209fl PN2209ER); set adb.pp_list2; if visittpt='Day 209'; rename pvsnabfl=pn2209fl pnabreas=PN2209ER; run; proc sort tagsort data=final; by usubjid subjid; run; data adsl; length PPBABERS PPNABERS PPNAB2ER $200; merge final(in=a) ppbabfl ppnabfl ppnab2fl _dvbabfl _dvnabfl bab nab nab2 dosecompfl_sub doseerr_sub ppd29 ppd57 ppd209 pp2d29 pp2d57 pp2d209; by usubjid subjid; if a; * PP_LISTING and Dosing error; if doserofl='' then doserofl='N'; * EX Reason for dosing error; if dosecompfl='Y' then do; retain_bab=catx('; ',doseerrs, retain_bab); retain_nab=catx('; ',doseerrs, retain_nab); retain_nab2=catx('; ',doseerrs, retain_nab2); PPBD29ER=catx('; ',doseerrs, PPBD29ER); PPBD57ER=catx('; ',doseerrs, PPBD57ER); PBD209ER=catx('; ',doseerrs, PBD209ER); PPND29ER=catx('; ',doseerrs, PPND29ER); PPND57ER=catx('; ',doseerrs, PPND57ER); PND209ER=catx('; ',doseerrs, PND209ER); PN2D29ER=catx('; ',doseerrs, PN2D29ER); PN2D57ER=catx('; ',doseerrs, PN2D57ER); PN2209ER=catx('; ',doseerrs, PN2209ER); end; * Per Protocol bAb/nAb Population Flag; if missing(PPBABFL) or dosecompfl='Y' then PPBABFL = 'N'; if missing(PPNABFL) or dosecompfl='Y' then PPNABFL = 'N'; if dosecompfl='Y' then do; ppbd29fl = 'N'; ppbd57fl = 'N'; pbd209fl = 'N'; ppnd29fl = 'N'; ppnd57fl = 'N'; pnd209fl = 'N'; pn2d29fl = 'N'; pn2d57fl = 'N'; pn2209fl = 'N'; end; * Per Protocol nAb Sensitivity Population Flag; if missing(PPNAB2FL) or dosecompfl='Y' then PPNAB2FL = 'N'; * Deviation Impact bAb/nAb Flag; if ppbabfl='N' and _dvbabfl='Y' then DVBABFL = 'Y'; else DVBABFL = 'N'; if ppnabfl='N' and _dvnabfl='Y' then DVNABFL = 'Y'; else DVNABFL = 'N'; * Reason for BAB/NAB Per-Protocol Set Exc; if randfl='Y' and ppbabfl='N' then PPBABERS = retain_bab; if randfl='Y' and ppnabfl='N' then PPNABERS = retain_nab; if randfl='Y' and ppnab2fl='N' then PPNAB2ER = retain_nab2; *Day 29 outside +7 days window; if nmiss(DOSE2DT, TR01SDT)=0 and DOSE2DT-TR01SDT+1>36 then D29W7DFL='Y'; else D29W7DFL = 'N'; drop _:; run; %put &COHORT_1_2_SENTIAL.; %macro cutoff(); data adsl; set adsl; %if &COHORT_1_2_SENTIAL.=Y %then %do; if agegr1n=1 or (agegr1n=2 and sentlfl='Y'); %end; run; %mend cutoff; %cutoff; proc sql; select distinct usubjid,subjid,count(*) as n from adsl group by usubjid,subjid having n>1; quit; **Generate final dataset by updating certain attributes. Optionally merge common variables & create sequence variable as needed**; %adam_dataset_update( ds=&DSETNAME, libin=work, libout=output, adsllib=adb, addcomvar=N, addseq=, dropinfmt=Y, mapspecfile=&ADAM_SPEC, maploc=&ADAM_SPEC_LOC, debug=N ); **Generate Value Level Metadata values for the ad 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 );