Module SDTM V3.1.2 (Run Time)

Overview

This is the SDTM 3.1.2 run-time macro library.
Since: V1.3

Macro Summary

Module SDTM V3.1.2 (Run Time) Macro Summary
Exposure
Macro
External
SDTM Validation Process
%sdtm_validate /des='CST: Validate CDISC SDTM model files';
Internal
SDTM Validation Check Utility
%sdtmcheckutil_recordlookup(_cstSourceDS=&_cstDSName, _cstSourceLib=&_cstRefOnly);
Internal
Framework Utility
%sdtmutil_buildcheckdomainlist(_cstCheckDS=, _cstWhereClause=, _cstOutputDS=);
External
SDTM Tool
%sdtmutil_createformatsfromcrtdds;
External
SDTM Tool
%sdtmutil_createsasdatafromxpt /des='CST: Create SAS Data Sets from XPT';
External
SDTM Tool
%sdtmutil_createsrcmetafromcrtdds /des='CST: Create SDTM metadata from CRTDDS Data';
External
SDTM Tool
%sdtmutil_createsrcmetafromsaslib /des='CST: Create SDTM metadata from SAS library';
Internal
SDTM Utility
%sdtmutil_iso8601(_cstString=);

Macro Detail

%sdtm_validate

%sdtm_validate /des='CST: Validate CDISC SDTM model files';
[ Exposure: external ] [ Macro Type: SDTM Validation Process ]
sdtm_validate
Validate CDISC SDTM model files.
The basic function of this code module is to cycle through the validation checks to be run, writing validation results to the process Results and Metrics data sets. These are persisted to any permanent location based on type=results records in the SASReferences file. Process cleanup is based on the _cstDebug global macro variable.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs: run-time (type=control,subtype=validation in SASsreferences) check data set
File: sdtm_validate.sas

%sdtmcheckutil_recordlookup

%sdtmcheckutil_recordlookup(_cstSourceDS=&_cstDSName, _cstSourceLib=&_cstRefOnly);
[ Exposure: internal ] [ Macro Type: SDTM Validation Check Utility ]
sdtmcheckutil_recordlookup
Creates work._cstproblems that contains any records that are included in the _cstSourceDS data set that cannot be found in the referenced lookup data set. For example, SUPPAE includes a record that points to a record in the AE domain that does not exist with the key values specified.
Note: This macro is called in _cstCodeLogic at a SAS DATA step level (that is, a full DATA step or PROC SQL invocation).
Required Global Macro Variables: (none)
Parameters:
  • _cstSourceDS—The source data set that is evaluated by the validation check.
  • _cstSourceLib—The source libref for the lookup domain.
File: sdtmcheckutil_recordlookup.sas

%sdtmutil_buildcheckdomainlist

%sdtmutil_buildcheckdomainlist(_cstCheckDS=, _cstWhereClause=, _cstOutputDS=);
[ Exposure: internal ] [ Macro Type: Framework utility ]
sdtmutil_buildcheckdomainlist
Builds a data set that identifies the domains to be validated by each check based on the contents of the validation check data set columns tablescope and columnscope.
Required Global Macro Variables: (none)
Required File Inputs: Only as specified in the parameters
Parameters:
  • _cstCheckDS—The validation check data set that contains the checks for a standard and standardversion. Typically, this is the Validation Master data set.
  • _cstWhereClause—An optional WHERE clause to subset _cstCheckDS. The syntax should comply with a SAS statement argument such as any of the following: VAR1=1, upcase(var2)="Y", or checkstatus>0.
  • _cstOutputDS—The output data set that is returned to the calling program. This data set contains a record for each domain that is referenced by a checkid, standardversion, and checksource.
File: sdtmutil_buildcheckdomainlist.sas

%sdtmutil_createformatsfromcrtdds

%sdtmutil_createformatsfromcrtdds;
[ Exposure: external] [ Macro Type: SDTM Tool]
sdtmutil_createformatsfromcrtdds
This sample utility macro attempts to derive code lists from a CRT-DDS data library derived from define.xml file for a CDISC SDTM study.
The following source metadata files are used by the SAS Clinical Standards Toolkit to create code lists as provided in CDISC CRT-DDS (define.xml) files:
  • codelists
  • codelistitems
  • clitemdecodetranslatedtext
The following is the general strategy that is used:
  1. Combine CRT-DDS data to create the cntlin data set.
  2. Read the cntlin data set using PROC FORMAT to create a format catalog.
Assumptions:
  • Source data is read from a single SAS library. The code can be modified to reference multiple libraries using library concatenation.
  • Only one study reference can be specified at this time. Multiple study references require modification of the code.
File: sdtmutil_createformatsfromcrtdds.sas

