Module ADaM V2.1 (Runtime)

This is the ADaM 2.1 runtime macro library.

Since: V1.2

Macro Summary
external

%adam_createdisplay(_cstDisplaySrc=Metadata, _cstDisplayCode=, _cstUseAnalysisResults=, _cstUseTLFddt=, _cstDisplayID=, _cstDisplayPath=);
          Creates an analysis result display from ADaM analysis data sets. ...
external

%adam_validate(_cstCallingPgm=Unspecified);
          Validates CDISC ADAM model files. ...
external

%adamutil_buildcheckclasslist(_cstCheckDS=, _cstWhereClause=, _cstOutputDS=);
          Builds a data set that defines the classes to be validated by each check. ...
external

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

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

%adamutil_createsrcmetafromsaslib(_cstBuildAnalysisResults=Y);
          Derives source metadata files from a SAS library for a CDISC ADaM study. ...
internal

%adamutil_gettlfmetadata(_cstOutLib=WORK, _cstMetaDataType=);
          Creates SAS data sets with TLF metadata from an XML source. ...
internal

%adamutil_settlfparmvalues(_cstTLFDS=, _cstTLFDSWhereClause=);
          Translates TLF metadata values into macro variable values. ...

Macro Detail

%adam_createdisplay(_cstDisplaySrc=Metadata, _cstDisplayCode=, _cstUseAnalysisResults=, _cstUseTLFddt=, _cstDisplayID=, _cstDisplayPath=);

[ Exposure: external ]
Creates an analysis result display from ADaM analysis data sets.

The path to the code to create the display is provided either directly in the
macro parameters or is derived from a metadata source. Examples of metadata
sources are analysis results metadata or Tables, Listings, and Figures data
definition metadata (TLFDDT) that you maintain and reference in the
SASReferences data set.

Two primary paths (parameter settings) are supported:
1. A code source is specified. A fully qualified path is required. The
expectation is that this module is %included below to generate an
analysis result (display).
2. Metadata provides the information necessary to generate an analysis
result (display). This metadata is in the form of the CDISC ADaM
analysis results metadata, supplemental Tables, Listings, and Figures
data definition metadata (TLFDDT), or both.

Expected Macro Variables:
_CSTTLF_MASTERCODEPATH - Dynamically derived code segment path from
        TLF metadata.
_cstCTDescription - Description of controlled terminology packet
_cstDebug - Turns debugging on or off for the session
_cstGRoot - Root path of the Toolkit Global Library
_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
_cstStandard - Name of a standard registered to Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cst_rc - Task error status
cstDefaultReportFormat - Specifies the SAS ODS report destination
studyRootPath - Root path to the sample source study
workpath - Path to the SAS session work library
Parameters:
_cstDisplaySrc - - required - Where information comes from to generate
        the result.
        Values: Code | Metadata
        Default: Metadata
_cstDisplayCode - - conditional - Either a valid filename or the fully
        qualified path to code that produces an analysis result. If
        _cstDisplaySrc=Code, this parameter is used and is required. All of
        the remaining parameters are ignored.
_cstUseAnalysisResults - - conditional - The study-specific analysis
        results metadata are used to provide report metadata.
        If _cstDisplaySrc=Metadata, either this parameter or _cstUseTLFddt
        must be set to Y. If both _cstUseAnalysisResults and _cstUseTLFddt
        are set to Y, _cstUseAnalysisResults takes precedence.
        Values: N | Y
        Default: Y
_cstUseTLFddt - - conditional - The study-specific mock table shell
        metadata (known as Tables, Listings, and Figures data definition
        metadata (TLFDDT)) are used to provide report metadata.
        If _cstDisplaySrc=Metadata, either this parameter or
        _cstUseAnalysisResults must be set to Y. If both
        _cstUseAnalysisResults and _cstUseTLFddt are set to Y,
        _cstUseAnalysisResults takes precedence.
        Values: N | Y
        Default: Y
_cstDisplayID - - conditional - The ID of the display from the designated
        metadata source. If _cstDisplaySrc=Metadata, this parameter is
        required.
