Sample Driver Programs

Overview

The SAS Clinical Standards Toolkit internal validation addresses these primary use cases:
  1. Perform installation qualification and operational qualification.
    This is implemented with and illustrated by the use of the validate_iqoq sample driver, which is located here:
    sample study library directory/cst-framework-1.7/programs
    This is a two-step process:
    1. Select the CST-FRAMEWORK standard, and run the checks that are defined in the validation_control_glmeta view of the internal validation validation_master data set.
      This is a set of 64 checks (checkid < CSTV100) that look only at the global standards library metadata folder.
    2. Select 1 to n specific standards, and run the checks that are defined in the validation_control_stdiqoq view of the internal validation validation_master data set.
      This is a set of 50 checks (checkid > CSTV100 that are relevant to installation qualification and operational qualification issues) that look only at metadata libraries other than the global standards library metadata folder.
  2. Perform validation on standard-specific metadata.
    This is implemented with and illustrated by the use of the validate_standard sample driver. Select 1 to n specific standards, and run the checks that are defined in the validation_control_std view of the internal validation validation_master data set.
    This is a set of 73 checks (checkid > CSTV100) that look only at metadata libraries other than the global standards library metadata folder.
The sample drivers that support internal validation are described in the following sections. The SASReferences data set is validated automatically as part of these sample driver programs during the call to the %CSTUTIL_PROCESSSETUP macro.

Internal Validation Driver Programs That Are Provided with the SAS Clinical Standards Toolkit

A summary of the driver programs that support internal validation, including these two specific use cases, is here:
  • validate_iqoq
    SASReferences: stdvalidation_sasrefs (modified in driver)
    validation_control files used: validation_control_glmeta view, validation_control_stdiqoq view, checktype in (‘GLMETA’ ‘STDIQOQ’)
    Purpose: First, runs checks only on CST-FRAMEWORK global standards library metadata (n=64 checks). Then, runs checks on one or more standards as specified in the driver. Fifty checks are run for each selected standard. These are the checks that support installation qualification and operational qualification for the SAS Clinical Standards Toolkit.
  • validate_standard
    SASReferences: stdvalidation_sasrefs (modified in driver)
    validation_control files used: validation_control_std view, checktype in (‘STD’ ‘STDIQOQ’)
    Purpose: Runs checks on one or more standards as specified in the driver. Seventy-three checks are run for each selected standard.
  • validate_glmetadata
    SASReferences: stdvalidation_sasrefs (modified in driver)
    validation_control files used: validation_control_glmeta view, checktype in (‘GLMETA’)
    Purpose: Runs checks only on CST-FRAMEWORK global standards library metadata (n=64 checks).
  • validate_data
    SASReferences: sasreferences
    validation_control files used: validation_control data set
    Purpose: Runs checks only against CST-FRAMEWORK metadata. The validation_control data set is currently the same as the validation_master data set that is provided with the SAS Clinical Standards Toolkit. Each of these data sets contains 137 checks.
The files are stored in these locations:
  • Drivers: sample study library directory/cst-framework-1.7/programs/<driver>.sas
  • SASReferences: sample study library directory/cst-framework-1.7/control/<SASReferences>.sas7bdat
  • validation_control: sample study library directory/cst-framework-1.7/control/<data set of view>
The validate_data driver is similar in functionality to other standard-specific drivers (such as the CDISC-SDTM validate_data driver). It runs against a validation_control data set with no subsetting by standard or by check. For the simpler workflow, see the validate_data driver program in the SAS Clinical Standards Toolkit: Macro API Documentation.
A complete discussion of the use of the validate_iqoq driver program is provided in SAS Clinical Standards Toolkit: Installation Qualification, which is available here: http://support.sas.com/documentation/onlinedoc/clinical/index.html.

Internal Validation Driver Program Workflow: validate_standard