%sdtmutil_createsasdatafromxpt

%sdtmutil_createsasdatafromxpt /des='CST: Create SAS Data Sets from XPT';
[ Exposure: external] [ Macro Type: SDTM Tool]
sdtmutil_createsasdatafromxpt
This sample utility macro attempts to derive source metadata files from a CRT-DDS data library derived from define.xml file for a CDISC SDTM study.
The itemgroupleaf data set is used by this macro to generate a list of XPT files.
The following is the general strategy that is used:
  1. Read itemgroupleaf to create a list of XPT files and generate SAS code to create SAS data sets using the XPORT LIBNAME option.
  2. Submit generated code to create SAS data sets.
Assumptions:
  • CRT-DDS data is read from a single SAS library.
  • Currently, you must supply the libref for the location of the XPT files.
File: sdtmutil_createsasdatafromxpt.sas

%sdtmutil_createsrcmetafromcrtdds

%sdtmutil_createsrcmetafromcrtdds /des='CST: Create SDTM metadata from CRTDDS Data';
[ Exposure: external] [ Macro Type: SDTM Tool]
sdtmutil_createsrcmetafromcrtdds
This sample utility macro attempts to derive source metadata files from a CRT-DDS data library derived from define.xml file for a CDISC SDTM study.
The following source metadata files are used by the SAS Clinical Standards Toolkit to support CDISC SDTM validation and derivation of CDISC CRT-DDS (define.xml) files:
  • source_tables
  • source_columns
  • source_study
The following is the general strategy that is used:
  1. Use PROC CONTENTS output as the primary source of information.
  2. Use reference_tables and reference_columns for matching columns.
Assumptions:
  • Source data is read from a single SAS library. The code can be modified to reference multiple libraries using library concatenation.
  • Only one study reference can be specified at this time. Multiple study references require modification of the code.
File: sdtmutil_createsrcmetafromcrtdds.sas

%sdtmutil_createsrcmetafromsaslib

%sdtmutil_createsrcmetafromsaslib /des='CST: Create SDTM metadata from SAS library';
[ Exposure: external] [ Macro Type: SDTM Tool]
sdtmutil_createsrcmetafromsaslib
SAS library for a CDISC SDTM study.
The following source metadata files are used by the SAS Clinical Standards Toolkit to support CDISC SDTM validation and derivation of CDISC CRT-DDS (define.xml) files:
  • source_tables
  • source_columns
  • source_study
The following is the general strategy that is used:
  1. Use PROC CONTENTS output as the primary source of information.
  2. Use reference_tables and reference_columns for matching columns.
  3. Use class_columns as a generic source for metadata.
Note: This is only an attempted approximation of source metadata. No assumptions should be made that the results accurately represent the study data.
Assumptions:
  • Source data is read from a single SAS library. The code can be modified to reference multiple libraries using library concatenation.
  • Data set keys are estimated by the sort order of the source data (if set) and, if not, assumed based on the presence of columns SAS uses to define keys in the reference standard.
  • For any unknown domain, the domain class (events, interventions, or findings) is estimated based on the presence of the class-specific topic variable (that is, _TERM (events), _TRT (interventions), and _TESTCD (findings)).
  • Most column values in source_study are hardcoded because there is no metadata source. These values are used only to build the define.xml file. These are marked as <--- HARDCODE.
Limitations:
The following are two scenarios that have not yet been addressed:
  • Split domains, such as QS**
  • SDTM 3.1.2 FA multiple domains (for example, FACM)
File: sdtmutil_createsrcmetafromsaslib.sas

%sdtmutil_iso8601

%sdtmutil_iso8601(_cstString=);
[ Exposure: internal ] [ Macro Type: SDTM utility ]
sdtmutil_iso8601
Verifies whether a string is in a valid ISO 8601 format. The verification includes tests that are specific to SDTM and clinical trials data in general. Must be called from within a DATA step. It might be called more than once within a single DATA step.
Required Global Macro Variables: (none)
Required File Inputs: (none)
Parameters:
  • _cstString—String that designates the name of the SAS data set variable that is being checked. Returns SAS data set variables. The programmer is expected to copy any values he or she wants to keep. All variables are automatically dropped at the end of the current data set.
    _cstISOisValid—Numeric. Binary flag that denotes whether the ISO string is a valid ISO 8601 string. Valid values are 0 (string is invalid) and 1 (string is valid).
    _cstISOrc—Numeric return code. A value of 0 indicates that no problems were found. Any other value is a coding error number.
    _cstISOmsg—String. A message that describes the validity of the input string.
    _cstISOinfo—String. An informational message that provides additional details about the string.
    _cstISOtype—String.
File: sdtmutil_iso8601.sas