Clinwright Public work of Helper Software LLC · free Start free

ADCM

Concomitant Medications Analysis Dataset

OCCURRENCE DATA STRUCTURE · one record per subject per concomitant medication · keys STUDYID, USUBJID, CMSEQ

Variables

VariableLabelTypeLengthDerivation
STUDYIDStudy IdentifiertextPredecessor ADSL.STUDYID
SITEIDStudy Site IdentifiertextPredecessor ADSL.SITEID
USUBJIDUnique Subject IdentifiertextPredecessor ADSL.USUBJID
SUBJIDSubject Identifier for the StudytextPredecessor ADSL.SUBJID
TRTAActual TreatmenttextPredecessor ADSL.TRT01A
TRTANActual Treatment (N)integer8Predecessor ADSL.TRT01AN
AGEAgeinteger8Predecessor ADSL.AGE
AGEGR1Pooled Age Group 1textPredecessor ADSL.AGEGR1
SEXSextextPredecessor ADSL.SEX
RACERacetextPredecessor ADSL.RACE
SAFFLSafety Population FlagtextPredecessor ADSL.SAFFL
TRTSDTDate of First Exposure to Treatmentinteger8Predecessor ADSL.TRTSDT
TRTEDTDate of Last Exposure to Treatmentinteger8Predecessor ADSL.TRTEDT
CMSEQSequence Numberinteger8Predecessor CM.CMSEQ
CMTRTReported Name of Drug, Med, or TherapytextPredecessor CM.CMTRT
CMDECODStandardized Medication NametextPredecessor CM.CMDECOD
CMCLASMedication ClasstextPredecessor CM.CMCLAS
CMINDCIndicationtextPredecessor CM.CMINDC
CMDOSEDose per Administrationfloat8Predecessor CM.CMDOSE
CMDOSUDose UnitstextPredecessor CM.CMDOSU
CMDOSFRQDosing Frequency per IntervaltextPredecessor CM.CMDOSFRQ
CMROUTERoute of AdministrationtextPredecessor CM.CMROUTE
CMSTDTCStart Date/Time of MedicationtextPredecessor CM.CMSTDTC
CMENDTCEnd Date/Time of MedicationtextPredecessor CM.CMENDTC
ASTDTAnalysis Start Dateinteger8CM.CMSTDTC converted to a numeric SAS date.
ASTDYAnalysis Start Relative Dayinteger8ASTDT - TRTSDT + 1 if ASTDT is on or after TRTSDT, else ASTDT - TRTSDT.
AENDTAnalysis End Dateinteger8CM.CMENDTC converted to a numeric SAS date.
AENDYAnalysis End Relative Dayinteger8AENDT - TRTSDT + 1 if AENDT is on or after TRTSDT, else AENDT - TRTSDT.
ONTRTFLOn Treatment Record FlagtextY if TRTSDT <= ASTDT <= TRTEDT.

Program adcm.sas

Version 1, written from Clinwright's patterns, 2026-10-17, checks passed.

/*==== 00-header ====*/
/*----------------------------------------------------------------------------
  Data set : ADCM (Concomitant Medications Analysis Dataset)
  Reporting effort : CSR
  SDTM     : CM
  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 CM records, with the subject's TRTSDT, TRTEDT, STUDYID, SITEID, USUBJID, SUBJID, TRT01A, TRT01AN, AGE, AGEGR1, SEX, RACE, SAFFL from ADSL. */
