Review ask

As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.

We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.

Summary

Lifecycle: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: build one DM record per subject carrying RFSTDTC, SITEID, AGE, AGEU, SEX, RACE and COUNTRY, and submit it as the SAS transport file dm.xpt beside its data-definition document.

Input: one row per subject carrying the site, reference start date, age, sex, race and country.

Variables:

  • RFSTDTC is the subject's reference start date; empty when the subject has none.
  • SITEID is the collected site identifier.
  • AGE is the collected age in whole years.
  • AGEU is fixed to YEARS.
  • SEX, RACE and COUNTRY are as collected.

Note: in the transport file each text variable is exactly as wide as its longest value, and the data-definition document reports that width as the variable's length instead of the largest length the study allows. A date travels as YYYY-MM-DD text, and an empty value is blanks.

The project.yaml guide declaration is SDTMIG 3.3; the data-definition document records it and points to the SAS Transport version 5 dataset.

Inputs

Under review
1 source file

input/dm_raw.csv

Edit
3 rows
input/dm_raw.csv
STUDYIDUSUBJIDSUBJIDSITEIDRFSTDTCAGESEXRACECOUNTRY
CATH0001UCSD2025-01-0834FWHITEUSA
CATH0002UCSD2025-01-1567MBLACK OR AFRICAN AMERICANUSA
CATH0003MCGILL—52FASIANCAN

Expected output

Under review
3 expected rows

expected/define.xml

Edit
Define-XML

Define-XML 2.1.11: CATH

Example study submitting demographics in SAS transport; CATH-01; SDTMIG 3.3

Datasets
DatasetDescriptionClassStructurePurposeKeysDocumentationLocation
DMDemographicsSPECIAL PURPOSEOne record per subjectTabulationSTUDYID, USUBJIDdm.xpt

DM

