Module ODM V1.3.1 (Runtime)

This is the CDISC-ODM 1.3.1 runtime macro library.

Since: V1.5

Macro Summary
external

%odm_extractdomaindata(_cstSourceMetadata=, _cstSourceData=, _cstIsReferenceData=No, _cstSelectAttribute=Name, _cstSelectAttributeValue=, _cstLang=en, _cstMaxLabelLength=256, _cstAttachFormats=Yes, _cstODMMinimumKeyset=No, _cstOutputLibrary=, _cstOutputDS=, _cstOnlyTemplates=No);
Extract a SAS data set from the SAS representation of CDISC-ODM.
external

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

%odm_read(_cstBuildSrcMetadata=Y, _cstBuildFmtCat=Y, _cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English);
Reads a CDISC-ODM XML file into the SAS representation of CDISC-ODM.
external

%odm_validate(_cstCallingPgm=Unspecified);
Validates CDISC ODM model files.
external

%odm_write(_cstCreateDisplayStyleSheet=0, _cstOutputEncoding=UTF-8, _cstHeaderComment=, _cstResultsOverrideDS=, _cstLogLevel=info);
Writes an ODM XML file.

Macro Detail

%odm_extractdomaindata(_cstSourceMetadata=, _cstSourceData=, _cstIsReferenceData=No, _cstSelectAttribute=Name, _cstSelectAttributeValue=, _cstLang=en, _cstMaxLabelLength=256, _cstAttachFormats=Yes, _cstODMMinimumKeyset=No, _cstOutputLibrary=, _cstOutputDS=, _cstOnlyTemplates=No);

[ Exposure: external ]
Extract a SAS data set from the SAS representation of CDISC-ODM.

This macro extracts clinical data from ODM XML to serve as source data for
transformations that derive SDTM domain data sets. This macro builds a table
shell (0 observations) from ODM metadata (FormDef, ItemGroupDef and ItemDef)
and populates (with each call) a single data set from the ClinicalData or
ReferenceData sections of an ODM file.
In case _cstOnlyTemplates has the value Yes, onlt table shells will be created
without data set keys (__StudyOID, __MetaDataVersionOID, __SubjectKey, etc.)

Assumptions:
1. The original source ODM XML file contains sufficient metadata and content
to extract clinical and reference data.
2. A full SAS representation of the ODM file is available. (For example,
odm_read has been run against the XML file.)

Limitations:
1. The scope is limited to processing a single XML file. (For example, use
of PriorFileOID to reference another file is not permitted.)
2. A full MetaDataVersion section must be provided.
3. This implementation does not support reference to multiple
MetaDataVersions within the files(s) to be extracted.
4. ODM.FileType should equal Snapshot, thereby supporting only
TransactionType values of "Insert".
5. Any annotations, audit records, and signatures associated with the
extracted data are not processed.
6. Custom extensions to the XML file are excluded.
7. MeasurementUnit information associated with specific columns and values
is ignored.

This macro sets the _cst_rc and _cst_rcmsg global macro variables to indicate
that there were issues (_cst_rc ne 0).

          
History:
   2014-04-30
Added _cstOnlyTemplates parameter
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:
_cstSourceMetadata  - optional - The SAS libref for the SAS ODM
        metadata representation. If this parameter is not specified, the
        code looks in the SASReferences data set for type=sourcedata. If
        this is not specified, the data set or data sets source is assumed
        to be WORK.
_cstSourceData  - optional - The SAS libref for the SAS ODM
        representation (data). If this parameter is not specified, the code
        looks in the SASReferences data set for type=sourcedata. If this is
        not specified, the data set(s) source is be assumed to be WORK.
_cstIsReferenceData  - optional - The extracted data is ReferenceData.
        If this parameter is not provided, No is assumed.
        Values: Yes | No
        Default: No
_cstSelectAttribute  - optional - The ItemGroup attribute that identifies
        the ItemGroup to extract.
        If this parameter is not specified, Name is assumed.
        Values: OID | Name | SASDatasetName | Domain
        Default: Name
_cstSelectAttributeValue  - required - The value of _cstSelectAttribute
        that identifies the ItemGroup to extract.
        This value is case insensitive.
_cstLang  - optional - The language tag to use for associated
        TranslatedText.
        Default: en
_cstMaxLabelLength  - optional - The maximum number of labels to create.
        If this parameter is not specified, 256 is assumed.
        Default: 256
