Advanced SDTM Programming Tip: Automating SUPPQUAL Domain Creation
Optimize Your SDTM Workflows with Efficient Automation Techniques
Introduction to SUPPQUAL Automation
The SUPPQUAL (Supplemental Qualifiers) domain is used to store additional information that cannot fit within a standard SDTM domain. Manually creating the SUPPQUAL domain can be time-consuming and error-prone, especially for large datasets. In this article, we’ll explore an advanced tip to automate its creation using SAS macros.
Use Case: Adding Supplemental Qualifiers to a Domain
Imagine you have an SDTM AE domain (Adverse Events) and need to capture additional details like the investigator’s comments or assessment methods that are not part of the standard AE domain.
Code Example: Automating SUPPQUAL Domain
/* Macro to Create SUPPQUAL Domain */
%macro create_suppqual(domain=, idvar=, qnam_list=);
%let domain_upper = %upcase(&domain);
%let suppqual = SUPP&domain_upper;
data &suppqual;
set &domain;
length RDOMAIN $8 IDVAR $8 QNAM $8 QLABEL $40 QVAL $200;
array qvars{*} &qnam_list;
do i = 1 to dim(qvars);
if not missing(qvars{i}) then do;
RDOMAIN = "&domain_upper";
USUBJID = USUBJID;
IDVAR = "&idvar";
IDVARVAL = &idvar;
QNAM = vname(qvars{i});
QLABEL = put(QNAM, $40.);
QVAL = strip(put(qvars{i}, $200.));
output;
end;
end;
drop i &qnam_list;
run;
/* Sort SUPPQUAL for submission readiness */
proc sort data=&suppqual;
by USUBJID RDOMAIN IDVAR IDVARVAL QNAM;
run;
%mend;
/* Example Usage: Automating SUPPAE */
%create_suppqual(domain=AE, idvar=AETERM, qnam_list=AECOMMENT AEASSESS);
Explanation of the Code
RDOMAIN
: Captures the parent domain name (e.g., AE).array qvars{*}
: Iterates through the list of supplemental qualifiers provided as macro parameters.IDVAR
: Represents the key variable in the parent domain (e.g., AETERM).QLABEL
: Automatically assigns a label to the qualifier variable.QVAL
: Stores the actual value of the supplemental qualifier.
Advantages of This Approach
- Eliminates manual effort in creating SUPPQUAL domains.
- Highly reusable and scalable across different domains.
- Ensures consistency in handling supplemental qualifiers.
Pro Tip: Validation and Quality Control
Always validate the output SUPPQUAL dataset against CDISC compliance rules using tools like Pinnacle 21. Ensure that all required columns and relationships are correctly populated.