Module SDTM V3.1.1 (Runtime)

This is the SDTM 3.1.1 runtime macro library.

Since: V1.2

Macro Summary
external

%sdtm_validate(_cstCallingPgm=Unspecified);
Validates CDISC SDTM model files.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
internal

%sdtmcheckutil_recordlookup(_cstSourceDS=&_cstDSName, _cstSourceLib=&_cstRefOnly);
Identifies records in _cstSourceDS not found in the referenced lookup data set.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
internal

%sdtmutil_buildcheckdomainlist(_cstCheckDS=, _cstWhereClause=, _cstOutputDS=);
Builds a data set that specifies domains to validate by each check.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
external

%sdtmutil_createformatsfromcrtdds;
Derives codelists from a CRT-DDS data library.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
external

%sdtmutil_createsasdatafromxpt;
Derives source metadata files from a CRT-DDS data library.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
external

%sdtmutil_createsrcmetafromcrtdds;
Derives source metadata files from a CRT-DDS data library.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
external

%sdtmutil_createsrcmetafromsaslib;
Derives source metadata files from a SAS data library.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.
internal

%sdtmutil_iso8601(_cstString=);
Verifies that a string is in a valid ISO 8601 format.

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Macro Detail

%sdtm_validate(_cstCallingPgm=Unspecified);

