SAS, CDISC & SDTM Foundations — Part 1
Big picture
Clinical-trial data work moves from conducting the trial, to collecting, cleaning, and validating the data, and then to submitting standardized data to regulators. SDTM (Study Data Tabulation Model) provides a common structure for submission datasets. The workshop introduces raw Excel data, SDTM domains and variables, validation, and SAS Studio import steps.
- Raw trial data and SDTM basics
- CRF (Case Report Form): A form used to capture information collected about trial participants. The collected source fields are raw data; they are not yet SDTM datasets.
- Domain: A subject-area dataset. Examples include DM (Demographics), VS (Vital Signs), LB (Laboratory), AE (Adverse Events), MH (Medical History), EX (Exposure), and DS (Disposition).
- Variable: A field in a domain. Raw field names and values are mapped into standard SDTM variables and conventions.
- USUBJID: The unique subject identifier used consistently to link a participant’s records across domains.
- RFSTDTC / RFENDTC: Subject reference start and end date variables.
Standardized values matter too: categorical fields such as sex and race should follow controlled terminology, and planned versus actual treatment-arm information should be checked for consistency.
- Mapping examples
DM — Demographics
A raw subject ID can be mapped to USUBJID; date of birth to BRTHDTC; and the dataset is identified as domain DM. The example derives age from birth date and a reference date, and removes names from the submission-style data.
AE — Adverse Events
Examples of raw-to-standard mappings include severity → AESEV, seriousness criteria → AESER, relationship to study treatment → AEREL, outcome → AEOUT, and event start/end dates → AESTDTC / AEENDTC. AESEQ provides a sequence number for records within a subject.
EX — Exposure
The EX domain records investigational-product administration. Example fields include drug, dose, dose units, route, and start/end dates; named variables include EXDOSE, EXDOSU, EXSTDTC, and EXENDTC.
VS — Vital Signs
A combined measurement such as blood pressure is represented as separate test records, such as systolic and diastolic pressure. Important variables include:
- VSTESTCD — test code; VSTEST — test name
- VSORRES — original result; VSORRESU — original-result units
- VSSEQ — record sequence; VSPOS — position; VSDTC — measurement date/time
Examples include height, weight, and systolic/diastolic blood pressure. The speaker describes test codes as uppercase and test names as mixed case. Dates use ISO 8601 conventions; date/time variables commonly end in DTC.
- Data validation and comparison
Before treating a dataset as submission-ready:
- Sort or review records by subject identifier; look for unexpected duplicate records and missing values.
- Check date formats and chronology—for example, whether exposure, consent, treatment, and vital-sign dates make sense relative to one another.
- Compare the programmed output with the expected SDTM structure: variable names and order, types, labels, lengths, formats, and controlled terminology.
The emphasis is on checking metadata and standardized values as well as the data values themselves.
- SAS Studio workflow: importing raw Excel data
- Access SAS OnDemand, create/sign in to an account, and launch SAS Studio. The speaker describes it as free for students and academic users.
- In SAS Studio, use Upload (the up-arrow) to select and upload the Excel workbook.
- Use PROC IMPORT to read a worksheet into a SAS dataset. The demonstrated options include:
- DATAFILE= — uploaded workbook path
- OUT= — output SAS dataset
- DBMS=XLSX — Excel workbook engine
- REPLACE — replace an existing output dataset
- SHEET= — worksheet to import
- GETNAMES=YES — use the first row as variable names
- Repeat for the raw DM, AE, and VS worksheets, using the correct file path and worksheet name.
- Inspect the imported data and metadata (variable names, types, lengths, and formats) before mapping.
Key distinction: PROC IMPORT brings the raw worksheet into SAS; it does not by itself create SDTM domains or standard variables.
- SAS Studio areas
- Code: Write and run SAS programs.
- Log: Review notes, warnings, and errors from program execution.
- Results/output: View generated output.
The hands-on workshop then uses imported raw data to build DM and VS SDTM datasets.
Quick review
- What is the difference between a raw worksheet and an SDTM domain?
- Why should USUBJID remain consistent across domains?
- How are systolic and diastolic blood pressure represented in VS?
- Name three structural or metadata features to compare when validating SDTM output.
- Which PROC IMPORT option specifies the worksheet, and which uses the first row as variable names?
Answers: Raw worksheets contain source fields; SDTM domains use standardized structures and variables. Consistent USUBJID links a subject’s data across domains. Systolic and diastolic are separate test records. Validation includes names/order, types, labels, lengths, formats, and controlled terminology. SHEET= chooses the worksheet; GETNAMES=YES uses first-row names.