Module SDTM V3.1.1 (Run Time)

Overview

This is the SDTM 3.1.1 run-time macro library.
Since: V1.2

Macro Summary

Module SDTM V3.1.1 (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
Framework
%sdtmutil_buildsasreferences;
Note: Not used and will be deprecated in the next release.
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';
%sdtmutil_getchecks(_cstControl=, _cstMeta=, _cstMsg=, _cstDomain="*", _cstOutDS=, _cstIncludeDraft=true);
Note: Deprecated.
Internal
SDTM Utility
%sdtmutil_iso8601(_cstString=);
%sdtmutil_listsettings(group=_ALL_);
Note: Deprecated.

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 SASReferences) 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: 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_buildsasreferences

Note: Not used and will be deprecated in the next release.
%sdtmutil_buildsasreferences;
[Exposure: Not specified ] [ Macro type: Not specified ]
File: sdtmutil_buildsasreferences.sas

%sdtmutil_createformatsfromcrtdds

%sdtmutil_createformatsfromcrtdds;
[ Exposure: external] [ Macro Type: SDTM Tool]
This sample utility macro attempts to derive codelists from a CRT-DDS data library derived from the define.xml file for a CDISC SDTM study.
These source metadata files are used by the SAS Clinical Standards Toolkit to create codelists as provided in the CDISC CRT-DDS (define.xml) files:
  • codelists
  • codelistitems
  • clitemdecodetranslatedtext
This is the general strategy:
  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]
This sample utility macro attempts to derive source metadata files from a CRT-DDS data library derived from the define.xml file for a CDISC SDTM study.
The itemgroupleaf data set is used by this macro to generate a list of XPT files.
This is the general strategy:
  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 specify 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]
This sample utility macro attempts to derive source metadata files from a CRT-DDS data library derived from the define.xml file for a CDISC SDTM study.
These 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
This is the general strategy:
  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]
SAS library for a CDISC SDTM study.
These 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
This is the general strategy:
  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). If it is not specified, data set keys are estimated based on columns that 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 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 values are marked as <--- HARDCODE.
Limitations:
Here are two scenarios that have not been addressed:
  • Split domains, such as QS**
  • SDTM 3.1.2 FA multiple domains (for example, FACM)
File: sdtmutil_createsrcmetafromsaslib.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.
These 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
This is the general strategy:
  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:
Here 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_getchecks

%sdtmutil_getchecks(_cstControl=, _cstMeta=, _cstMsg=, _cstDomain=*, _cstOutDS=, _cstIncludeDraft=true);
[ Exposure: Not specified ] [ Macro type: Not specified ]
Note: Deprecated.
Parameters:
  • _cstControl
  • _cstMeta
  • _cstMsg
  • _cstDomain
  • _cstOutDS
  • _cstIncludeDraft
File: sdtmutil_getchecks.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 specifies 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 that specifies a message that describes the validity of the input string.
    _cstISOinfo: String that specifies an informational message that provides additional details about the string.
    _cstISOtype: String.
File: sdtmutil_iso8601.sas

%sdtmutil_listsettings

%sdtmutil_listsettings(group=_ALL_);
[ Exposure: Not specified ] [ Macro type: Not specified ]
Note: Deprecated.
Parameters:
  • group
File: sdtmutil_listsettings.sas