Module CT V1.0.0 (Runtime)

This is the CDISC-CT 1.0.0 runtime macro library.

Since: V1.5

Macro Summary
external

%ct_createformats(_cstLang=en, _cstCreateCatalog=1, _cstKillCatFirst=0, _cstUseExpression=, _cstAppendChar=F, _cstDeleteEmptyColumns=1, _cstTrimCharacterData=1);
Derives codelists from terminology data sets as a catalog and as a data set.
external

%ct_getstatic(_cstName=, _cstVar=);
Returns constant values that are used by other macros.
external

%ct_read(_cstBuildSrcMetadata=Y);
Reads a CDISC-CT V1.0.0 XML file into the SAS representation of CT 1.0.0.
external

%ct_validate;
Validates CDISC ODM-CT model files.
external

%ct_write(_cstCreateDisplayStyleSheet=0, _cstOutputEncoding=UTF-8, _cstHeaderComment=, _cstResultsOverrideDS=, _cstLogLevel=info);
Writes an CDISC-CT V1.0.0 XML file.

Macro Detail

%ct_createformats(_cstLang=en, _cstCreateCatalog=1, _cstKillCatFirst=0, _cstUseExpression=, _cstAppendChar=F, _cstDeleteEmptyColumns=1, _cstTrimCharacterData=1);

[ Exposure: external ]
Derives codelists from terminology data sets as a catalog and as a data set.

This macro derives code lists from the data sets that form the SAS
representation of the controlled terminology XML files as published on the
NCI EVS website (http://evs.nci.nih.gov/ftp1/CDISC).

These source metadata files are used by the SAS Clinical Standards Toolkit to
create codelists as provided in the CDISC EVS/NCI XML files:

odm
study
metadataversion
codelists
codelisttranslatedtext
codelistsynonym
codelistitems
clitemdecodetranslatedtext
codelistitemsynonym
enumerateditemsynonym
enumerateditems

This is the general strategy:
1. Combine controlled terminology data.
1. Create the cntlin data set from the controlled terminology.
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 CT data sets)
_cstTrgDataLibrary (type=targetdata, library of derived format
data set)
_cstCTData (type=targetdata, format catalog name)
4. The following macro variables have been set previously:
_cstStandard (CDISC-CT)
_cstStandardVersion (for example, 1.0.0)

Expected Macro Variables:
_cstCTCat - Format catalog name
_cstCTData - Format data set name
_cstCTLibrary - Target library for formats catalog
_cstGRoot - Root path of the global standards library
_cstLRECL - Logical record length setting for filename statement
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSASrefLib - Library of derived CDT-DDS data sets
_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
_cstTrgDataLibrary - Target library for formats data set
_cstVersion - Version of the SAS Clinical Standards Toolkit
studyRootPath - Root path of the Study library
Parameters:
_cstLang  - optional - Language tag for TranslatedText.
        Default: en
_cstCreateCatalog  - optional - Create format catalog.
        1: This macro looks in SASReferences for a record with a type of
        fmtsearch and uses that record.
        0: This macro does not create a catalog, even if a record is
        specified in SASReferences.
        Values: 0 | 1
        Default: 1
_cstKillCatFirst  - optional - Empty catalog first if it exists before
        creating the new format catalog entries.
        1: The macro will empty the format catalog before creating the new
        format catalog entries.
        0: The macro does not empty the format catalog first.
        Values: 0 | 1
        Default: 0
_cstUseExpression  - optional - Expression to create the SAS format name.
        This expression will be assigned to the fmtname if it is not empty:
        fmtname = %unquote(&_cstUseExpression)
        Examples:
        - %str(strip(put(cdiscsubmissionvalue, $_qs32.)))
        where $_qs has values like:
        'ADAS-Cog CDISC Version TESTCD' = 'ADASCOGCD'
        - %str(cats("QS", put(_n_, z3.), "F"))
        - %str(cats(ExtCodeId, "F"))
        - %nrstr(%MyMacro(param1=X, param2=Y))
_cstAppendChar  - optional - Letter to append in case SAS format name
        ends in a digit.
        Default: F
_cstDeleteEmptyColumns  - optional - Delete columns that are completely
        missing.
        1: The macro will delete columns in the output data set, both
        numeric and character, that have only missing values.
        0: No columns will be deleted from the output data set.
        Values: 0 | 1
        Default: 1