_cstAttachFormats  - optional - Attach formats to data.
        If this parameter is not specified, Yes is assumed.
        Values: Yes | No
        Default: Yes
_cstODMMinimumKeyset  - optional - Limit the creation of data set keys.
        If this parameter is not specified, No is assumed.
        Values: Yes | No
        Default: No
_cstOutputLibrary  - optional - The SAS libref in which the extracted
        data set or data sets are written. If this parameter is not
        specified, the code looks in the SASReferences data set for
        type=targetdata. If this is not specified, the data set or data
        data set are written to WORK.
_cstOutputDS  - required - The name of the extracted data set. If this
        value is an invalid SAS data set name, an error is generated.
_cstOnlyTemplates  - optional - Only create 0-observation data set
        templates If this parameter is not specified, No is assumed.
        In case of templates, no data set keys will be created.
        Values: Yes | No
        Default: No
File: odm_extractdomaindata.sas
First available in version: 1.5

%odm_getStatic(_cstName=, _cstVar=);

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

Parameters:
_cstName  The name of the value to retrieve.
        Values: ODM_SASREF_TYPE_REFXML | ODM_SASREF_TYPE_EXTXML |
        ODM_SASREF_SUBTYPE_XML | ODM_SASREF_SUBTYPE_STYLESHEET |
        ODM_JAVA_PARAMSCLASS | ODM_JAVA_IMPORTCLASS |
        ODM_JAVA_EXPORTCLASS | ODM_JAVA_PICKLIST
_cstVar  The macro variable to populate with the value.
File: odm_getstatic.sas
First available in version: 1.3

%odm_read(_cstBuildSrcMetadata=Y, _cstBuildFmtCat=Y, _cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English);

[ Exposure: external ]
Reads a CDISC-ODM XML file into the SAS representation of CDISC-ODM.

This macro uses the SAS representation of a CDISC-ODM 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
_cstBuildFmtCat  - optional - Build the format catalog (or catalogs)
        that represents language-specific codelist TranslatedText.
        Values: Y
        Default: Y
_cstFmtLib  - optional - The location where catalog (or catalogs) is
        written. If not specified, the value is first derived from
        SASReferences, and then from WORK.
_cstReplaceFmtCat  - optional - Replace an existing format catalog by
        the same name in _cstFmtLib.
        Values: Y
        Default: Y
_cstFmtCatPrefix  - optional - The prefix for catalog names. If not
        specified, the default is <standard mnemonic>FmtCat (such as
        ODMFmtCat). This default produces an English format catalog
        named ODMFmtCat_en.
_cstFmtCatLang  - optional - Create a format catalog ONLY for the
        specified language. Example: _cstFmtCatLang=en.
        If no records exist for the specified language, an empty catalog
        is created.
_cstFmtCatLangOption  - optional - If no language tag is specified in
        the XML, the action to take with these records.
        Ignore: Records are ignored but reported in the SAS log.
        English: Records are added to the English catalog.
        Use_cstFmtCatLang: Records are added to the language catalog that
        is specified in the _cstFmtCatLang parameter.
        Values: Ignore | English | Use_cstFmtCatLang
        Default: English
File: odm_read.sas
First available in version: 1.3

%odm_validate(_cstCallingPgm=Unspecified);

[ Exposure: external ]
Validates CDISC ODM 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 to be run
_cstColumnMetadata - Data set containing column-level metadata
        supporting 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 containing table-level metadata supporting
        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
Parameters:
_cstCallingPgm  - optional - The name of the driver module calling
        this macro.
File: odm_validate.sas
First available in version: 1.4

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

[ Exposure: external ]
Writes an ODM XML file.

This macro uses the SAS representation of an ODM XML file as source data and
converts it to the required XML structure. The inputs and outputs are
specified via 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 XSL, even if a record is
        specified in SASReferences.
        Values: 0 | 1
        Default: 0
_cstOutputEncoding  - optional - The XML encoding to use for the ODM
        file that is created.
        Default: UTF-8
_cstHeaderComment  - optional - The short comment that is added to the
        top of the ODM XML file that is produced. If no comment is
        specified, a default is used.
_cstResultsOverrideDS  - optional - The (libname.)member that refers to
        a Results data set to create. If omitted, 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: odm_write.sas
First available in version: 1.4