proc sort data=sdtm.cm(keep=studyid usubjid cmseq cmtrt cmdecod cmindc cmdose cmdosu cmdosfrq cmroute cmstdtc cmendtc) out=work._ds; by usubjid; run;
proc sort data=adam.adsl(keep=usubjid trtsdt trtedt studyid siteid usubjid subjid trt01a trt01an age agegr1 sex race 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;

/*==== 30-timing ====*/
/* ASTDT: CM.CMSTDTC as a SAS date. */
data work._ds;
  set work._ds;
  length _dtc $10;
  _dtc = cmstdtc; /* (its first 10 characters: SUBSTR would complain of a shorter variable) */
  if length(_dtc) = 10 then astdt = input(_dtc, ?? yymmdd10.);

  format astdt date9.;
  drop _dtc;
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: CM.CMENDTC as a SAS date. */
data work._ds;
  set work._ds;
  length _dtc $10;
  _dtc = cmendtc; /* (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;

/*==== 60-flags ====*/
/* ONTRTFL: Y if TRTSDT <= ASTDT <= TRTEDT + 0. */
data work._ds;
  set work._ds;
  length ontrtfl $1;
  if . < trtsdt <= astdt and astdt <= trtedt + 0 then ontrtfl = 'Y';
run;

/*==== 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;
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, 'SUBJID') > 0 then do; _ren = catx(' ', _ren, 'SUBJID=_rz4'); _asg = catx(' ', _asg, 'SUBJID = _rz4;');
    _siz = catx(' ', _siz, '_len4 = max(_len4, lengthn(SUBJID));'); end;
  if varnum(_dsid, 'TRTA') > 0 then do; _ren = catx(' ', _ren, 'TRTA=_rz5'); _asg = catx(' ', _asg, 'TRTA = _rz5;');
    _siz = catx(' ', _siz, '_len5 = max(_len5, lengthn(TRTA));'); end;
  if varnum(_dsid, 'AGEGR1') > 0 then do; _ren = catx(' ', _ren, 'AGEGR1=_rz6'); _asg = catx(' ', _asg, 'AGEGR1 = _rz6;');
    _siz = catx(' ', _siz, '_len6 = max(_len6, lengthn(AGEGR1));'); 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, 'RACE') > 0 then do; _ren = catx(' ', _ren, 'RACE=_rz8'); _asg = catx(' ', _asg, 'RACE = _rz8;');
    _siz = catx(' ', _siz, '_len8 = max(_len8, lengthn(RACE));'); end;
  if varnum(_dsid, 'SAFFL') > 0 then do; _ren = catx(' ', _ren, 'SAFFL=_rz9'); _asg = catx(' ', _asg, 'SAFFL = _rz9;');
    _siz = catx(' ', _siz, '_len9 = max(_len9, lengthn(SAFFL));'); end;
  if varnum(_dsid, 'CMTRT') > 0 then do; _ren = catx(' ', _ren, 'CMTRT=_rz10'); _asg = catx(' ', _asg, 'CMTRT = _rz10;');
    _siz = catx(' ', _siz, '_len10 = max(_len10, lengthn(CMTRT));'); end;
  if varnum(_dsid, 'CMDECOD') > 0 then do; _ren = catx(' ', _ren, 'CMDECOD=_rz11'); _asg = catx(' ', _asg, 'CMDECOD = _rz11;');
    _siz = catx(' ', _siz, '_len11 = max(_len11, lengthn(CMDECOD));'); end;
  if varnum(_dsid, 'CMCLAS') > 0 then do; _ren = catx(' ', _ren, 'CMCLAS=_rz12'); _asg = catx(' ', _asg, 'CMCLAS = _rz12;');
    _siz = catx(' ', _siz, '_len12 = max(_len12, lengthn(CMCLAS));'); end;
  if varnum(_dsid, 'CMINDC') > 0 then do; _ren = catx(' ', _ren, 'CMINDC=_rz13'); _asg = catx(' ', _asg, 'CMINDC = _rz13;');
    _siz = catx(' ', _siz, '_len13 = max(_len13, lengthn(CMINDC));'); end;
  if varnum(_dsid, 'CMDOSU') > 0 then do; _ren = catx(' ', _ren, 'CMDOSU=_rz14'); _asg = catx(' ', _asg, 'CMDOSU = _rz14;');
    _siz = catx(' ', _siz, '_len14 = max(_len14, lengthn(CMDOSU));'); end;
  if varnum(_dsid, 'CMDOSFRQ') > 0 then do; _ren = catx(' ', _ren, 'CMDOSFRQ=_rz15'); _asg = catx(' ', _asg, 'CMDOSFRQ = _rz15;');
    _siz = catx(' ', _siz, '_len15 = max(_len15, lengthn(CMDOSFRQ));'); end;
  if varnum(_dsid, 'CMROUTE') > 0 then do; _ren = catx(' ', _ren, 'CMROUTE=_rz16'); _asg = catx(' ', _asg, 'CMROUTE = _rz16;');
    _siz = catx(' ', _siz, '_len16 = max(_len16, lengthn(CMROUTE));'); end;
  if varnum(_dsid, 'CMSTDTC') > 0 then do; _ren = catx(' ', _ren, 'CMSTDTC=_rz17'); _asg = catx(' ', _asg, 'CMSTDTC = _rz17;');
    _siz = catx(' ', _siz, '_len17 = max(_len17, lengthn(CMSTDTC));'); end;
  if varnum(_dsid, 'CMENDTC') > 0 then do; _ren = catx(' ', _ren, 'CMENDTC=_rz18'); _asg = catx(' ', _asg, 'CMENDTC = _rz18;');
    _siz = catx(' ', _siz, '_len18 = max(_len18, lengthn(CMENDTC));'); end;
  if varnum(_dsid, 'ONTRTFL') > 0 then do; _ren = catx(' ', _ren, 'ONTRTFL=_rz19'); _asg = catx(' ', _asg, 'ONTRTFL = _rz19;');
    _siz = catx(' ', _siz, '_len19 = max(_len19, lengthn(ONTRTFL));'); 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;
  &_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);
  end;
run;
data adam.adcm(label="Concomitant Medications Analysis Dataset");
  attrib
    STUDYID  length=$&_len1 label="Study Identifier"
    SITEID   length=$&_len2 label="Study Site Identifier"
    USUBJID  length=$&_len3 label="Unique Subject Identifier"
    SUBJID   length=$&_len4 label="Subject Identifier for the Study"
    TRTA     length=$&_len5 label="Actual Treatment"
    TRTAN    length=8 label="Actual Treatment (N)"
    AGE      length=8 label="Age"
    AGEGR1   length=$&_len6 label="Pooled Age Group 1"
    SEX      length=$&_len7 label="Sex"
    RACE     length=$&_len8 label="Race"
    SAFFL    length=$&_len9 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.
    CMSEQ    length=8 label="Sequence Number"
    CMTRT    length=$&_len10 label="Reported Name of Drug, Med, or Therapy"
    CMDECOD  length=$&_len11 label="Standardized Medication Name"
    CMCLAS   length=$&_len12 label="Medication Class"
    CMINDC   length=$&_len13 label="Indication"
    CMDOSE   length=8 label="Dose per Administration"
    CMDOSU   length=$&_len14 label="Dose Units"
    CMDOSFRQ length=$&_len15 label="Dosing Frequency per Interval"
    CMROUTE  length=$&_len16 label="Route of Administration"
    CMSTDTC  length=$&_len17 label="Start Date/Time of Medication"
    CMENDTC  length=$&_len18 label="End Date/Time of Medication"
    ASTDT    length=8 label="Analysis Start Date" format=DATE9.
    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"
    ONTRTFL  length=$&_len19 label="On Treatment Record Flag"
  ;
  set work._final&_ren;
  &_asg
  keep STUDYID SITEID USUBJID SUBJID TRTA TRTAN AGE AGEGR1 SEX RACE SAFFL TRTSDT TRTEDT CMSEQ CMTRT CMDECOD CMCLAS CMINDC CMDOSE CMDOSU CMDOSFRQ CMROUTE CMSTDTC CMENDTC ASTDT ASTDY AENDT AENDY ONTRTFL;
run;
proc sort data=adam.adcm; by STUDYID USUBJID CMSEQ; run;

Data (first 20 of 891 records, simulated)

STUDYIDSITEIDUSUBJIDSUBJIDTRTATRTANAGEAGEGR1SEXRACESAFFLTRTSDTTRTEDTCMSEQCMTRTCMDECODCMCLASCMINDCCMDOSECMDOSUCMDOSFRQCMROUTECMSTDTCCMENDTCASTDTASTDYAENDTAENDYONTRTFL
ONCO-EX701ONCO-EX-701002701002Standard of Care157<65FWHITEY2022-02-122022-12-101PROMETHAZINE HCL W/CODEINEPROMETHAZINE HCL W/CODEINEPROPHYLAXIS OR NON-THERAPEUTIC USE2TABLETORAL2016-02-082016-02-242016-02-08-21962016-02-24-2180
ONCO-EX701ONCO-EX-701002701002Standard of Care157<65FWHITEY2022-02-122022-12-102CALAMINE LOTIONCALAMINE LOTIONPROPHYLAXIS OR NON-THERAPEUTIC USEngTRANSDERMAL2018-03-112018-03-11-1434
ONCO-EX701ONCO-EX-701002701002Standard of Care157<65FWHITEY2022-02-122022-12-103DOCUSATE SODIUMDOCUSATE SODIUMPROPHYLAXIS OR NON-THERAPEUTIC USE100mgORAL2022-052022-05-092022-05-0987
ONCO-EX701ONCO-EX-701003701003Standard of Care158<65MWHITEY2022-03-172022-10-201MECLIZINEMECLIZINEPROPHYLAXIS OR NON-THERAPEUTIC USE25mgORAL2020-072020-08-022020-08-02-592
ONCO-EX701ONCO-EX-701003701003Standard of Care158<65MWHITEY2022-03-172022-10-202NEO-SYNEPHRINENEO-SYNEPHRINEPROPHYLAXIS OR NON-THERAPEUTIC USE1TABLETNASAL2022-03-152022-06-012022-03-15-22022-06-0177
ONCO-EX701ONCO-EX-701003701003Standard of Care158<65MWHITEY2022-03-172022-10-203VITAMIN EVITAMIN EPROPHYLAXIS OR NON-THERAPEUTIC USE400mgORAL2022-05-202022-05-242022-05-20652022-05-2469Y
ONCO-EX701ONCO-EX-701003701003Standard of Care158<65MWHITEY2022-03-172022-10-204POTASSIUMPOTASSIUMPROPHYLAXIS OR NON-THERAPEUTIC USE1TABLETORAL2022-06-182022-07-122022-06-18942022-07-12118Y
ONCO-EX701ONCO-EX-701003701003Standard of Care158<65MWHITEY2022-03-172022-10-205DEMEROLDEMEROLPROPHYLAXIS OR NON-THERAPEUTIC USE50mgINTRAVENOUS2022-07-132022-07-292022-07-131192022-07-29135Y
ONCO-EX701ONCO-EX-701005701005Clinwrightinib 200 mg262<65MWHITEY2022-03-312023-03-011PREDNISONEPREDNISONEPROPHYLAXIS OR NON-THERAPEUTIC USE20mgORAL2022-03-072022-03-102022-03-07-242022-03-10-21
ONCO-EX701ONCO-EX-701005701005Clinwrightinib 200 mg262<65MWHITEY2022-03-312023-03-012CARDURACARDURAPROPHYLAXIS OR NON-THERAPEUTIC USE1TABLETORAL2022-11
ONCO-EX701ONCO-EX-701007701007Standard of Care163<65MWHITEY2022-04-192023-02-141AEROBIDAEROBIDPROPHYLAXIS OR NON-THERAPEUTIC USE1TABLETRESPIRATORY (INHALATION)2022-04-102022-04-10-9
ONCO-EX701ONCO-EX-701008701008Clinwrightinib 200 mg254<65MWHITEY2022-04-262022-11-291PREMARINPREMARINPROPHYLAXIS OR NON-THERAPEUTIC USE0.625mgORAL2022-05
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-211EXCEDRINEXCEDRINPROPHYLAXIS OR NON-THERAPEUTIC USE2TABLETORAL2012-10
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-212CORTISONECORTISONEPROPHYLAXIS OR NON-THERAPEUTIC USETOPICAL2014-07-012014-07-01-2848
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-213SYNTHROIDSYNTHROIDPROPHYLAXIS OR NON-THERAPEUTIC USE0.15mgORAL2014-12
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-214DYAZIDEDYAZIDEPROPHYLAXIS OR NON-THERAPEUTIC USE37.5mgORAL2021-01-232021-01-23-450
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-215VITAMIN EVITAMIN EPROPHYLAXIS OR NON-THERAPEUTIC USE400mgORAL2021-07-222021-07-232021-07-22-2702021-07-23-269
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-216CARDURACARDURAPROPHYLAXIS OR NON-THERAPEUTIC USE1TABLETORAL2022-05-252022-05-2538Y
ONCO-EX701ONCO-EX-701009701009Clinwrightinib 200 mg258<65MBLACK OR AFRICAN AMERICANY2022-04-182022-11-217ARMOUR THYROIDARMOUR THYROIDPROPHYLAXIS OR NON-THERAPEUTIC USE2TABLETORAL2022-07-282022-07-292022-07-281022022-07-29103Y
ONCO-EX701ONCO-EX-701010701010Clinwrightinib 200 mg264<65FWHITEY2022-06-102023-05-111PROPULSIDPROPULSIDPROPHYLAXIS OR NON-THERAPEUTIC USE10mgORAL2015-122016-01-232016-01-23-2330