_cstTrimCharacterData  - optional - Truncate character data in output
        data set to the minimum value needed.
        1: The macro will change the length of the character columns in the
        output data set to the minimum value needed to contain the data.
        0: No truncation will take place.
        Values: 0 | 1
        Default: 1
File: ct_createformats.sas
First available in version: 1.5

%ct_getstatic(_cstName=, _cstVar=);

[ Exposure: external ]
Returns constant values that are used by other macros.

Parameters:
_cstName  The name of the value to retrieve.
        Values: CT_SASREF_TYPE_REFXML | CT_SASREF_TYPE_EXTXML |
        CT_SASREF_SUBTYPE_XML | CT_SASREF_SUBTYPE_STYLESHEET |
        CT_JAVA_PARAMSCLASS | CT_JAVA_IMPORTCLASS|
        CT_JAVA_EXPORTCLASS | CT_JAVA_PICKLIST
_cstVar  The macro variable to populate with the value.
File: ct_getstatic.sas
First available in version: 1.5

%ct_read(_cstBuildSrcMetadata=Y);

[ Exposure: external ]
Reads a CDISC-CT V1.0.0 XML file into the SAS representation of CT 1.0.0.

This macro uses the SAS representation of a CDISC-CT XML file as the source
and converts it into SAS data sets. The inputs and outputs are specified in a
SASReferences file.

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstResultFlag - Results: Problem was detected
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstVersion - Version of the SAS Clinical Standards Toolkit
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the study library
Parameters:
_cstBuildSrcMetadata  - optional - Create the source metadata files
        (for example, source_tables and source_columns).
        Values: Y
        Default: Y
File: ct_read.sas
First available in version: 1.5

%ct_validate;

[ Exposure: external ]
Validates CDISC ODM-CT model files.

This macro iterates through the validation checks to be run and writes
validation results to the process Results and (optionally) to Metrics data
sets. These results are persisted to any permanent location based on
type=results records in SASReferences. 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 run
_cstColumnMetadata - Data set that contains column-level metadata that
        supports validation
_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
_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
_cstMetricsNumRecs - Validation metrics: calculate number of records
        evaluated
_cstMetricsNumStructural - Validation metrics: calculate number of
        structural problems detected
_cstMetricsNumSubj - Validation metrics: calculate number of subjects
        evaluated
_cstMetricsNumWarnings - Validation metrics: calculate number of
        warnings detected
_cstMetricsTimer - Validation metrics: include estimate the elapsed time
        to perform each action
_cstResultFlag - Results: Problem was detected
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstTableMetadata - Data set that contains table-level metadata that
        supports validation
_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
_cst_rcmsg - Message associated with _cst_rc
studyRootPath - Root path of the Study library
File: ct_validate.sas
First available in version: 1.5

%ct_write(_cstCreateDisplayStyleSheet=0, _cstOutputEncoding=UTF-8, _cstHeaderComment=, _cstResultsOverrideDS=, _cstLogLevel=info);

[ Exposure: external ]
Writes an CDISC-CT V1.0.0 XML file.

This macro uses the SAS representation of an CT XML file as source data and
converts it to the required XML structure. The inputs and outputs are
specified in a SASReferences file.

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstResultFlag - Results: Problem was detected
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSASRefs - Run-time SASReferences data set derived in process setup
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstVersion - Version of the SAS Clinical Standards Toolkit
_cst_rc - Task error status
_cst_rcmsg - Message associated with _cst_rc
Parameters:
_cstCreateDisplayStyleSheet  - optional - Create a style sheet in the
        same directory as the output XML file.
        1: This macro looks in SASReferences for a record with a type or
        subtype of referencexml/stylesheet and uses that record.
        0: This macro does not create the XML, even if a record is
        specified in SASReferences.
        Values: 0 | 1
        Default: 0
_cstOutputEncoding  - optional - The XML encoding to use for the CT
        file that is created.
        Default: UTF-8
_cstHeaderComment  - optional - The short comment that is added to the
        top of the CT XML file that is produced. If this parameter is not
        specified, a default is used.
_cstResultsOverrideDS  - optional - The (libname.)member that refers to
        a Results data set to create. If this parameter is not specified,
        the Results data set that is specified by &_cstResultsDS is used.
_cstLogLevel  - required - The level of error reporting.
        Values: info | warning | error | fatal error
        Default: info
File: ct_write.sas
First available in version: 1.5