_cstDisplayPath - - optional - A valid filename or the fully qualified
        path to the generated display. If not provided, the code looks in
        SASReferences for type=report.
File: adam_createdisplay.sas
First available in version: 1.4

%adam_validate(_cstCallingPgm=Unspecified);

[ Exposure: external ]
Validates CDISC ADAM model files.

This macro cycles through the validation checks to be run and writes
validation results to the process Results and 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.

Expected Macro Variables:
_cstCTDescription - Description of controlled terminology packet
_cstCaseMgmt - Validation: Consider case sensitivity when comparing
        values
_cstCheckID - Check ID from the run-time check metadata
_cstCheckSortOrder - Specifies the order in which validation checks are
        to be run
_cstGRoot - Root path of the Toolkit Global Library
_cstMetrics - Toggle to enable or disable 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: estimate the elapsed time to
        perform each action
_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
_cst_rc - Task error status
studyRootPath - Root path to the sample source study
Parameters:
_cstCallingPgm - - optional - The name of the driver module calling
        this macro.
File: adam_validate.sas
First available in version: 1.4

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

[ Exposure: external ]
Builds a data set that defines the classes to be validated by each check.

The validation_classbycheck data set identifies the classes to be validated
by each check based on the contents of the checks data set columns tableScope
and columnScope.

Expected Macro Variables:
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cst_rc - Task error status
Parameters:
_cstCheckDS - - optional - The validation check data set that contains
        the checks for any standard and standardversion. Typically, this is
        the validation_master data set. If it is not specified, the code
        looks in the SASReferences data set for references to the
        validation_master or run-time validation_control data set.
_cstWhereClause - - optional - The WHERE clause to subset _cstCheckDS.
        The syntax must adhere to a SAS statement argument such as any of
        the following:
        VAR1=1
        upcase(var2)="Y" or checkstatus>0
_cstOutputDS - - required - The data set that is returned to the calling
        program. This data set contains a record for each class that is
        referenced by any given checkid, standardversion, and checksource.
File: adamutil_buildcheckclasslist.sas
First available in version: 1.4

%adamutil_createformatsfromcrtdds;

[ Exposure: external ]
Derives codelists from a CRT-DDS data library.

This sample utility macro attempts to derive code lists from a CRT-DDS data
library that is derived from define.xml for a CDISC ADAM 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 prior to calling this
macro or that they can 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 CRT-DDS data sets)
4. The following macro variables have been set previously:
_cstStandard (for example, CDISC-ADAM)
_cstStandardVersion (for example, 2.1)

Expected Macro Variables:
_cstCTCat - Format catalog name
_cstCTLibrary - Target library for formats
_cstGRoot - Root path of the Toolkit Global Library
_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 Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
studyRootPath - Root path of the Study Library
File: adamutil_createformatsfromcrtdds.sas
First available in version: 1.3

%adamutil_createsrcmetafromcrtdds;

[ Exposure: external ]
Derives source metadata files from a CRT-DDS data library.

This sample utility macro attempts to derive source metadata files from a
CRT-DDS data library that is derived from the define.xml file for a CDISC ADAM
study.

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

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:
_cstADAMDataLib - ADAM metadata library
_cstCRTDataLib - CRT-DDS source data library
_cstGRoot - Root path of the Toolkit Global Library
_cstRefColumnDS - ADAM reference column data set
_cstRefTableDS - ADAM reference table data set
_cstReflib - ADAM reference library
_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
_cstStandard - Name of a standard registered to Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstTrgColumnDS - Target source column metadata data set
_cstTrgDocumentDS - Target source documents metadata data set
_cstTrgMetaLibrary - Target library for CRT-DDS source data
_cstTrgStudyDS - Target source study metadata data set
_cstTrgTableDS - Target source table metadata data set
_cstTrgValueDS - Target source value metadata data set
studyRootPath - Root path of the Study Library
File: adamutil_createsrcmetafromcrtdds.sas
First available in version: 1.3

%adamutil_createsrcmetafromsaslib(_cstBuildAnalysisResults=Y);

[ Exposure: external ]
Derives source metadata files from a SAS library for a CDISC ADaM study.