Driver location: sample study library directory/cst-framework-1.7/programs/validate_standard.sas
This driver program performs all standard-specific validation checks. This excludes checks that target the global standards library directory/metadata folder files. Essentially, this is any check defined in validation_master, where checktype NE ‘GLMETA’.
Here is the validate_standard driver workflow:
  1. Select the standards of interest in work._cstStandardsforIV:
    *******************************************************************;
    * User defines standard(s) of interest in the following data step *;
    *******************************************************************;
    %cst_getRegisteredStandards(_cstOutputDS=work._cstAllStandards);
    
    data work._cstStandardsforIV;
      set work._cstAllStandards (where=(
           (upcase(standard) = 'CDISC-ADAM'        and standardversion='2.1')
        or (upcase(standard) = 'CDISC-CRTDDS'      and standardversion='1.0')
        or (upcase(standard) = 'CDISC-CDASH'       and standardversion='1.1')
    /*
        or (upcase(standard) = 'CDISC-DATASET-XML' and standardversion='1.0.0')
        or (upcase(standard) = 'CDISC-DEFINE-XML'  and standardversion='2.0.0')
        or (upcase(standard) = 'CDISC-CT'          and standardversion='1.0.0')
        or (upcase(standard) = 'CDISC-ODM'         and standardversion='1.3.0')
        or (upcase(standard) = 'CDISC-ODM'         and standardversion='1.3.1')
        or (upcase(standard) = 'CDISC-SDTM'        and standardversion='3.1.2')
        or (upcase(standard) = 'CDISC-SDTM'        and standardversion='3.1.3')
        or (upcase(standard) = 'CDISC-SDTM'        and standardversion='3.2')
        or (upcase(standard) = 'CDISC-SEND'        and standardversion='3.0')
        or (upcase(standard) = 'CDISC-TERMINOLOGY' and standardversion='NCI_THESAURUS')
        or (upcase(standard) = 'CST-FRAMEWORK'     and standardversion='1.2')
    */
      ));
    run;
    
    In this example, validation is performed only for the CDISC ADaM, CDISC CDASH, and CDISC CRT-DDS standards.
  2. Modify the standard validation SASReferences data set to point to the validation_control view of interest.
    In the SAS Clinical Standards Toolkit, views have been provided to make defining the various check subsets more dynamic. Physical SAS data sets can be used, if preferred.
    ******************************************************************************;
    * Modify the sample SASReferences data set to point to the run-time          *;
    * validation_control data set identifying the validation checks of interest. *;
    *                                                                            *;
    * The validation_control_std view of the validation_master data set includes *;
    * just those checks specific to one or more standards and excludes those core*;
    * framework checks that look only within the <cstGlobalLibrary>/metadata     *;
    * folder.                                                                    *;
     *****************************************************************************; 
    libname _cstTemp "&studyrootpath/control";
    
    data work.stdvalidation_sasrefs;
       set _cstTemp.stdvalidation_sasrefs;
         if type='control' and subtype='validation' then
         do;
           filetype='view';
           memname='validation_control_std.sas7bvew';
         end;
     run; 
  3. Call the process setup macro to perform all CST-FRAMEWORK file and library allocations.
    The returned &_cstSASRefs data set contains fully resolved path and memname values.
    %cstutil_processsetup(_cstSASReferencesLocation=&workpath,_cstSASReferencesName=stdvalidation_sasrefs);
  4. (Optional) Re-create work.stdvalidation_sasrefs, and replace _srcfile=‘STDVAL’ with_srcfile=‘FWVAL’
    *****************************************************************************;
    * work.stdvalidation_sasrefs will accumulate SASReferences records from all *;
    *  sources for later use by cstvalidate().                                  *;
    *****************************************************************************;
    
    data work.stdvalidation_sasrefs;
      set &_cstSASRefs
        attrib _srcfile format=$8. label='File source for record';
        **********************************************************************;
        * Framework validation sasreferences:  cstcntl.stdvalidation_sasrefs *;
        **********************************************************************;
        _srcfile='STDVAL';
    run;
    Note: This step is optional because it merely provides an indication of the sources and purposes of specific SASReferences data set records.
  5. Call the code-generator macro to build the job stream for each standard:
    filename incCode CATALOG "work._cstCode.stds.source" LRECL=255;
    %cstutilbuildstdvalidationcode(_cstStdDS=work._cstStandardsforIV,
    _cstSampleRootPath=_DEFAULT_, _cstSampleSASRefDSPath=_DEFAULT_, 
    _cstSampleSASRefDSName=_DEFAULT_);
    This macro call populates the work._cstCode.stds.source catalog entry with standard-specific code, which is subsequently used in an %include statement. For information about macro parameters, see the %CSTUTILBUILDSTDVALIDATIONCODE macro header comments in the SAS Clinical Standards Toolkit: Macro API Documentation.
    The workflow of this catalog entry is summarized in the following steps:
    1. Initialize work._cstTempSASRefDS to accumulate SASReferences records from all of the standards of interest for later use by cstvalidate.
    2. Look for the standard-specific StandardSASReferences data set from the global standards library. If found, run cstutil_processsetup using this data set.
    3. Append the fully resolved work._cstSASRefs to the work._cstTempSASRefDS that was created in validate_standard driver workflow step 1. Set _srcfile=‘STD’.
    4. Look for the standard-specific sdtvalidation_sasrefs data set from the sample library. If found, run cstutil_processsetup using this data set.
    5. Append the fully resolved work._cstSASRefs to the work._cstTempSASRefDS that was created in step a. Set _srcfile=‘STUDY’.
    6. Remove any duplicate records from work._cstTempSASRefDS using these key values: standard, standardversion, type, and subtype.
      This significantly reduces the number of records given the commonalities of SASReferences data sets, but it is assumed that it is irrelevant which record is retained.
    7. Run %cstutilbuildmetadatafromsasrefs(cstSRefsDS=work._cstTempSASRefDS, cstSrcTabDS=work.source_tables, cstSrcColDS=work.source_columns).
      This macro dynamically builds reference_tables and reference_columns data sets from a SASReferences data set. For examples, see Sample of Dynamically Derived work.reference_tables** and Sample of Dynamically Derived work.reference_columns**.
    8. Set _cstSASRefs=work._cstTempSASRefDS, which is the cumulative ready-to-go SASReferences data set.
    9. Call cstvalidate, which uses the validation_control view specific to the driver focus (in this case, validation_control_std) as specified in Internal Validation Driver Programs That Are Provided with the SAS Clinical Standards Toolkit.
    10. Remove standard-specific records from work._cstTempSASRefDS to anticipate appending new records for the next standard to the remaining framework records.
  6. For each standard selected in validate_standard driver workflow step 1, repeat steps a through j in step 5.
    Results are collated in cstrslt.validation_results. For excerpts of the results, see Sample Results Data Set: validate_standard**.
Sample of Dynamically Derived work.reference_tables**
Sample of Dynamically Derived work.reference_tables**
Note: **This is an excerpt only. Not all records and columns are shown.
Sample of Dynamically Derived work.reference_columns**
Sample of Dynamically Derived work.reference_columns**
Note: **This is an excerpt only. Not all records and columns are shown.
Sample Results Data Set: validate_standard**
Sample Results Data Set: validate_standard**
Note: **This is an excerpt only. Not all records and columns are shown.