DM variables
VariableLabel / DescriptionTypeRoleLength or Display FormatControlled Terms or ISO FormatOrigin / Source / Method / Comment
DOMAINDomain AbbreviationtextIdentifier2Assigned; Sponsor
STUDYIDStudy IdentifiertextIdentifier4Protocol; Sponsor
USUBJIDUnique Subject IdentifiertextIdentifier16Assigned; Sponsor
SUBJIDSubject Identifier for the StudytextTopic4Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
RFSTDTCSubject Reference Start Date/TimedateRecord QualifierISO 8601Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
SITEIDStudy Site IdentifiertextRecord Qualifier6Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
AGEAgeintegerRecord Qualifier3Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
AGEUAge UnitstextVariable Qualifier5Assigned; Sponsor
SEXSextextRecord Qualifier1Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
RACERacetextRecord Qualifier25Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
COUNTRYCountrytextRecord Qualifier3Collected; Investigator; Annotated Case Report Form (acrf.pdf); pages 1
Original source
<?xml version="1.0" encoding="UTF-8"?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:def="http://www.cdisc.org/ns/def/v2.1" xmlns:xlink="http://www.w3.org/1999/xlink" ODMVersion="1.3.2" FileType="Snapshot" FileOID="CATH.sdtm.Define-XML_2.1" CreationDateTime="2026-09-11T00:00:00" SourceSystem="yamaa" SourceSystemVersion="1.0" def:Context="Submission">
  <Study OID="STDY.CATH">
    <GlobalVariables>
      <StudyName>CATH</StudyName>
      <StudyDescription>Example study submitting demographics in SAS transport</StudyDescription>
      <ProtocolName>CATH-01</ProtocolName>
    </GlobalVariables>
    <MetaDataVersion OID="MDV.CATH.sdtm" Name="CATH sdtm metadata" def:DefineVersion="2.1.11">
      <def:Standards>
        <def:Standard OID="STD.SDTMIG" Name="SDTMIG" Type="IG" Version="3.3" Status="Final"/>
      </def:Standards>
      <def:AnnotatedCRF>
        <def:DocumentRef leafID="LF.acrf"/>
      </def:AnnotatedCRF>
      <ItemGroupDef OID="IG.DM" Name="DM" Domain="DM" Purpose="Tabulation" SASDatasetName="DM" Repeating="No" IsReferenceData="No" def:Structure="One record per subject" def:ArchiveLocationID="LF.DM" def:StandardOID="STD.SDTMIG">
        <Description>
          <TranslatedText xml:lang="en">Demographics</TranslatedText>
        </Description>
        <ItemRef ItemOID="IT.DM.DOMAIN" OrderNumber="1" Mandatory="Yes" Role="Identifier"/>
        <ItemRef ItemOID="IT.DM.STUDYID" OrderNumber="2" Mandatory="Yes" KeySequence="1" Role="Identifier"/>
        <ItemRef ItemOID="IT.DM.USUBJID" OrderNumber="3" Mandatory="Yes" KeySequence="2" Role="Identifier"/>
        <ItemRef ItemOID="IT.DM.SUBJID" OrderNumber="4" Mandatory="Yes" Role="Topic"/>
        <ItemRef ItemOID="IT.DM.RFSTDTC" OrderNumber="5" Mandatory="No" Role="Record Qualifier"/>
        <ItemRef ItemOID="IT.DM.SITEID" OrderNumber="6" Mandatory="Yes" Role="Record Qualifier"/>
        <ItemRef ItemOID="IT.DM.AGE" OrderNumber="7" Mandatory="No" Role="Record Qualifier"/>
        <ItemRef ItemOID="IT.DM.AGEU" OrderNumber="8" Mandatory="No" Role="Variable Qualifier"/>
        <ItemRef ItemOID="IT.DM.SEX" OrderNumber="9" Mandatory="Yes" Role="Record Qualifier"/>
        <ItemRef ItemOID="IT.DM.RACE" OrderNumber="10" Mandatory="No" Role="Record Qualifier"/>
        <ItemRef ItemOID="IT.DM.COUNTRY" OrderNumber="11" Mandatory="Yes" Role="Record Qualifier"/>
        <def:Class Name="SPECIAL PURPOSE"/>
        <def:leaf ID="LF.DM" xlink:href="dm.xpt">
          <def:title>dm.xpt</def:title>
        </def:leaf>
      </ItemGroupDef>
      <ItemDef OID="IT.DM.DOMAIN" Name="DOMAIN" DataType="text" Length="2" SASFieldName="DOMAIN">
        <Description>
          <TranslatedText xml:lang="en">Domain Abbreviation</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.DM.STUDYID" Name="STUDYID" DataType="text" Length="4" SASFieldName="STUDYID">
        <Description>
          <TranslatedText xml:lang="en">Study Identifier</TranslatedText>
        </Description>
        <def:Origin Type="Protocol" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.DM.USUBJID" Name="USUBJID" DataType="text" Length="16" SASFieldName="USUBJID">
        <Description>
          <TranslatedText xml:lang="en">Unique Subject Identifier</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.DM.SUBJID" Name="SUBJID" DataType="text" Length="4" SASFieldName="SUBJID">
        <Description>
          <TranslatedText xml:lang="en">Subject Identifier for the Study</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.RFSTDTC" Name="RFSTDTC" DataType="date" SASFieldName="RFSTDTC">
        <Description>
          <TranslatedText xml:lang="en">Subject Reference Start Date/Time</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.SITEID" Name="SITEID" DataType="text" Length="6" SASFieldName="SITEID">
        <Description>
          <TranslatedText xml:lang="en">Study Site Identifier</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.AGE" Name="AGE" DataType="integer" Length="3" SASFieldName="AGE">
        <Description>
          <TranslatedText xml:lang="en">Age</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.AGEU" Name="AGEU" DataType="text" Length="5" SASFieldName="AGEU">
        <Description>
          <TranslatedText xml:lang="en">Age Units</TranslatedText>
        </Description>
        <def:Origin Type="Assigned" Source="Sponsor"/>
      </ItemDef>
      <ItemDef OID="IT.DM.SEX" Name="SEX" DataType="text" Length="1" SASFieldName="SEX">
        <Description>
          <TranslatedText xml:lang="en">Sex</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.RACE" Name="RACE" DataType="text" Length="25" SASFieldName="RACE">
        <Description>
          <TranslatedText xml:lang="en">Race</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <ItemDef OID="IT.DM.COUNTRY" Name="COUNTRY" DataType="text" Length="3" SASFieldName="COUNTRY">
        <Description>
          <TranslatedText xml:lang="en">Country</TranslatedText>
        </Description>
        <def:Origin Type="Collected" Source="Investigator">
          <def:DocumentRef leafID="LF.acrf">
            <def:PDFPageRef PageRefs="1" Type="PhysicalRef"/>
          </def:DocumentRef>
        </def:Origin>
      </ItemDef>
      <def:leaf ID="LF.acrf" xlink:href="acrf.pdf">
        <def:title>Annotated Case Report Form</def:title>
      </def:leaf>
    </MetaDataVersion>
  </Study>
</ODM>

expected/dm.csv

Edit
3 rows
expected/dm.csv
DOMAINSTUDYIDUSUBJIDSUBJIDRFSTDTCSITEIDAGEAGEUSEXRACECOUNTRY
DMCATH00012025-01-08UCSD34YEARSFWHITEUSA
DMCATH00022025-01-15UCSD67YEARSMBLACK OR AFRICAN AMERICANUSA
DMCATH0003—MCGILL52YEARSFASIANCAN
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Variable NameVariable LabelTypeLengthControlled Terms or FormatOriginCoreConversion DefinitionVariable TypeVariable OrderComments for Define
DOMAINDomain AbbreviationChar2AssignedReqSet constant value "DM".SDTM1
STUDYIDStudy IdentifierChar20ProtocolReqCopy value from DM_RAW.STUDYID.SDTM2
USUBJIDUnique Subject IdentifierChar30AssignedReqCopy value from DM_RAW.USUBJID.SDTM3
SUBJIDSubject Identifier for the StudyChar10CollectedReqCopy value from DM_RAW.SUBJID.SDTM4
RFSTDTCSubject Reference Start Date/TimeCharISO 8601CollectedExpCopy value from DM_RAW.RFSTDTC.SDTM5
SITEIDStudy Site IdentifierChar10CollectedReqCopy value from DM_RAW.SITEID.SDTM6
AGEAgeNum3CollectedExpCopy value from DM_RAW.AGE.SDTM7
AGEUAge UnitsChar6AssignedExpSet constant value "YEARS".SDTM8
SEXSexChar1CollectedReqCopy value from DM_RAW.SEX.SDTM9
RACERaceChar40CollectedExpCopy value from DM_RAW.RACE.SDTM10
COUNTRYCountryChar3CollectedReqCopy value from DM_RAW.COUNTRY.SDTM11
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default
1.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part
1.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/sdtm-dm-sdtmig33/full.md