These source metadata files are used by the SAS Clinical Standards Toolkit to
support CDISC ADAM 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 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 completely represents the
study data.

ASSUMPTIONS:
1. The source data is read from a single SAS library. The code can be
modified to reference multiple libraries 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 the columns that SAS uses to define keys in the
reference standard.
3. 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 in code comments.

Expected Macro Variables:
_cstADAMDataLib - Source data library
_cstCRTDataLib - Source data library
_cstCTDescription - Description of controlled terminology packet
_cstDebug - Turns debugging on or off for the session
_cstGRoot - Root path of the Toolkit Global Library
_cstRefColumnDS - Reference column metadata data set
_cstRefLib - Reference metadata library
_cstRefTableDS - Reference table metadata data set
_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
_cstStandard - Name of a standard registered to Toolkit
_cstStandardVersion - Version of the standard referenced in _cstStandard
_cstTLFmapfile - SAS XML map file that reads the TLF XML file
_cstTLFxmlfile - TLF metadata library (XML engine using map file)
_cstTrgAnalysesDS - Derived Analysis Results data set
_cstTrgColumnDS - Derived source_columns data set
_cstTrgMetaLibrary - Derived source metadata library
_cstTrgStudyDS - Derived source_study data set
_cstTrgTableDS - Derived source_tables data set
studyRootPath - Root path to the sample source study
Parameters:
_cstBuildAnalysisResults - - optional - Build the analysis_results
        data set in the target metadata folder.
        Values: N|Y
        Default: Y
File: adamutil_createsrcmetafromsaslib.sas
First available in version: 1.4

%adamutil_gettlfmetadata(_cstOutLib=WORK, _cstMetaDataType=);

[ Exposure: internal ]
Creates SAS data sets with TLF metadata from an XML source.

The sources defined in SASReferences point to the TLF XML file and a SAS XML
map file to render that XML metadata in SAS.

Assumptions:
1. This module references a specific XML representation of the mock table
shell metadata. Alternative representations of the metadata require
modifications to this macro to read that metadata content.
2. The implementation of the sample ADaM reports provided by the SAS
Clinical Standards Toolkit is intended to provide a sample workflow of
report generation within the context of the SAS Clincal Standards Toolkit
framework. You can use alternative means to capture and use metadata
to support the reports to be submitted.

Expected Macro Variables:
_cstDisplayID - ID of the display from the designated metadata source
_cstResultSeq - Results: Unique invocation of check
_cstResultsDS - Results data set
_cstSeqCnt - Results: Sequence number within _cstResultSeq
_cstSrcData - Results: Source entity being evaluated
_cstTLFxmlfile - TLF metadata library (XML engine using map file)
_cst_MsgID - Results: Result or validation check ID
_cst_MsgParm1 - Messages: Parameter 1
_cst_MsgParm2 - Messages: Parameter 2
_cst_rc - Task error status
Parameters:
_cstOutLib - - optional - The library for the SAS representation of TLF
        metadata.
        Default: WORK
_cstMetaDataType - - optional - The type of metadata. Example: tlf_master.
        If this parameter is not specified, all available metadata is
        created in _cstOutLib.
File: adamutil_gettlfmetadata.sas
First available in version: 1.4

%adamutil_settlfparmvalues(_cstTLFDS=, _cstTLFDSWhereClause=);

[ Exposure: internal ]
Translates TLF metadata values into macro variable values.

The macro variables created are in the form of _cst + <dataset> + <column>,
as in _CSTTLF_MASTERCODEPATH (where dataset=TLF_MASTER and column=CODEPATH).

Expected Macro Variables:
_cstDebug - Turns debugging on or off for the session
_cstTLFLibrary - SAS library containing TLF metadata, typically created
        via a call to %adamutil_gettlfmetadata(_cstOutLib=&_cstTLFLibrary)
Parameters:
_cstTLFDS - - required - The type of metadata. Example: tlf_master.
_cstTLFDSWhereClause - - optional - The WHERE clause to subset _cstTLFDS.
        Example: Linenum='1'
File: adamutil_settlfparmvalues.sas
First available in version: 1.4