/*====================================================================== SDTM Program: AE.sas Domain: Adverse Events Class: Events Study: CDISC Pilot Study (CDISCPILOT01) SDTMIG: SDTMIG 3.4 Generated by: SDTM Automation Agent (AI-Powered) Generated: 2026-06-05 19:17 ====================================================================== */ LIBNAME raw "../../data/raw/"; LIBNAME sdtm "../../data/output/sdtm/"; DATA sdtm.ae (LABEL="Adverse Events"); SET raw.ae_raw(KEEP= AEACN AEBODSYS AEDECOD AEENDTC AELLT AEREL AESER AESEV AESTDTC AETERM USUBJID ); /*-------------------------------------------------- Variable Mappings -------------------------------------------------- */ /* STUDYID: Study Identifier */ LENGTH STUDYID $20.; STUDYID = "CDISCPILOT01"; /* DOMAIN: Domain Abbreviation */ LENGTH DOMAIN $2.; DOMAIN = "AE"; /* USUBJID: Unique Subject Identifier */ LENGTH USUBJID $40.; USUBJID = ae_raw.USUBJID; /* AESEQ: Sequence Number */ AESEQ + 1; /* AETERM: Reported Term for the Adverse Event */ LENGTH AETERM $100.; AETERM = ae_raw.AETERM; /* AELLT: Lowest Level Term */ LENGTH AELLT $100.; AELLT = ae_raw.AELLT; /* AEDECOD: Dictionary-Derived Term */ LENGTH AEDECOD $100.; AEDECOD = ae_raw.AEDECOD; /* AEBODSYS: Body System or Organ Class */ LENGTH AEBODSYS $50.; AEBODSYS = ae_raw.AEBODSYS; /* AESEV: Severity/Intensity */ LENGTH AESEV $10.; AESEV = ae_raw.AESEV; /* AESER: Serious Event */ LENGTH AESER $1.; AESER = ae_raw.AESER; /* AEACN: Action Taken with Study Treatment */ LENGTH AEACN $30.; AEACN = ae_raw.AEACN; /* AEREL: Causality */ LENGTH AEREL $12.; AEREL = ae_raw.AEREL; /* AESTDTC: Start Date/Time of Adverse Event */ LENGTH AESTDTC $20.; AESTDTC = PUT(ae_raw.AESTDTC, IS8601DT.); /* AEENDTC: End Date/Time of Adverse Event */ LENGTH AEENDTC $20.; AEENDTC = PUT(ae_raw.AEENDTC, IS8601DT.); /* AESTDY: Study Day of Start of Adverse Event */ AESTDY = AESTDTC - RFSTDTC + 1; /* AEENDY: Study Day of End of Adverse Event */ AEENDY = AEENDTC - RFSTDTC + 1; /* Required SDTM attributes */ DOMAIN = "AE"; STUDYID = "CDISCPILOT01"; /* Sort */ RETAIN STUDYID, USUBJID, AESEQ; LABEL STUDYID = "Study Identifier" DOMAIN = "Domain Abbreviation" USUBJID = "Unique Subject Identifier" AESEQ = "Sequence Number" AETERM = "Reported Term for the Adverse Event" AELLT = "Lowest Level Term" AEDECOD = "Dictionary-Derived Term" AEBODSYS = "Body System or Organ Class" AESEV = "Severity/Intensity" AESER = "Serious Event" AEACN = "Action Taken with Study Treatment" AEREL = "Causality" AESTDTC = "Start Date/Time of Adverse Event" AEENDTC = "End Date/Time of Adverse Event" AESTDY = "Study Day of Start of Adverse Event" AEENDY = "Study Day of End of Adverse Event" ; RUN; /* Sort the SDTM dataset */ PROC SORT DATA=sdtm.ae; BY STUDYID USUBJID AESEQ; RUN; /* Validate with PROC CONTENTS */ PROC CONTENTS DATA=sdtm.ae; RUN;