Edit
13 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a DM dataset with one record per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, SUBJID, RFSTDTC, SITEID, AGE, AGEU, SEX, RACE, COUNTRY

DOMAIN is "DM" and AGEU is "YEARS". RFSTDTC is the subject's reference start date and has no value when the subject has no reference start date.

Read the source datasets from /app/input and save the completed dataset as /app/output/dm.csv.

prompts/sdtm-dm-sdtmig33/conventions.md

Edit
11 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a DM dataset with one record per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, SUBJID, RFSTDTC, SITEID, AGE, AGEU, SEX, RACE, COUNTRY

DOMAIN is "DM".

Read the source datasets from /app/input and save the completed dataset as /app/output/dm.csv.

prompts/sdtm-dm-sdtmig33/brief.md

Edit
9 lines

Following CDISC SDTM standards, use the provided DM_RAW dataset to create a DM dataset with one record per subject.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, SUBJID, RFSTDTC, SITEID, AGE, AGEU, SEX, RACE, COUNTRY

Read the source datasets from /app/input and save the completed dataset as /app/output/dm.csv.

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_project("project.yaml")$spec("DM")$run()$output

Python

Edit
3 lines
import yamaayamaa.project("project.yaml").spec("DM").run().output

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/sdtm-dm-sdtmig33/result.R

Edit
29 lines
# Create the SDTM Demographics domain from the supplied subject data.source_path <- file.path("/app/input", "dm_raw.csv")output_path <- file.path("/app/output", "dm.csv")DM_RAW <- read.csv(source_path, colClasses = "character",                   stringsAsFactors = FALSE, na.strings = "",                   check.names = FALSE)required <- c("STUDYID", "USUBJID", "SUBJID", "RFSTDTC", "SITEID",              "AGE", "SEX", "RACE", "COUNTRY")stopifnot(all(required %in% names(DM_RAW)),          !anyNA(DM_RAW$USUBJID), !anyDuplicated(DM_RAW$USUBJID))DM <- data.frame(  DOMAIN = rep("DM", nrow(DM_RAW)),  STUDYID = DM_RAW$STUDYID,  USUBJID = DM_RAW$USUBJID,  SUBJID = DM_RAW$SUBJID,  RFSTDTC = DM_RAW$RFSTDTC,  SITEID = DM_RAW$SITEID,  AGE = as.numeric(DM_RAW$AGE),  AGEU = rep("YEARS", nrow(DM_RAW)),  SEX = DM_RAW$SEX,  RACE = DM_RAW$RACE,  COUNTRY = DM_RAW$COUNTRY,  stringsAsFactors = FALSE)dir.create("/app/output", showWarnings = FALSE)write.csv(DM, output_path, row.names = FALSE, na = "")

solutions/sdtm-dm-sdtmig33/result.py

Edit
35 lines
from pathlib import Pathimport pandas as pddef main():    source = pd.read_csv(        Path("/app/input/dm_raw.csv"), dtype=str, keep_default_na=False    )    dm = source.copy()    dm["DOMAIN"] = "DM"    dm["AGEU"] = "YEARS"    columns = [        "DOMAIN",        "STUDYID",        "USUBJID",        "SUBJID",        "RFSTDTC",        "SITEID",        "AGE",        "AGEU",        "SEX",        "RACE",        "COUNTRY",    ]    dm = dm.loc[:, columns].drop_duplicates()    if dm["USUBJID"].duplicated().any():        raise ValueError("Conflicting source records for a subject")    output = Path("/app/output")    output.mkdir(exist_ok=True)    dm.to_csv(output / "dm.csv", index=False, na_rep="")if __name__ == "__main__":    main()

solutions/sdtm-dm-sdtmig33/result.sas

Edit
15 lines
/* SDTM DM: preserve character identifiers and ISO 8601 reference dates. */data dm;    length DOMAIN $2 STUDYID $40 USUBJID $80 SUBJID $20           RFSTDTC $10 SITEID $20 AGE 8 AGEU $5 SEX $1           RACE $80 COUNTRY $3;    infile '/app/input/dm_raw.csv' dsd dlm=',' firstobs=2 truncover;    input STUDYID :$40. USUBJID :$80. SUBJID :$20.          SITEID :$20. RFSTDTC :$10. AGE          SEX :$1. RACE :$80. COUNTRY :$3.;    DOMAIN = 'DM';    AGEU = 'YEARS';run;proc export data=dm outfile='/app/output/dm.csv' dbms=csv replace;run;