[ Exposure: external ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Validates CDISC SDTM model files.

This macro iterates through the validation checks to be run and writes
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 File Inputs:
run-time (type=control,subtype=validation in sasreferences) check data set

Expected Macro Variables:
_cstCheckSortOrder - Order in which validation checks are to be run
_cstDebug - Turns debugging on or off for the session
_cstGRoot - Root path of the global standards library
_cstMetrics - Enables or disables metrics reporting
_cstMetricsCntNumBadChecks - Validation metrics: validation checks not
        run
_cstMetricsCntNumChecks - Validation metrics: distinct validation check
        invocations
_cstMetricsCntNumContent - Validation metrics: number of content
        problems detected
_cstMetricsCntNumErrors - Validation metrics: number of errors detected
_cstMetricsCntNumNotes - Validation metrics: number of notes detected
_cstMetricsCntNumStructural - Validation metrics: number of structural
        problems detected
_cstMetricsCntNumWarnings - Validation metrics: number of warnings
        detected
_cstMetricsDS - Data set used to accumulate metrics for a validation
        process
_cstMetricsNumBadChecks - Validation metrics: calculate validation
        checks not run
_cstMetricsNumChecks - Validation metrics: calculate distinct validation
        check invocations
_cstMetricsNumContent - Validation metrics: calculate number of content
        problems detected
_cstMetricsNumErrors - Validation metrics: calculate number of errors
        detected
_cstMetricsNumNotes - Validation metrics: calculate number of notes
        detected
_cstMetricsNumStructural - Validation metrics: calculate number of
        structural problems detected
_cstMetricsNumWarnings - Validation metrics: calculate number of
        warnings detected
_cstMetricsTimer - Validation metrics: include estimate the elapsed time
        to perform each action
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated%
_cstVersion - Version of the SAS Clinical Standards Toolkit
_cst_MsgID - Results: Result or validation check ID
_cst_MsgParm1 - Messages: Parameter 1
_cst_MsgParm2 - Messages: Parameter 2
_cst_rc - Task error status
studyRootPath - Root path of the study library
Parameters:
_cstCallingPgm - - optional - The name of the driver module calling
        this macro.
File: sdtm_validate.sas
First available in version: 1.2

%sdtmcheckutil_recordlookup(_cstSourceDS=&_cstDSName, _cstSourceLib=&_cstRefOnly);

[ Exposure: internal ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Identifies records in _cstSourceDS not found in the referenced lookup data set.

This macro creates work._cstproblems, which 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).

Expected Macro Variables:
_cstDSName - Source data set evaluated by the validation check
_cstDebug - Turns debugging on or off for the session
_cstRefOnly - Source libref for the lookup (parent) domain
Parameters:
_cstSourceDS - - required - The source data set to evaluate by the
        validation check. Must be an SDTM relational data set (for example,
        CO, RELREC, or SUPPxx).
        Default: &_cstDSName
_cstSourceLib - - required - The source libref for the lookup (parent)
        domain. The parent domain is determined by the RDOMAIN variable in
        the source data set.
        Default: &_cstRefOnly
File: sdtmcheckutil_recordlookup.sas
First available in version: 1.2

%sdtmutil_buildcheckdomainlist(_cstCheckDS=, _cstWhereClause=, _cstOutputDS=);

[ Exposure: internal ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Builds a data set that specifies domains to validate by each check.

This macro builds a data set that specifies the domains to validate by each
check, based on the contents of the validation check data set columns
tableScope and columnScope.

Required File Inputs:
only as specified in the parameters

Expected Macro Variables:
_cstResultsDS - Results data set
_cstSrcData - Results: Source entity being evaluated
_cst_MsgID - Results: Result or validation check ID
_cst_MsgParm1 - Messages: Parameter 1
_cst_MsgParm2 - Messages: Parameter 2
_cst_rc - Task error status
Parameters:
_cstCheckDS - - optional - The validation check data set that contains
        the checks for a standard and standardversion. Typically, this is
        the validation_master data set.
_cstWhereClause - - optional - The WHERE clause to subset _cstCheckDS.
        The syntax must comply with a SAS statement argument such as any of
        these: VAR=1
        upcase(var2)="Y"
        checkstatus>0
_cstOutputDS - - required - The 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
First available in version: 1.2

%sdtmutil_createformatsfromcrtdds;

[ Exposure: external ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Derives codelists from a CRT-DDS data library.

This sample utility macro derives code lists from a CRT-DDS data library that
is derived from define.xml 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 format catalog.

Assumptions:
1. The source data is read from a single SAS library. You can modify the
code to reference multiple libraries by using library concatenation.
2. You can specify only one study reference. Multiple study references
require modification of the code.
3. The following macro variables have been set either before invoking this
macro or be derived from the _cstSASRefs data set:
_cstCTCat (type=fmtsearch, format catalog name)
_cstCTLibrary (type=fmtsearch, target library for formats)
_cstSASrefLib (type=sourcedata, library of derived CDT-DDS data sets)
_cstSrcMetaLib (type=sourcemetadata, libref for CRT-DDS source_study)
_cstSrcStudyDS (type=sourcemetadata, source_study data set name)
4. The following macro variables have been set previously:
_cstStandard (for example, CDISC-SDTM)
_cstStandardVersion (for example, 3.1.2)

Expected Macro Variables:
_cstCTCat - Format catalog name
_cstCTLibrary - Target library for formats
_cstGRoot - Root path of the global standards library
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSASrefLib - Library of derived CDTDDS data sets
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstSrcMetaLib - Libref for CRTDDS source_study
_cstSrcStudyDS - Source study data set name
_cstStandard - Name of a standard registered to the SAS Clinical
        Standards Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstVersion - Version of the SAS Clinical Standards Toolkit
studyRootPath - Root path of the study library
File: sdtmutil_createformatsfromcrtdds.sas
First available in version: 1.3

%sdtmutil_createsasdatafromxpt;

[ Exposure: external ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Derives source metadata files from a CRT-DDS data library.

This sample utility macro derives source metadata files from a CRT-DDS data
library that is 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 the itemgroupleaf data set to create a list of XPT files, and
generate SAS code to create SAS data sets using the XPORT LIBNAME option.
2. Submit the generated code to create the SAS data sets.

Assumptions:
1. CRT-DDS data is read from a single SAS library.
2. The following macro variables have been set either before invoking this
macro or be derived from the _cstSASRefs data set:
_cstSASrefLib (type=sourcedata, library of derived CRT-DDS data sets)
_cstSrcMetaLib (type=sourcemetadata, libref for CRT-DDS source_study)
_cstSrcStudyDS (type=sourcemetadata, source_study data set name)
_cstStudyLibrary (type=targetdata, target library for new data sets)
_cstXMLLibrary (type=externalxml, fileref of define xml file)
3. The following macro variables have been set previously:
_cstStandard (for example, CDISC-SDTM)
_cstStandardVersion (for example, 3.1.2)

Expected Macro Variables:
_cstGRoot - Root path of the global standards library
_cstLRECL - Logical record length setting for filename statement
_cstResultsDS - Results data set
_cstSASRefLib - Library of derived CRT-DDS data sets
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstSrcMetaLib - Libref for CRT-DDS source_study
_cstSrcStudyDS - Source study data set name
_cstStandard - Name of a standard registered to the SAS Clinical
        Standards Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstStudyLibrary - Target library for new data sets
_cstVersion - Version of the SAS Clinical Standards Toolkit
_cstXMLLibrary - Fileref of define xml file
studyRootPath - Root path of the study library
File: sdtmutil_createsasdatafromxpt.sas
First available in version: 1.3

%sdtmutil_createsrcmetafromcrtdds;

[ Exposure: external ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Derives source metadata files from a CRT-DDS data library.

This sample utility macro derives source metadata files from a CRT-DDS data
library that is 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 to derive 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 the information.
2. Use reference_tables and reference_columns for matching the columns.

NOTE: This is ONLY an attempted approximation of source metadata. No
assumptions should be made that the result accurately represents the
study data.

Assumptions:
1. The source data is read from a single SAS library. You can modify the
code to reference multiple libraries by using library concatenation.
2. Only one study reference can be specified. Multiple study references
require modification of the code.

Expected Macro Variables:
_cstCRTDataLib - CRT-DDS source data library
_cstCRTMetaLibrary - Library for CRT-DDS derived metadata source study
_cstCRTStudyDS - CRT-DDS derived metadata source study data set
_cstGRoot - Root path of the global standards library
_cstLRECL - Logical record length setting for filename statement
_cstRefColumnDS - CRT-DDS reference column data set
_cstRefTableDS - CRT-DDS reference table data set
_cstReflib - CRT-DDS reference library
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSDTMDataLib - SDTM metadata library
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstStandard - Name of a standard registered to the SAS Clinical
        Standards Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstTrgMetaLibrary - Target library for CRT-DDS source data
_cstTrgStudyDS - Target source study metadata data set
_cstTrgTableDS - Target source column metadata data set
_cstVersion - Version of the SAS Clinical Standards Toolkit
studyRootPath - Root path of the study library
File: sdtmutil_createsrcmetafromcrtdds.sas
First available in version: 1.3

%sdtmutil_createsrcmetafromsaslib;

[ Exposure: external ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Derives source metadata files from a SAS data library.

This sample utility macro derives source metadata files from a SAS data library
for a CDISC-SDTM study.

These source metadata files are used by the SAS Clinical Standards Toolkit to
support CDISC SDTM validation and to derive CDISC CRT-DDS (define.xml) files:
source_tables
source_columns
source_study
source_values
source_documents

This is the general strategy:
1. Use PROC CONTENTS output as the primary source of the information.
2. Use reference_tables and reference_columns for matching the columns.
3. Use class_columns as a generic source for the metadata.

NOTE: This is ONLY an attempted approximation of source metadata. No
assumptions should be made that the result accurately represents the
study data.

Assumptions:
1. The source data is read from a single SAS library. You can modify the
code to reference multiple libraries by using library concatenation.
2. The data set keys are estimated by the sort order of the source data
(if specified). If it is not specified, the data set keys are estimated
based on columns that SAS uses to define keys in the reference standard.
3. 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)).
4. 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 below.

Limitations:
1. source_documents and source_values providing content to define.xml files
not yet supported
2. Here are two scenarios that have not been addressed:
- Split domains, such as QS**
- SDTM 3.1.2 FA multiple domains (for example, FACM, etc.)

          
History:
   2013-11-11
Added initialization of source_values and source_documents
Expected Macro Variables:
_cstCRTDataLib - CRT-DDS Source data library
_cstClassColumnDS - Reference class column metadata data set
_cstGRoot - Root path of the global standards library
_cstRefColumnDS - Reference column metadata data set
_cstRefLib - Reference metadata library
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSDTMDataLib - SDTM Source data library
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstStandard - Name of a standard registered to the SAS Clinical
        Standards Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstTrgMetaLibrary - Target Source metadata library
_cstTrgStudyDS - Target Source study metadata data set
_cstVersion - Version of the SAS Clinical Standards Toolkit
studyRootPath - Root path of the study library
File: sdtmutil_createsrcmetafromsaslib.sas
First available in version: 1.3

%sdtmutil_iso8601(_cstString=);

[ Exposure: internal ]

Deprecated. This macro will no longer be available in future releases of the SAS Clinical Standards Toolkit. Support of SDTM 3.1.1 is currently scheduled for discontinuation effective with the 1.7 release.

Verifies that a string is in a valid ISO 8601 format.

The verification includes tests that are specific to SDTM and clinical trials
data in general.

This macro must be called from within a DATA step. It can be called more than
once within a single DATA step.

Returns the following as SAS data set variables. You are expected to copy any
values you want to keep. All variables are automatically cleared at the end of
the current data set.

These are the data set variables that are returned:
1. _cstISOisValid - numeric
The binary flag that denotes whether or not the ISO string is a valid
ISO 8601 string.
0=String is invalid
1=String is valid.
2. _cstISOrc - numeric
The return code. A value of 0 indicates that no problems were found.
Any other value is a coding error number.
3. _cstISOmsg - string
The message that describes the validity of the input string.
4. _cstISOinfo - string
The informational message that specifies additional details about the
string.
5. _cstISOtype - string
The type of ISO 8601 string that _cstString contains.

Expected Macro Variables:
_cstISOParseCharList - String used to parse the value of _csString for
        numeric parts
_cstMaxISOStringLength - Maximun length of the ISO String (64)
Parameters:
_cstString - - required - The name of the SAS data set variable to check.
File: sdtmutil_iso8601.sas
First available in version: 1.2