ADAE
Adverse Events Analysis Dataset
OCCURRENCE DATA STRUCTURE · one record per subject per adverse event · keys USUBJID, AETERM, ASTDT, AESEQ
Variables
| Variable | Label | Type | Length | Derivation |
|---|---|---|---|---|
STUDYID | Study Identifier | text | Predecessor ADSL.STUDYID | |
SITEID | Study Site Identifier | text | Predecessor ADSL.SITEID | |
USUBJID | Unique Subject Identifier | text | Predecessor AE.USUBJID | |
TRTA | Actual Treatment | text | Predecessor ADSL.TRT01A | |
TRTAN | Actual Treatment (N) | integer | 8 | Predecessor ADSL.TRT01AN |
AGE | Age | integer | 8 | Predecessor ADSL.AGE |
AGEGR1 | Pooled Age Group 1 | text | Predecessor ADSL.AGEGR1 | |
AGEGR1N | Pooled Age Group 1 (N) | integer | 8 | Predecessor ADSL.AGEGR1N |
RACE | Race | text | Predecessor ADSL.RACE | |
RACEN | Race (N) | integer | 8 | Predecessor ADSL.RACEN |
SEX | Sex | text | Predecessor ADSL.SEX | |
SAFFL | Safety Population Flag | text | Predecessor ADSL.SAFFL | |
TRTSDT | Date of First Exposure to Treatment | integer | 8 | Predecessor ADSL.TRTSDT |
TRTEDT | Date of Last Exposure to Treatment | integer | 8 | Predecessor ADSL.TRTEDT |
ASTDT | Analysis Start Date | integer | 8 | AE.AESTDTC, converted to a numeric SAS date. Some events with partial dates are imputed in a conservative manner. If the day component is missing, a value of '01' is used. If both the month and day are missing no imputation is performed as these dates clearly indicate a start prior to the beginning of treatment. There are no events with completely missing start dates. |
ASTDTF | Analysis Start Date Imputation Flag | text | ASTDTF='D' if the day value within the character date is imputed. Note that only day values needed to be imputed for this study. | |
ASTDY | Analysis Start Relative Day | integer | 8 | IF ASTDT>=TRTSDT>MISSING then ASTDY=ASTDT-TRTSDT+1 Else if TRTSDT>ASTDT>MISSING then ASTDY=ASTDT-TRTSDT |
AENDT | Analysis End Date | integer | 8 | AE.AEENDTC, converted to a numeric SAS date |
AENDY | Analysis End Relative Day | integer | 8 | IF AENDT>=TRTSDT>MISSING then AENDY=AENDT-TRTSDT+1 Else if TRTSDT>AENDT>MISSING then AENDY=AENDT-TRTSDT |
ADURN | AE Duration (N) | integer | 8 | ADURN=AENDT-ASTDT+1 |
ADURU | AE Duration Units | text | If ADURN is not missing then ADURU='DAY' | |
AETERM | Reported Term for the Adverse Event | text | Predecessor AE.AETERM | |
AELLT | Lowest Level Term | text | Predecessor AE.AELLT | |
AELLTCD | Lowest Level Term Code | integer | 8 | Predecessor AE.AELLTCD |
AEDECOD | Dictionary-Derived Term | text | Predecessor AE.AEDECOD | |
AEPTCD | Preferred Term Code | integer | 8 | Predecessor AE.AEPTCD |
AEHLT | High Level Term | text | Predecessor AE.AEHLT | |
AEHLTCD | High Level Term Code | integer | 8 | Predecessor AE.AEHLTCD |
AEHLGT | High Level Group Term | text | Predecessor AE.AEHLGT | |
AEHLGTCD | High Level Group Term Code | integer | 8 | Predecessor AE.AEHLGTCD |
AEBODSYS | Body System or Organ Class | text | Predecessor AE.AEBODSYS | |
AESOC | Primary System Organ Class | text | Predecessor AE.AESOC | |
AESOCCD | Primary System Organ Class Code | integer | 8 | Predecessor AE.AESOCCD |
AESEV | Severity/Intensity | text | Predecessor AE.AESEV | |
AESER | Serious Event | text | Predecessor AE.AESER | |
AESCAN | Involves Cancer | text | Predecessor AE.AESCAN | |
AESCONG | Congenital Anomaly or Birth Defect | text | Predecessor AE.AESCONG | |
AESDISAB | Persist or Signif Disability/Incapacity | text | Predecessor AE.AESDISAB | |
AESDTH | Results in Death | text | Predecessor AE.AESDTH | |
AESHOSP | Requires or Prolongs Hospitalization | text | Predecessor AE.AESHOSP | |
AESLIFE | Is Life Threatening | text | Predecessor AE.AESLIFE | |
AESOD | Occurred with Overdose | text | Predecessor AE.AESOD | |
AEREL | Causality | text | Predecessor AE.AEREL | |
AEACN | Action Taken with Study Treatment | text | Predecessor AE.AEACN | |
AEOUT | Outcome of Adverse Event | text | Predecessor AE.AEOUT | |
AESEQ | Sequence Number | integer | 8 | Predecessor AE.AESEQ |
TRTEMFL | Treatment Emergent Analysis Flag | text | If ASTDT >= TRTSDT > . then TRTEMFL='Y'. Otherwise TRTEMFL='N' | |
AOCCFL | 1st Occurrence of Any AE Flag | text | Subset to TRTEMFL='Y' and sort by Subject (USUBJID), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCCFL=?Y?) within each Subject | |
AOCCSFL | 1st Occurrence of SOC Flag | text | Subset to TRTEMFL='Y' and sort by Subject (USUBJID), System Organ Class (AEBODSYS), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCCSFL=?Y?) within each Subject and SOC | |
AOCCPFL | 1st Occurrence of Preferred Term Flag | text | Subset to TRTEMFL='Y' and sort by Subject (USUBJID), System Organ Class (AEBODSYS), Preferred Term (AEDECOD), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCCPFL=?Y?) within each Subject, SOC, and PT | |
AOCC02FL | 1st Occurrence 02 Flag for Serious | text | Subset to TRTEMFL='Y' and AESER='Y' and sort by Subject (USUBJID), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCC02FL=?Y?) within each Subject | |
AOCC03FL | 1st Occurrence 03 Flag for Serious SOC | text | Subset to TRTEMFL='Y' and AESER='Y' and sort by Subject (USUBJID), System Organ Class (AEBODSYS), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCC03FL=?Y?) within each Subject and SOC | |
AOCC04FL | 1st Occurrence 04 Flag for Serious PT | text | Subset to TRTEMFL='Y' and AESER='Y' and sort by Subject (USUBJID), System Organ Class (AEBODSYS), Preferred Term (AEDECOD), Start Date (ASTDT), and Sequence Number (AESEQ) and flag the first record (set AOCC04FL=?Y?) within each Subject, SOC, and PT |
Program adae.sas
Version 1, written from Clinwright's patterns, 2026-10-17, checks passed.
/*==== 00-header ====*/
/*----------------------------------------------------------------------------
Data set : ADAE (Adverse Events Analysis Dataset)
Reporting effort : CSR
SDTM : AE
ADaM : ADSL
The header and the finalize step follow from the specification.
----------------------------------------------------------------------------*/
libname sdtm "/work/sdtm" access=readonly;
libname adam "/work/adam";
options validvarname=upcase nofmterr msglevel=i;
/*==== 10-inputs ====*/
/* The AE records, with the subject's TRTSDT, TRTEDT, STUDYID, SITEID, TRT01A, TRT01AN, AGE, AGEGR1, AGEGR1N, RACE, RACEN, SEX, SAFFL from ADSL. */
proc sort data=sdtm.ae(keep=studyid usubjid aeseq aeterm aellt aelltcd aedecod aeptcd aehlt aehltcd aehlgt aehlgtcd aebodsys aesoc aesoccd aesev aeser aeacn aerel aeout aescan aescong aesdisab aesdth aeshosp aeslife aesod aestdtc aeendtc) out=work._ds; by usubjid; run;
proc sort data=adam.adsl(keep=usubjid trtsdt trtedt studyid siteid trt01a trt01an age agegr1 agegr1n race racen sex saffl) out=work._adsl; by usubjid; run;
data work._ds;
merge work._ds(in=_in) work._adsl;
by usubjid;
if _in;
length trta $200;
trta = trt01a;
trtan = trt01an;
run;
/* Copies typed as the specification has them. */
data work._ds; set work._ds(rename=(aelltcd=_aelltcd)); aelltcd = input(_aelltcd, ?? best32.); drop _aelltcd; run;
data work._ds; set work._ds(rename=(aeptcd=_aeptcd)); aeptcd = input(_aeptcd, ?? best32.); drop _aeptcd; run;
data work._ds; set work._ds(rename=(aehltcd=_aehltcd)); aehltcd = input(_aehltcd, ?? best32.); drop _aehltcd; run;
data work._ds; set work._ds(rename=(aehlgtcd=_aehlgtcd)); aehlgtcd = input(_aehlgtcd, ?? best32.); drop _aehlgtcd; run;
data work._ds; set work._ds(rename=(aesoccd=_aesoccd)); aesoccd = input(_aesoccd, ?? best32.); drop _aesoccd; run;
/*==== 30-timing ====*/
/* ASTDT: AE.AESTDTC as a SAS date; a date without its day takes the first one. */
data work._ds;
set work._ds;
length _dtc $10;
_dtc = aestdtc; /* (its first 10 characters: SUBSTR would complain of a shorter variable) */
if length(_dtc) = 10 then astdt = input(_dtc, ?? yymmdd10.);
else if length(_dtc) = 7 then do; /* yyyy-mm */
astdt = input(cats(_dtc, '-01'), ?? yymmdd10.);
end;
format astdt date9.;
drop _dtc;
run;
/* ASTDTF: what of ASTDT was imputed from AE.AESTDTC (set where ASTDT is imputed; see LSP-TIMING-DT). */
data work._ds;
set work._ds;
length astdtf $1;
if astdt > . then select (length(substr(aestdtc, 1, 10)));
when (10) astdtf = '';
when (7) astdtf = 'D';
when (4) astdtf = 'M';
otherwise astdtf = '';
end;
run;
/* ASTDY: day of ASTDT relative to TRTSDT; no day 0. */
data work._ds;
set work._ds;
if nmiss(astdt, trtsdt) = 0 then astdy = astdt - trtsdt + (astdt >= trtsdt);
run;
/* AENDT: AE.AEENDTC as a SAS date. */
data work._ds;
set work._ds;
length _dtc $10;
_dtc = aeendtc; /* (its first 10 characters: SUBSTR would complain of a shorter variable) */
if length(_dtc) = 10 then aendt = input(_dtc, ?? yymmdd10.);
format aendt date9.;
drop _dtc;
run;
/* AENDY: day of AENDT relative to TRTSDT; no day 0. */
data work._ds;
set work._ds;
if nmiss(aendt, trtsdt) = 0 then aendy = aendt - trtsdt + (aendt >= trtsdt);
run;
/* ADURN: from ASTDT to AENDT, in days, both days counted. */
data work._ds;
set work._ds;
if nmiss(astdt, aendt) = 0 then adurn = (aendt - astdt + 1);
run;
/*==== 60-flags ====*/
/* TRTEMFL: Y if ASTDT >= TRTSDT; otherwise N. */
data work._ds;
set work._ds;
length trtemfl $1;
if . < trtsdt <= astdt then trtemfl = 'Y';
else trtemfl = 'N';
run;
/* AOCCFL: the first event per subject where TRTEMFL='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y')) out=work._aoccfl(keep=usubjid astdt aeseq);
by usubjid astdt aeseq;
run;
data work._aoccfl;
set work._aoccfl;
by usubjid ;
if first.usubjid;
length aoccfl $1;
aoccfl = 'Y';
run;
proc sort data=work._ds; by usubjid astdt aeseq; run;
data work._ds;
merge work._ds work._aoccfl;
by usubjid astdt aeseq;
run;
/* AOCCSFL: the first event per subject and AEBODSYS where TRTEMFL='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y')) out=work._aoccsfl(keep=usubjid aebodsys astdt aeseq);
by usubjid aebodsys astdt aeseq;
run;
data work._aoccsfl;
set work._aoccsfl;
by usubjid aebodsys;
if first.aebodsys;
length aoccsfl $1;
aoccsfl = 'Y';
run;
proc sort data=work._ds; by usubjid aebodsys astdt aeseq; run;
data work._ds;
merge work._ds work._aoccsfl;
by usubjid aebodsys astdt aeseq;
run;
/* AOCCPFL: the first event per subject and AEBODSYS, AEDECOD where TRTEMFL='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y')) out=work._aoccpfl(keep=usubjid aebodsys aedecod astdt aeseq);
by usubjid aebodsys aedecod astdt aeseq;
run;
data work._aoccpfl;
set work._aoccpfl;
by usubjid aebodsys aedecod;
if first.aedecod;
length aoccpfl $1;
aoccpfl = 'Y';
run;
proc sort data=work._ds; by usubjid aebodsys aedecod astdt aeseq; run;
data work._ds;
merge work._ds work._aoccpfl;
by usubjid aebodsys aedecod astdt aeseq;
run;
/* AOCC02FL: the first event per subject where TRTEMFL='Y' and AESER='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y' and AESER='Y')) out=work._aocc02fl(keep=usubjid astdt aeseq);
by usubjid astdt aeseq;
run;
data work._aocc02fl;
set work._aocc02fl;
by usubjid ;
if first.usubjid;
length aocc02fl $1;
aocc02fl = 'Y';
run;
proc sort data=work._ds; by usubjid astdt aeseq; run;
data work._ds;
merge work._ds work._aocc02fl;
by usubjid astdt aeseq;
run;
/* AOCC03FL: the first event per subject and AEBODSYS where TRTEMFL='Y' and AESER='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y' and AESER='Y')) out=work._aocc03fl(keep=usubjid aebodsys astdt aeseq);
by usubjid aebodsys astdt aeseq;
run;
data work._aocc03fl;
set work._aocc03fl;
by usubjid aebodsys;
if first.aebodsys;
length aocc03fl $1;
aocc03fl = 'Y';
run;
proc sort data=work._ds; by usubjid aebodsys astdt aeseq; run;
data work._ds;
merge work._ds work._aocc03fl;
by usubjid aebodsys astdt aeseq;
run;
/* AOCC04FL: the first event per subject and AEBODSYS, AEDECOD where TRTEMFL='Y' and AESER='Y'. */
proc sort data=work._ds(where=(TRTEMFL='Y' and AESER='Y')) out=work._aocc04fl(keep=usubjid aebodsys aedecod astdt aeseq);
by usubjid aebodsys aedecod astdt aeseq;
run;
data work._aocc04fl;
set work._aocc04fl;
by usubjid aebodsys aedecod;
if first.aedecod;
length aocc04fl $1;
aocc04fl = 'Y';
run;
proc sort data=work._ds; by usubjid aebodsys aedecod astdt aeseq; run;
data work._ds;
merge work._ds work._aocc04fl;
by usubjid aebodsys aedecod astdt aeseq;
run;
/*==== 70-other ====*/
/* ADURU (AE Duration Units): If ADURN is not missing then ADURU='DAY' -- to write. */
/*==== 89-final ====*/
/* The data set as derived; the finalize step keeps the specification's variables. */
data work._final;
set work._ds;
run;
/*==== 90-finalize ====*/
/* 90-finalize: from the specification; the variables, their order and attributes are not changed here. */
/* The text variables the specification gives no length: as long as their longest value (at least 1). */
%let _len1 = 1; %let _len2 = 1; %let _len3 = 1; %let _len4 = 1; %let _len5 = 1; %let _len6 = 1; %let _len7 = 1; %let _len8 = 1; %let _len9 = 1; %let _len10 = 1; %let _len11 = 1; %let _len12 = 1; %let _len13 = 1; %let _len14 = 1; %let _len15 = 1; %let _len16 = 1; %let _len17 = 1; %let _len18 = 1; %let _len19 = 1; %let _len20 = 1; %let _len21 = 1; %let _len22 = 1; %let _len23 = 1; %let _len24 = 1; %let _len25 = 1; %let _len26 = 1; %let _len27 = 1; %let _len28 = 1; %let _len29 = 1; %let _len30 = 1; %let _len31 = 1; %let _len32 = 1; %let _len33 = 1; %let _len34 = 1; %let _len35 = 1; %let _len36 = 1;
data _null_;
length _ren _asg _siz $32767;
_dsid = open('work._final');
if varnum(_dsid, 'STUDYID') > 0 then do; _ren = catx(' ', _ren, 'STUDYID=_rz1'); _asg = catx(' ', _asg, 'STUDYID = _rz1;');
_siz = catx(' ', _siz, '_len1 = max(_len1, lengthn(STUDYID));'); end;
if varnum(_dsid, 'SITEID') > 0 then do; _ren = catx(' ', _ren, 'SITEID=_rz2'); _asg = catx(' ', _asg, 'SITEID = _rz2;');
_siz = catx(' ', _siz, '_len2 = max(_len2, lengthn(SITEID));'); end;
if varnum(_dsid, 'USUBJID') > 0 then do; _ren = catx(' ', _ren, 'USUBJID=_rz3'); _asg = catx(' ', _asg, 'USUBJID = _rz3;');
_siz = catx(' ', _siz, '_len3 = max(_len3, lengthn(USUBJID));'); end;
if varnum(_dsid, 'TRTA') > 0 then do; _ren = catx(' ', _ren, 'TRTA=_rz4'); _asg = catx(' ', _asg, 'TRTA = _rz4;');
_siz = catx(' ', _siz, '_len4 = max(_len4, lengthn(TRTA));'); end;
if varnum(_dsid, 'AGEGR1') > 0 then do; _ren = catx(' ', _ren, 'AGEGR1=_rz5'); _asg = catx(' ', _asg, 'AGEGR1 = _rz5;');
_siz = catx(' ', _siz, '_len5 = max(_len5, lengthn(AGEGR1));'); end;
if varnum(_dsid, 'RACE') > 0 then do; _ren = catx(' ', _ren, 'RACE=_rz6'); _asg = catx(' ', _asg, 'RACE = _rz6;');
_siz = catx(' ', _siz, '_len6 = max(_len6, lengthn(RACE));'); end;
if varnum(_dsid, 'SEX') > 0 then do; _ren = catx(' ', _ren, 'SEX=_rz7'); _asg = catx(' ', _asg, 'SEX = _rz7;');
_siz = catx(' ', _siz, '_len7 = max(_len7, lengthn(SEX));'); end;
if varnum(_dsid, 'SAFFL') > 0 then do; _ren = catx(' ', _ren, 'SAFFL=_rz8'); _asg = catx(' ', _asg, 'SAFFL = _rz8;');
_siz = catx(' ', _siz, '_len8 = max(_len8, lengthn(SAFFL));'); end;
if varnum(_dsid, 'ASTDTF') > 0 then do; _ren = catx(' ', _ren, 'ASTDTF=_rz9'); _asg = catx(' ', _asg, 'ASTDTF = _rz9;');
_siz = catx(' ', _siz, '_len9 = max(_len9, lengthn(ASTDTF));'); end;
if varnum(_dsid, 'ADURU') > 0 then do; _ren = catx(' ', _ren, 'ADURU=_rz10'); _asg = catx(' ', _asg, 'ADURU = _rz10;');
_siz = catx(' ', _siz, '_len10 = max(_len10, lengthn(ADURU));'); end;
if varnum(_dsid, 'AETERM') > 0 then do; _ren = catx(' ', _ren, 'AETERM=_rz11'); _asg = catx(' ', _asg, 'AETERM = _rz11;');
_siz = catx(' ', _siz, '_len11 = max(_len11, lengthn(AETERM));'); end;
if varnum(_dsid, 'AELLT') > 0 then do; _ren = catx(' ', _ren, 'AELLT=_rz12'); _asg = catx(' ', _asg, 'AELLT = _rz12;');
_siz = catx(' ', _siz, '_len12 = max(_len12, lengthn(AELLT));'); end;
if varnum(_dsid, 'AEDECOD') > 0 then do; _ren = catx(' ', _ren, 'AEDECOD=_rz13'); _asg = catx(' ', _asg, 'AEDECOD = _rz13;');
_siz = catx(' ', _siz, '_len13 = max(_len13, lengthn(AEDECOD));'); end;
if varnum(_dsid, 'AEHLT') > 0 then do; _ren = catx(' ', _ren, 'AEHLT=_rz14'); _asg = catx(' ', _asg, 'AEHLT = _rz14;');
_siz = catx(' ', _siz, '_len14 = max(_len14, lengthn(AEHLT));'); end;
if varnum(_dsid, 'AEHLGT') > 0 then do; _ren = catx(' ', _ren, 'AEHLGT=_rz15'); _asg = catx(' ', _asg, 'AEHLGT = _rz15;');
_siz = catx(' ', _siz, '_len15 = max(_len15, lengthn(AEHLGT));'); end;
if varnum(_dsid, 'AEBODSYS') > 0 then do; _ren = catx(' ', _ren, 'AEBODSYS=_rz16'); _asg = catx(' ', _asg, 'AEBODSYS = _rz16;');
_siz = catx(' ', _siz, '_len16 = max(_len16, lengthn(AEBODSYS));'); end;
if varnum(_dsid, 'AESOC') > 0 then do; _ren = catx(' ', _ren, 'AESOC=_rz17'); _asg = catx(' ', _asg, 'AESOC = _rz17;');
_siz = catx(' ', _siz, '_len17 = max(_len17, lengthn(AESOC));'); end;
if varnum(_dsid, 'AESEV') > 0 then do; _ren = catx(' ', _ren, 'AESEV=_rz18'); _asg = catx(' ', _asg, 'AESEV = _rz18;');
_siz = catx(' ', _siz, '_len18 = max(_len18, lengthn(AESEV));'); end;
if varnum(_dsid, 'AESER') > 0 then do; _ren = catx(' ', _ren, 'AESER=_rz19'); _asg = catx(' ', _asg, 'AESER = _rz19;');
_siz = catx(' ', _siz, '_len19 = max(_len19, lengthn(AESER));'); end;
if varnum(_dsid, 'AESCAN') > 0 then do; _ren = catx(' ', _ren, 'AESCAN=_rz20'); _asg = catx(' ', _asg, 'AESCAN = _rz20;');
_siz = catx(' ', _siz, '_len20 = max(_len20, lengthn(AESCAN));'); end;
if varnum(_dsid, 'AESCONG') > 0 then do; _ren = catx(' ', _ren, 'AESCONG=_rz21'); _asg = catx(' ', _asg, 'AESCONG = _rz21;');
_siz = catx(' ', _siz, '_len21 = max(_len21, lengthn(AESCONG));'); end;
if varnum(_dsid, 'AESDISAB') > 0 then do; _ren = catx(' ', _ren, 'AESDISAB=_rz22'); _asg = catx(' ', _asg, 'AESDISAB = _rz22;');
_siz = catx(' ', _siz, '_len22 = max(_len22, lengthn(AESDISAB));'); end;
if varnum(_dsid, 'AESDTH') > 0 then do; _ren = catx(' ', _ren, 'AESDTH=_rz23'); _asg = catx(' ', _asg, 'AESDTH = _rz23;');
_siz = catx(' ', _siz, '_len23 = max(_len23, lengthn(AESDTH));'); end;
if varnum(_dsid, 'AESHOSP') > 0 then do; _ren = catx(' ', _ren, 'AESHOSP=_rz24'); _asg = catx(' ', _asg, 'AESHOSP = _rz24;');
_siz = catx(' ', _siz, '_len24 = max(_len24, lengthn(AESHOSP));'); end;
if varnum(_dsid, 'AESLIFE') > 0 then do; _ren = catx(' ', _ren, 'AESLIFE=_rz25'); _asg = catx(' ', _asg, 'AESLIFE = _rz25;');
_siz = catx(' ', _siz, '_len25 = max(_len25, lengthn(AESLIFE));'); end;
if varnum(_dsid, 'AESOD') > 0 then do; _ren = catx(' ', _ren, 'AESOD=_rz26'); _asg = catx(' ', _asg, 'AESOD = _rz26;');
_siz = catx(' ', _siz, '_len26 = max(_len26, lengthn(AESOD));'); end;
if varnum(_dsid, 'AEREL') > 0 then do; _ren = catx(' ', _ren, 'AEREL=_rz27'); _asg = catx(' ', _asg, 'AEREL = _rz27;');
_siz = catx(' ', _siz, '_len27 = max(_len27, lengthn(AEREL));'); end;
if varnum(_dsid, 'AEACN') > 0 then do; _ren = catx(' ', _ren, 'AEACN=_rz28'); _asg = catx(' ', _asg, 'AEACN = _rz28;');
_siz = catx(' ', _siz, '_len28 = max(_len28, lengthn(AEACN));'); end;
if varnum(_dsid, 'AEOUT') > 0 then do; _ren = catx(' ', _ren, 'AEOUT=_rz29'); _asg = catx(' ', _asg, 'AEOUT = _rz29;');
_siz = catx(' ', _siz, '_len29 = max(_len29, lengthn(AEOUT));'); end;
if varnum(_dsid, 'TRTEMFL') > 0 then do; _ren = catx(' ', _ren, 'TRTEMFL=_rz30'); _asg = catx(' ', _asg, 'TRTEMFL = _rz30;');
_siz = catx(' ', _siz, '_len30 = max(_len30, lengthn(TRTEMFL));'); end;
if varnum(_dsid, 'AOCCFL') > 0 then do; _ren = catx(' ', _ren, 'AOCCFL=_rz31'); _asg = catx(' ', _asg, 'AOCCFL = _rz31;');
_siz = catx(' ', _siz, '_len31 = max(_len31, lengthn(AOCCFL));'); end;
if varnum(_dsid, 'AOCCSFL') > 0 then do; _ren = catx(' ', _ren, 'AOCCSFL=_rz32'); _asg = catx(' ', _asg, 'AOCCSFL = _rz32;');
_siz = catx(' ', _siz, '_len32 = max(_len32, lengthn(AOCCSFL));'); end;
if varnum(_dsid, 'AOCCPFL') > 0 then do; _ren = catx(' ', _ren, 'AOCCPFL=_rz33'); _asg = catx(' ', _asg, 'AOCCPFL = _rz33;');
_siz = catx(' ', _siz, '_len33 = max(_len33, lengthn(AOCCPFL));'); end;
if varnum(_dsid, 'AOCC02FL') > 0 then do; _ren = catx(' ', _ren, 'AOCC02FL=_rz34'); _asg = catx(' ', _asg, 'AOCC02FL = _rz34;');
_siz = catx(' ', _siz, '_len34 = max(_len34, lengthn(AOCC02FL));'); end;
if varnum(_dsid, 'AOCC03FL') > 0 then do; _ren = catx(' ', _ren, 'AOCC03FL=_rz35'); _asg = catx(' ', _asg, 'AOCC03FL = _rz35;');
_siz = catx(' ', _siz, '_len35 = max(_len35, lengthn(AOCC03FL));'); end;
if varnum(_dsid, 'AOCC04FL') > 0 then do; _ren = catx(' ', _ren, 'AOCC04FL=_rz36'); _asg = catx(' ', _asg, 'AOCC04FL = _rz36;');
_siz = catx(' ', _siz, '_len36 = max(_len36, lengthn(AOCC04FL));'); end;
_rc = close(_dsid);
if _ren ne '' then _ren = cats('(rename=(', _ren, '))');
call symputx('_ren', _ren);
call symputx('_asg', _asg);
call symputx('_siz', _siz);
run;
data _null_;
set work._final end=_end;
retain _len1 1 _len2 1 _len3 1 _len4 1 _len5 1 _len6 1 _len7 1 _len8 1 _len9 1 _len10 1 _len11 1 _len12 1 _len13 1 _len14 1 _len15 1 _len16 1 _len17 1 _len18 1 _len19 1 _len20 1 _len21 1 _len22 1 _len23 1 _len24 1 _len25 1 _len26 1 _len27 1 _len28 1 _len29 1 _len30 1 _len31 1 _len32 1 _len33 1 _len34 1 _len35 1 _len36 1;
&_siz
if _end then do;
call symputx('_len1', _len1);
call symputx('_len2', _len2);
call symputx('_len3', _len3);
call symputx('_len4', _len4);
call symputx('_len5', _len5);
call symputx('_len6', _len6);
call symputx('_len7', _len7);
call symputx('_len8', _len8);
call symputx('_len9', _len9);
call symputx('_len10', _len10);
call symputx('_len11', _len11);
call symputx('_len12', _len12);
call symputx('_len13', _len13);
call symputx('_len14', _len14);
call symputx('_len15', _len15);
call symputx('_len16', _len16);
call symputx('_len17', _len17);
call symputx('_len18', _len18);
call symputx('_len19', _len19);
call symputx('_len20', _len20);
call symputx('_len21', _len21);
call symputx('_len22', _len22);
call symputx('_len23', _len23);
call symputx('_len24', _len24);
call symputx('_len25', _len25);
call symputx('_len26', _len26);
call symputx('_len27', _len27);
call symputx('_len28', _len28);
call symputx('_len29', _len29);
call symputx('_len30', _len30);
call symputx('_len31', _len31);
call symputx('_len32', _len32);
call symputx('_len33', _len33);
call symputx('_len34', _len34);
call symputx('_len35', _len35);
call symputx('_len36', _len36);
end;
run;
data adam.adae(label="Adverse Events Analysis Dataset");
attrib
STUDYID length=$&_len1 label="Study Identifier"
SITEID length=$&_len2 label="Study Site Identifier"
USUBJID length=$&_len3 label="Unique Subject Identifier"
TRTA length=$&_len4 label="Actual Treatment"
TRTAN length=8 label="Actual Treatment (N)"
AGE length=8 label="Age"
AGEGR1 length=$&_len5 label="Pooled Age Group 1"
AGEGR1N length=8 label="Pooled Age Group 1 (N)"
RACE length=$&_len6 label="Race"
RACEN length=8 label="Race (N)"
SEX length=$&_len7 label="Sex"
SAFFL length=$&_len8 label="Safety Population Flag"
TRTSDT length=8 label="Date of First Exposure to Treatment" format=DATE9.
TRTEDT length=8 label="Date of Last Exposure to Treatment" format=DATE9.
ASTDT length=8 label="Analysis Start Date" format=DATE9.
ASTDTF length=$&_len9 label="Analysis Start Date Imputation Flag"
ASTDY length=8 label="Analysis Start Relative Day"
AENDT length=8 label="Analysis End Date" format=DATE9.
AENDY length=8 label="Analysis End Relative Day"
ADURN length=8 label="AE Duration (N)"
ADURU length=$&_len10 label="AE Duration Units"
AETERM length=$&_len11 label="Reported Term for the Adverse Event"
AELLT length=$&_len12 label="Lowest Level Term"
AELLTCD length=8 label="Lowest Level Term Code"
AEDECOD length=$&_len13 label="Dictionary-Derived Term"
AEPTCD length=8 label="Preferred Term Code"
AEHLT length=$&_len14 label="High Level Term"
AEHLTCD length=8 label="High Level Term Code"
AEHLGT length=$&_len15 label="High Level Group Term"
AEHLGTCD length=8 label="High Level Group Term Code"
AEBODSYS length=$&_len16 label="Body System or Organ Class"
AESOC length=$&_len17 label="Primary System Organ Class"
AESOCCD length=8 label="Primary System Organ Class Code"
AESEV length=$&_len18 label="Severity/Intensity"
AESER length=$&_len19 label="Serious Event"
AESCAN length=$&_len20 label="Involves Cancer"
AESCONG length=$&_len21 label="Congenital Anomaly or Birth Defect"
AESDISAB length=$&_len22 label="Persist or Signif Disability/Incapacity"
AESDTH length=$&_len23 label="Results in Death"
AESHOSP length=$&_len24 label="Requires or Prolongs Hospitalization"
AESLIFE length=$&_len25 label="Is Life Threatening"
AESOD length=$&_len26 label="Occurred with Overdose"
AEREL length=$&_len27 label="Causality"
AEACN length=$&_len28 label="Action Taken with Study Treatment"
AEOUT length=$&_len29 label="Outcome of Adverse Event"
AESEQ length=8 label="Sequence Number"
TRTEMFL length=$&_len30 label="Treatment Emergent Analysis Flag"
AOCCFL length=$&_len31 label="1st Occurrence of Any AE Flag"
AOCCSFL length=$&_len32 label="1st Occurrence of SOC Flag"
AOCCPFL length=$&_len33 label="1st Occurrence of Preferred Term Flag"
AOCC02FL length=$&_len34 label="1st Occurrence 02 Flag for Serious"
AOCC03FL length=$&_len35 label="1st Occurrence 03 Flag for Serious SOC"
AOCC04FL length=$&_len36 label="1st Occurrence 04 Flag for Serious PT"
;
set work._final&_ren;
&_asg
keep STUDYID SITEID USUBJID TRTA TRTAN AGE AGEGR1 AGEGR1N RACE RACEN SEX SAFFL TRTSDT TRTEDT ASTDT ASTDTF ASTDY AENDT AENDY ADURN ADURU AETERM AELLT AELLTCD AEDECOD AEPTCD AEHLT AEHLTCD AEHLGT AEHLGTCD AEBODSYS AESOC AESOCCD AESEV AESER AESCAN AESCONG AESDISAB AESDTH AESHOSP AESLIFE AESOD AEREL AEACN AEOUT AESEQ TRTEMFL AOCCFL AOCCSFL AOCCPFL AOCC02FL AOCC03FL AOCC04FL;
run;
proc sort data=adam.adae; by USUBJID AETERM ASTDT AESEQ; run;
Data (first 20 of 1,268 records, simulated)
| STUDYID | SITEID | USUBJID | TRTA | TRTAN | AGE | AGEGR1 | AGEGR1N | RACE | RACEN | SEX | SAFFL | TRTSDT | TRTEDT | ASTDT | ASTDTF | ASTDY | AENDT | AENDY | ADURN | ADURU | AETERM | AELLT | AELLTCD | AEDECOD | AEPTCD | AEHLT | AEHLTCD | AEHLGT | AEHLGTCD | AEBODSYS | AESOC | AESOCCD | AESEV | AESER | AESCAN | AESCONG | AESDISAB | AESDTH | AESHOSP | AESLIFE | AESOD | AEREL | AEACN | AEOUT | AESEQ | TRTEMFL | AOCCFL | AOCCSFL | AOCCPFL | AOCC02FL | AOCC03FL | AOCC04FL |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ONCO-EX | 701 | ONCO-EX-701002 | Standard of Care | 1 | 57 | <65 | 1 | WHITE | 1 | F | Y | 2022-02-12 | 2022-12-10 | 2022-05-25 | 103 | 2022-06-29 | 138 | 36 | APPLICATION SITE ERYTHEMA | APPLICATION SITE REDNESS | APPLICATION SITE ERYTHEMA | HLT_0617 | HLGT_0152 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DOSE REDUCED | RECOVERED/RESOLVED | 1 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701002 | Standard of Care | 1 | 57 | <65 | 1 | WHITE | 1 | F | Y | 2022-02-12 | 2022-12-10 | 2022-06-04 | 113 | 2022-08-24 | 194 | 82 | APPLICATION SITE IRRITATION | APPLICATION SITE BURNING | APPLICATION SITE IRRITATION | HLT_0061 | HLGT_0346 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MODERATE | N | N | N | N | N | N | N | N | POSSIBLY RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 2 | Y | Y | ||||||||||||
| ONCO-EX | 701 | ONCO-EX-701002 | Standard of Care | 1 | 57 | <65 | 1 | WHITE | 1 | F | Y | 2022-02-12 | 2022-12-10 | 2022-11-04 | 266 | 2022-11-13 | 275 | 10 | HEART RATE INCREASED | HEART RATE INCREASED | HEART RATE INCREASED | HLT_0646 | HLGT_0673 | INVESTIGATIONS | INVESTIGATIONS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 3 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701002 | Standard of Care | 1 | 57 | <65 | 1 | WHITE | 1 | F | Y | 2022-02-12 | 2022-12-10 | 2022-07-11 | 150 | 2022-07-12 | 151 | 2 | MYOCARDIAL INFARCTION | MYOCARDIAL INFARCTION | MYOCARDIAL INFARCTION | HLT_0649 | HLGT_0688 | CARDIAC DISORDERS | CARDIAC DISORDERS | SEVERE | N | N | N | N | N | N | N | N | RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 4 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701002 | Standard of Care | 1 | 57 | <65 | 1 | WHITE | 1 | F | Y | 2022-02-12 | 2022-12-10 | 2022-02-16 | 5 | 2022-02-16 | 5 | 1 | RASH | RASH | RASH | HLT_0762 | HLGT_0198 | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | MODERATE | N | N | N | N | N | N | N | N | NOT RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 5 | Y | Y | Y | Y | ||||||||||
| ONCO-EX | 701 | ONCO-EX-701003 | Standard of Care | 1 | 58 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-17 | 2022-10-20 | 2022-04-16 | 31 | ARTHRITIS | ARTHRITIS | ARTHRITIS | HLT_0019 | HLGT_0587 | MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS | MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS | MILD | N | N | N | N | N | N | N | N | POSSIBLY RELATED | DOSE NOT CHANGED | NOT RECOVERED/NOT RESOLVED | 1 | Y | Y | Y | Y | |||||||||||||
| ONCO-EX | 701 | ONCO-EX-701004 | Clinwrightinib 200 mg | 2 | 60 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-18 | 2023-02-16 | 2023-02-05 | 325 | APPLICATION SITE DERMATITIS | APPLICATION SITE RASH | APPLICATION SITE DERMATITIS | HLT_0343 | HLGT_0241 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DOSE REDUCED | NOT RECOVERED/NOT RESOLVED | 1 | Y | Y | |||||||||||||||
| ONCO-EX | 701 | ONCO-EX-701004 | Clinwrightinib 200 mg | 2 | 60 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-18 | 2023-02-16 | 2022-06-08 | 83 | 2022-06-25 | 100 | 18 | APPLICATION SITE PRURITUS | APPLICATION SITE ITCHING | APPLICATION SITE PRURITUS | HLT_0317 | HLGT_0338 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MODERATE | N | N | N | N | N | N | N | N | NOT RELATED | DOSE REDUCED | RECOVERED/RESOLVED | 2 | Y | Y | Y | Y | ||||||||||
| ONCO-EX | 701 | ONCO-EX-701004 | Clinwrightinib 200 mg | 2 | 60 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-18 | 2023-02-16 | 2022-07-27 | 132 | 2022-07-28 | 133 | 2 | ARTHRITIS | ARTHRITIS | ARTHRITIS | HLT_0019 | HLGT_0587 | MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS | MUSCULOSKELETAL AND CONNECTIVE TISSUE DISORDERS | MODERATE | N | N | N | N | N | N | N | N | RELATED | DRUG INTERRUPTED | RECOVERED/RESOLVED | 3 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701004 | Clinwrightinib 200 mg | 2 | 60 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-18 | 2023-02-16 | 2022-12-12 | 270 | 2022-12-13 | 271 | 2 | PRURITUS | ITCHING | PRURITUS | HLT_0778 | HLGT_0695 | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | MILD | N | N | N | N | N | N | N | N | POSSIBLY RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 4 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701004 | Clinwrightinib 200 mg | 2 | 60 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-18 | 2023-02-16 | 2022-12-18 | 276 | 2022-12-25 | 283 | 8 | SKIN ODOUR ABNORMAL | SKIN ODOR ABNORMAL | SKIN ODOUR ABNORMAL | HLT_0510 | HLGT_0184 | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | SKIN AND SUBCUTANEOUS TISSUE DISORDERS | MILD | N | N | N | N | N | N | N | N | UNLIKELY RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 5 | Y | Y | ||||||||||||
| ONCO-EX | 701 | ONCO-EX-701005 | Clinwrightinib 200 mg | 2 | 62 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-31 | 2023-03-01 | 2022-07-03 | 95 | 2022-07-12 | 104 | 10 | NAUSEA | NAUSEA | NAUSEA | HLT_0742 | HLGT_0326 | GASTROINTESTINAL DISORDERS | GASTROINTESTINAL DISORDERS | MODERATE | N | N | N | N | N | N | N | N | RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 1 | Y | Y | Y | Y | ||||||||||
| ONCO-EX | 701 | ONCO-EX-701005 | Clinwrightinib 200 mg | 2 | 62 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-31 | 2023-03-01 | 2022-12-03 | 248 | 2024-01-15 | 656 | 409 | PAROSMIA | STRANGE SMELL SENSATION | PAROSMIA | HLT_0258 | HLGT_0471 | NERVOUS SYSTEM DISORDERS | NERVOUS SYSTEM DISORDERS | MODERATE | N | N | N | N | N | N | N | N | POSSIBLY RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 2 | Y | Y | Y | |||||||||||
| ONCO-EX | 701 | ONCO-EX-701005 | Clinwrightinib 200 mg | 2 | 62 | <65 | 1 | WHITE | 1 | M | Y | 2022-03-31 | 2023-03-01 | 2023-02-11 | 318 | 2023-02-12 | 319 | 2 | SYNCOPE | FAINTING | SYNCOPE | HLT_0440 | HLGT_0310 | NERVOUS SYSTEM DISORDERS | NERVOUS SYSTEM DISORDERS | MILD | N | N | N | N | N | N | N | N | UNLIKELY RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 3 | Y | Y | ||||||||||||
| ONCO-EX | 701 | ONCO-EX-701007 | Standard of Care | 1 | 63 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-19 | 2023-02-14 | 2023-01-10 | 267 | DISORIENTATION | DISORIENTATION | DISORIENTATION | HLT_0299 | HLGT_0307 | PSYCHIATRIC DISORDERS | PSYCHIATRIC DISORDERS | MILD | N | N | N | N | N | N | N | N | POSSIBLY RELATED | DOSE NOT CHANGED | NOT RECOVERED/NOT RESOLVED | 1 | Y | Y | Y | ||||||||||||||
| ONCO-EX | 701 | ONCO-EX-701007 | Standard of Care | 1 | 63 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-19 | 2023-02-14 | 2022-06-05 | 48 | 2022-06-09 | 52 | 5 | ELECTROCARDIOGRAM T WAVE AMPLITUDE DECREASED | T WAVE FLATTENING OF | ELECTROCARDIOGRAM T WAVE AMPLITUDE DECREASED | HLT_0037 | HLGT_0030 | INVESTIGATIONS | INVESTIGATIONS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DOSE NOT CHANGED | RECOVERED/RESOLVED | 2 | Y | Y | Y | Y | ||||||||||
| ONCO-EX | 701 | ONCO-EX-701007 | Standard of Care | 1 | 63 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-19 | 2023-02-14 | 2022-09-24 | 159 | HEART RATE IRREGULAR | HEARTBEATS IRREGULAR | HEART RATE IRREGULAR | HLT_0765 | HLGT_0140 | INVESTIGATIONS | INVESTIGATIONS | SEVERE | N | N | N | N | N | N | N | N | NOT RELATED | DOSE NOT CHANGED | NOT RECOVERED/NOT RESOLVED | 3 | Y | Y | |||||||||||||||
| ONCO-EX | 701 | ONCO-EX-701008 | Clinwrightinib 200 mg | 2 | 54 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-26 | 2022-11-29 | 2022-08-13 | 110 | APPLICATION SITE ERYTHEMA | APPLICATION SITE REDNESS | APPLICATION SITE ERYTHEMA | HLT_0617 | HLGT_0152 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MILD | N | N | N | N | N | N | N | N | UNLIKELY RELATED | DOSE NOT CHANGED | NOT RECOVERED/NOT RESOLVED | 1 | Y | Y | |||||||||||||||
| ONCO-EX | 701 | ONCO-EX-701008 | Clinwrightinib 200 mg | 2 | 54 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-26 | 2022-11-29 | 2022-07-22 | 88 | APPLICATION SITE PRURITUS | APPLICATION SITE ITCHING | APPLICATION SITE PRURITUS | HLT_0317 | HLGT_0338 | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DOSE NOT CHANGED | NOT RECOVERED/NOT RESOLVED | 2 | Y | Y | Y | ||||||||||||||
| ONCO-EX | 701 | ONCO-EX-701008 | Clinwrightinib 200 mg | 2 | 54 | <65 | 1 | WHITE | 1 | M | Y | 2022-04-26 | 2022-11-29 | 2022-07-07 | 73 | 2022-07-11 | 77 | 5 | COUGH | COUGH | COUGH | HLT_0701 | HLGT_0280 | RESPIRATORY, THORACIC AND MEDIASTINAL DISORDERS | RESPIRATORY, THORACIC AND MEDIASTINAL DISORDERS | MILD | N | N | N | N | N | N | N | N | NOT RELATED | DRUG INTERRUPTED | RECOVERED/RESOLVED | 3 | Y | Y | Y |