Module Framework

Overview

This is the framework description. It describes what the framework does, and how it fits together.
Since: 1.2
Module Framework Macro Summary
Exposure
Macro
External
Framework
%cst_createDS(_cstStandard=, _cstStandardVersion=, _cstType=, _cstSubType=, _cstOutputDS=, _cstResultsOverrideDS=);
External
standard_name
%cst_createEmptyTables;
Deprecated
External
Study Creation
%cst_createStudyFromStandard(_cstModel=, _cstVersion=, _cstStudyRootPath=);
External
Framework
%cst_createTablesForDataStandard(_cstStandard=, _cstStandardVersion=, _cstOutputLibrary=, _cstResultsOverrideDS=);
External
Framework
%cst_deleteProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
External
Framework
%cst_getRegisteredStandards(_cstOutputDS=, _cstResultsDS=);
External
standard_name
%cst_getStandardMetadata(_cstSASReferences=, _cstResultsOverrideDS=);
Deprecated
External
Framework
%cst_getStandardSASReferences(_cstStandard=, _cstStandardVersion=, _cstOutputDS=, _cstResultsOverrideDS=);
External
Framework
%cst_getStatic(_cstName=, _cstVar=);
External
%cst_insertStandardSASRefs(_cstSASReferences=, _cstOutputDS=, _cstAddRequiredCSTRefs=0, _cstResultsOverrideDS=);
External
Framework
%cst_registerStandard(_cstRootPath=, _cstControlSubPath=, _cstStdDSName=, _cstStdSASRefsDSName=, _cstOutputDS=);
External
Framework
%cst_setProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
External
Framework
%cst_setStandardProperties(_cstStandard=, _cstStandardVersion=, _cstSubType=, _cstResultsOverrideDS=);
External
Framework
%cst_setStandardVersionDefault(_cstStandard=, _cstStandardVersion=, _cstResultsOverrideDS=);
External
Framework
%cst_unregisterStandard(_cstStandard=, _cstStandardVersion=, _cstResultsOverrideDS=);
External
Framework
%cst_unsetProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
External
Validation Check
%cstcheck_column(_cstControl=);
External
Validation Check
%cstcheck_columncompare(_cstControl=);
External
Validation Check
%cstcheck_comparedomains(_cstControl=);
External
Validation Check
%cstcheck_dsmismatch(_cstControl=);
External
Validation Check
%cstcheck_metamismatch(_cstControl=);
External
Validation Check
%cstcheck_notconsistent(_cstControl=);
External
Validation Check
%cstcheck_notimplemented(_cstControl=);
External
Validation Check
%cstcheck_notincodelist(_cstControl=);
External
Validation Check
%cstcheck_notsorted(_cstControl=);
External
Validation Check
%cstcheck_notunique(_cstControl=);
External
Validation Check
%cstcheck_recmismatch(_cstControl=);
External
Validation Check
%cstcheck_recnotfound(_cstControl=);
External
Validation Check
%cstcheck_violatesstd(_cstControl=);
Internal
Framework Utility
%cstcheck_zeroobs(_cstControl=);
Internal
SAS Clinical Standards Toolkit Validation Check Utility
%cstcheckutil_formatlookup(_cstCol2=, _cstCol2Value=, _cstCol1=&_cstColumn, _cstDomOnly=, _cstDSN=&_cstDSName, _cstRowCt=&_cstDSRowCount, _cstC2Val=&_cstColumn2Value);
Internal
Framework Utility
%cstutil_allocatesasreferences / des='CST: Allocate sasreferences';
External
Framework
%cstutil_allocGlobalMetadataLib(_cstLibname=);
Internal
Framework Utility
%cstutil_appendresultds(_cstErrorDS=, _cstVersion=&_cstStandardVersion, _cstSource=&_cstCheckSource, _cstStdRef=, _cstOrderBy=);
Internal
Framework Utility
%cstutil_buildcollist(_cstFormatType=DATASET, _cstColWhere=, _cstDomWhere=, _cstColDSName=&_cstColumnMetadata, _cstDomDSName=&_cstTableMetadata, _cstColSubOverride=N, _cstDomSubOverride=N);
Internal
Framework Utility
%cstutil_builddomlist(_cstFormatType=DATASET, _cstDomWhere=, _cstDomDSName=&_cstTableMetadata, _cstSubOverride=N);
Internal
Framework Check
%cstutil_checkds(_cstdsname=, _csttype=, _cstsubtype=, _cststandard=*, _cststandardversion=*);
Internal
Framework Check
Internal macro for the cstutil_checkds macro
%chkvals;
Internal
Framework Utility
%cstutil_cleanupcstsession(_cstClearCompiledMacros=0, _cstClearLibRefs=0, _cstResetSASAutos=0, _cstResetFmtSearch=0, _cstResetSASOptions=1, _cstDeleteFiles=1, _cstDeleteGlobalMacroVars=0);
External
Framework Utility
%cstutil_CreateMetadataReport(_cstStandardTitle=, _cstValidationDS=, _cstValidationDSWhClause=, _cstMessagesDS=, _cstStdRefDS=, _cstReportOutput=, _cstCheckMDReport=N, _cstMessageReport=N, _cstStdRefReport=N, _cstRecordView=N);
External
Framework Utility
%cstutil_createreport(_cstsasreferencesdset=, _cstresultsdset=&_cstRptResultsDS, _cstmetricsdset=&_cstRptMetricsDS, _cstreporterrorsonly=N, _cstreportobs=, _cstreportbytable=N, _csttablechecksdset=, _csttablecheckscode=, _cstkeeptablechecklist=N, _csttablesubset=, _cstreportoutput=, _cstsummaryReport=Y, _cstioReport=Y, _cstmetricsReport=Y, _cstgeneralResultsReport=Y, _cstcheckIdResultsReport=Y);
Internal
Framework
%cstutil_createTempMessages(_cstCreationFlag=);
Internal
standard_name
%cstutil_deleteDataSet(_cstDataSetName=);
Internal
Framework
%cstutil_getRandomNumber(_cstVarname=);
Internal
Framework Utility
%cstutil_getsasreference(_cstStandard=, _cstStandardVersion=, _cstSASRefType=, _cstSASRefSubtype=, _cstSASRefsasref=, _cstSASRefmember=, _cstConcatenate=0, _cstFullname=0, _cstAllowZeroObs=0);
Internal
Framework Utility
%cstutil_getsubjectcount(_cstDS=, _cstsubid=&_cstSubjectColumns);
External
Framework
%cstutil_internalmanageresults(_cstAction=);
Internal
Framework Utility
%cstutil_messagesdsattr /des='CST: Messages data set column attributes';
Internal
Framework Utility
%cstutil_metricsdsattr /des='CST: Metrics data set column attributes';
Internal
Framework Utility
%cstutil_parsecolumnscope(_cstscopestr=, _cstopsource=, _cstsublistnum=);
Internal
Framework Utility
%cstutil_parsescopesegment(_cstPart=, _cstVarName=, _cstMessageID=CST0004);
Internal
Framework Utility
%cstutil_parsetablescope(_cstscopestr=, _cstopsource=, _cstsublistnum=);
Internal
SAS Clinical Standards Toolkit Framework
%cstutil_processsetup(_cstSASReferencesSource=SASREFERENCES, _cstSASReferencesName=sasreferences, _cstSASReferencesLocation=);
Internal
Framework Utility
%cstutil_readcontrol /des="CST: Create control file macro variables";
External
Framework Utility
%cstutil_reportgeneralprocess;
External
Framework Utility
%cstutil_reportinputsoutputs;
External
Framework Utility
%cstutil_reportprocessmetrics;
External
Framework Utility
%cstutil_reportprocessresults;
External
Framework Utility
%cstutil_reportprocesssummary;
External
Framework Utility
%cstutil_reportsetup(_cstRptType=Metadata);
External
Framework Utility
%cstutil_reporttabledata;
Internal
Framework Utility
%cstutil_resultsdsattr /des='CST: Results data set column attributes';
Internal
Framework Utility
%cstutil_resultsdskeep /des='CST: Results data set columns';
Internal
Framework Utility
%cstutil_saveresults(_cstIncludeValidationMetrics=0);
Automatically generated by the CST-Framework post-installation configuration component
%cstutil_setcstgroot;
Internal
Framework Utility
%cstutil_setmodel /des="Set Which Model Definition to Use";
Internal
CDISC CRT-DDS
%cstutil_writecubexml(_cstXMLOut=, _cstMDPFile=, _cstDebug=);
Internal
Framework Utility
%cstutil_writemetric(_cstMetricParameter=, _cstResultID=, _cstResultSeqParm=, _cstMetricCnt=, _cstSrcDataParm=, _cstMetricsDSParm=&_cstMetricsDS);
Internal
Framework Utility
%cstutil_writeresult(_cstResultID=, _cstValCheckID=, _cstResultParm1=, _cstResultParm2=, _cstResultSeqParm=1, _cstSeqNoParm=1, _cstSrcDataParm=, _cstResultFlagParm=0, _cstRCParm=0, _cstActualParm=, _cstKeyValuesParm=, _cstResultDetails=, _cstResultsDSParm=&_cstResultsDS);

Macro Detail

%cst_createDS

%cst_createDS(_cstStandard=, _cstStandardVersion=, _cstType=, _cstSubType=, _cstOutputDS=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
Creates a zero observation data set based on those provided by a registered standard.
Parameters:
  • _cstStandard—Required. The name of a registered standard.
  • _cstStandardVersion—Optional. The version of the standard that the data set should be created from. If this is omitted, then the default version for the standard is used. If a default version is not defined, then an error is generated.
  • _cstType—Required. The type of data set to be created. This value comes from the TYPE column in the SASReferences file for the standard-version combination.
  • _cstSubType—Optional. Specifies the subtype for the type. This value comes from the SUBTYPE column in the SASReferences file for the standard-version combination. If the type has no subtypes, then the value can be omitted. Otherwise, it must be provided.
  • _cstOutputDS—Required. The name of the data set to be created.
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_createds.sas

%cst_createEmptyTables

%cst_createEmptyTables;
[ Exposure: external ] [ Macro Type: standard_name ]
Create empty table shells using reference metadata.
Full, multi-line explanation
Required Global Macro Variables:
  • _cstVar1
  • _cstVar2
Deprecated. Explanation
File: cst_createemptytables.sas

%cst_createStudyFromStandard

%cst_createStudyFromStandard(_cstModel=, _cstVersion=, _cstStudyRootPath=);
[ Exposure: external ] [ Macro Type: study creation ]
cst_createStudyFromStandard
Creates a study from selected model and version.
Required Global Macro Variables: (none)
Required File Inputs: (none)
Parameters:
  • _cstModel—The name of the data model to use for this study.
  • _cstVersion—The version of the data model to use for this study.
  • _cstStudyRootPath
File: cst_createStudyFromStandard.sas

%cst_createTablesForDataStandard

%cst_createTablesForDataStandard(_cstStandard=, _cstStandardVersion=, _cstOutputLibrary=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
Creates tables from registered reference metadata. This macro generates all of the table shells that are defined for the standard in a library specified by the caller where a standard is registered .
Required Global Macro Variables: CST-Framework standard variables
Parameters:
  • _cstStandard—Required. The name of a registered standard.
  • _cstStandardVersion—Optional. The version of the standard from which the data set should be created. If this is omitted, then the default version for the standard is used. If a default version is not defined, then an error is generated.
  • _cstOutputLibrary—Required. Specifies the LIBNAME in which the table shells should be created.
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_createtablesfordatastandard.sas

%cst_deleteProperties

%cst_deleteProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
Reads a properties file or data set and unsets global macros, accordingly. Property files should have the format name=value. Property data sets should have a character field for name and value. They might have a comment field, but this field is ignored.
Parameters:
  • _cstPropertiesLocation—Required. The location of the property file. The format depends on the value of _cstLocationType.
  • _cstLocationType—Required. Identifies the format for the value of _cstPropertiesLocation. Valid values are: PATH (the path to a properties file), FILENAME (a valid, assigned SAS filename to the properties file), and DATA (a (LIBNAME.)membername of a SAS data set that contains the properties).
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_deleteproperties.sas

%cst_getRegisteredStandards

%cst_getRegisteredStandards(_cstOutputDS=, _cstResultsDS=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstOutputDS
  • _cstResultsDS
File: cst_getregisteredstandards.sas

%cst_getStandardMetadata

%cst_getStandardMetadata(_cstSASReferences=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: standard_name ]
Retrieves the standard metadata for standards.
A valid SASReferences data set is passed into the macro. It should contain records that point to the metadata for the data standard. A row should exist for each metadata table that is to be returned. The row should identify the standard, standardversion, type, and subtype that can be mapped to the standard's registered information. In addition, the SASRef and memName columns should identify where the new data set is to be created. The RefType must be set to libref.
For example, to retrieve SDTM 3.1.1 reference metadata about tables, the data set should have the columns standard=CDISC-SDTM and standardVersion=3.1.1. Type should be set to “referencemetadata” and subtype to “table.” SASRef could be set to “Work” and memname to “refTableMD.”
Deprecated. explanation
Parameters:
  • _cstSASReferences—Required. The (LIBNAME.)member that refers to a valid SASReferences file.
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_getstandardmetadata.sas

%cst_getStandardSASReferences

%cst_getStandardSASReferences(_cstStandard=, _cstStandardVersion=, _cstOutputDS=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: Framework ]
Retrieves the global SASReference records for the standard.
If the macro succeeds, then the global variable _cst_rc is set to 0. If it fails, then _cst_rc is set to 1. The Results data set contains more information as to why it failed.
Parameters:
  • _cstStandard—Required. The name of a registered standard.
  • _cstStandardVersion—Optional. The version of the standard for which the caller wants to retrieve the global SASReferences. This might be omitted if the caller is requesting the default version for the standard.
  • _cstOutputDS—Required. The (LIBNAME.)member name of the output data set to be created.
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_getstandardsasreferences.sas

%cst_getStatic

%cst_getStatic(_cstName=, _cstVar=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstName
  • _cstVar
File: cst_getstatic.sas

%cst_insertStandardSASRefs

%cst_insertStandardSASRefs(_cstSASReferences=, _cstOutputDS=, _cstAddRequiredCSTRefs=0, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: Not specified ]
Inserts missing standards information into a SASReferences file.
It is possible to specify only the standard, standardversion, type, and subtype for information that has been registered by the standard where a SASReferences uses a standard. Calling this macro fills in the missing information. If a standardversion is not specified, then the information for the default version of that standard is used.
Parameters:
  • _cstSASReferences—Optional. The(LIBNAME.)member that points to a SASReferences file to be completed. If this is not specified, then the global macro variables _cstSASRefsLoc and _cstSASRefsName might be used to specify the SASReferences file information. The _cstSASRefs macro variable is used if none of the other mechanisms are provided or available.
  • _cstOutputDS—Required. The output data set to create that contains the completed information.
  • _cstAddRequiredCSTRefs
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_insertstandardsasrefs.sas
See Overview.

%cst_registerStandard

%cst_registerStandard(_cstRootPath=, _cstControlSubPath=, _cstStdDSName=, _cstStdSASRefsDSName=, _cstOutputDS=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstRootPath
  • _cstControlSubPath
  • _cstStdDSName
  • _cstStdSASRefsDSName
  • _cstOutputDS
File: cst_registerstandard.sas

%cst_setProperties

%cst_setProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
Reads a properties file or data set and sets global macros, accordingly. Property files should have the format name=value. Property data sets should have a character field for name and value. They might have a comment field, but this field is ignored.
Parameters:
  • _cstPropertiesLocation—Required. The location of the property file. The format depends on the value of _cstLocationType.
  • _cstLocationType—Required. Identifies the format for the value of _cstPropertiesLocation. Valid values are PATH (the path to a properties file), FILENAME (a valid, assigned SAS filename to the properties file), and DATA (a (LIBNAME.)membername of a SAS data set that contains the properties).
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_setproperties.sas

%cst_setStandardProperties

%cst_setStandardProperties(_cstStandard=, _cstStandardVersion=, _cstSubType=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
When a standard is registered, it most likely also registers values in a SASReferences file. A number of these values might be for properties files that are used by the standard, or provided by the standard to help users. For example, CST_FRAMEWORK provides a property subType of 'required' that points to a property file that has default settings for required properties. A user can call this method using the following code to set these properties:
%cst_setStandardProperties(
_cstStandard=CST_FRAMEWORK,
_cstStandardVersion=1.2,
_cstSubType=required);
Parameters:
  • _cstStandard—Required. The name of a registered standard.
  • _cstStandardVersion—Optional if the standard has a default set. Otherwise, it is mandatory. This specifies the version of the standard.
  • _cstSubType—Required. The name of the properties subtype that is to be read and from where properties are set.
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_setstandardproperties.sas

%cst_setStandardVersionDefault

%cst_setStandardVersionDefault(_cstStandard=, _cstStandardVersion=, _cstResultsOverrideDS=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstStandard
  • _cstStandardVersion
  • _cstResultsOverrideDS
File: cst_setstandardversiondefault.sas

%cst_unregisterStandard

%cst_unregisterStandard(_cstStandard=, _cstStandardVersion=, _cstResultsOverrideDS=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstStandard
  • _cstStandardVersion
  • _cstResultsOverrideDS
File: cst_unregisterstandard.sas

%cst_unsetProperties

%cst_unsetProperties(_cstPropertiesLocation=, _cstLocationType=, _cstResultsOverrideDS=);
[ Exposure: external ] [ Macro Type: framework ]
Reads a properties file or data set and unsets global macros, accordingly. Property files should have the format name=value. Property data sets should have a character field for name and value. They might have a comment field, but this field is ignored.
Parameters:
  • _cstPropertiesLocation—Required. The location of the property file. The format depends on the value of _cstLocationType.
  • _cstLocationType—Required. Identifies the format for the value of _cstPropertiesLocation. Valid values are: PATH (the path to a properties file), FILENAME (a valid, assigned SAS filename to the properties file), and DATA (a (LIBNAME.)membername of a SAS data set that contains the properties).
  • _cstResultsOverrideDS—Optional. The (LIBNAME.)member that refers to a Results data set to be created. If omitted, then the Results data set specified by the &_cstResultsDS is used.
File: cst_unsetproperties.sas

%cstcheck_column

%cstcheck_column(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_column
Identifies any invalid column value or attribute.
Note: Macro requires use of _cstCodeLogic at a statement level in a SAS DATA step context. _cstCodeLogic identifies records in errors by setting _cstError=1.
Example validation checks that use this macro include:
  • Value of Visit Number is formatted to > 3 decimal places
  • A column character value is not left-justified
  • Study day of Visit/Collection/Exam (**DY) equals 0
  • Length of **TEST > 40
Required Global Macro Variables (beyond reporting and debugging variables): _cstSubjectColumns
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_column.sas

%cstcheck_columncompare

%cstcheck_columncompare(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_columncompare
Supports comparison of column values (much like cstcheck_multicolumn), providing additional functionality in the form of step-level code (for example, optional reference to column metadata).
Note: Macro requires use of _cstCodeLogic at a SAS DATA step level (that is, a full DATA step or PROC SQL invocation). _cstCodeLogic creates a Work file (_cstproblems) that contains records in error.
Example validation checks that use this macro: **DOSE and **DOSU inconsistencies for expected columns
Required Global Macro Variables:
  • _cstSubjectColumns
  • _cstMetrics*
  • <messaging, error>
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_columncompare.sas

%cstcheck_comparedomains

%cstcheck_comparedomains(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_comparedomains
Generally compares values for 1+ columns in one domain with values for those same columns in another domain. For example, USUBJID value in any domain does not have a matching USUBJID value in the DM domain.
Note: Macro requires use of _cstCodeLogic at a statement level in a SAS DATA step context. _cstCodeLogic identifies records in error by setting _cstError=1.
Example validation checks that use this macro: Unique USUBJID+VISIT+VISITNUM combinations in each domain not found in SV.
Required Global Macro Variables: (none)
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_comparedomains.sas

%cstcheck_dsmismatch

%cstcheck_dsmismatch(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_dsmismatch
Identifies any data set mismatches between study and template metadata and the source data library.
Note: This macro module currently ignores tablescope and columnscope in the _cstControl input data set.
Required Global Macro Variables: (none)
Required File Inputs: Single-record control data set identified by the control input parameter.
Parameters:
  • _cstControl—The single observation data set containing check-specific metadata.
File: cstcheck_dsmismatch.sas

%cstcheck_metamismatch

%cstcheck_metamismatch(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_metamismatch
Identifies inconsistencies between study and reference column metadata.
Note: Macro requires use of _cstCodeLogic as a full SAS DATA step or PROC SQL invocation. This DATA step or PROC SQL step assumes as input a Work copy of the column metadata data set returned by the cstutil_buildcollist macro. Any resulting records in the derived data set represent errors to be reported.
ASSUMPTIONS:
  • No data content is accessed for this check.
  • Both study and reference metadata must be present to assess compliance.
  • Current coding approach assumes no reporting on non-errors.
Example validation checks that use this macro include:
  • Required column not found (Error).
  • Expected column not found (Warning).
  • Permissible column not found (Note).
  • Column found in data set but not in specification.
  • Supplemental qualifier data set without USUBJID column.
  • Column metadata attribute differences (for example, type, length, label, order, CT, and so on).
Required Global Macro Variables: (none)
Required File Inputs: Single-record control data set identified by a control input parameter.
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_metamismatch.sas

%cstcheck_notconsistent

%cstcheck_notconsistent(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_notconsistent
Identifies any inconsistent column values across records.
Note: This macro requires use of _cstCodeLogic at a SAS DATA step level (that is, a full DATA step or PROC SQL invocation). _cstCodeLogic creates a Work file (_cstproblems) that contains records in error.
Example validation checks that use this macro include:
  • **SEQ not consecutively incremented beginning at 1.
  • Standard units inconsistent within **TESTCD across records.
Required Global Macro Variables:
  • _cstSubjectColumns
  • _cstMetrics*
  • <messaging, error>
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_notconsistent.sas

%cstcheck_notimplemented

%cstcheck_notimplemented(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check]
Placeholder to report that a check has not yet been implemented.
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_notimplemented.sas

%cstcheck_notincodelist

%cstcheck_notincodelist(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_notincodelist
Identifies any column values inconsistent with controlled terminologies. For example, a **STAT value is found other than 'NOT DONE'.
Note: This macro requires reference to the SAS format search path built based on type=FMTSEARCH records in the SASReferences control file.
Processing is based on the value of the check metadata LOOKUPTYPE field. When LOOKUPTYPE=FORMAT, the code compares column values against a SAS format in the format search path. Code logic is optional (that is, if the user does not specify any code logic, then cstcheck_notincodelist uses default logic, which is PROC SQL code that creates work._cstproblems if one or more errors are detected). The SAS format is specified in the check metadata LOOKUPSOURCE field.
When LOOKUPTYPE=DATASET, the code requires the use of code logic to create the data set work._cstproblems. LOOKUPSOURCE must contain the reference data set (for example, MedDRA for AE preferred term lookups) used in code logic. Given that any reference dictionary with any structure might be used, it is the responsibility of the user to code correct joins and lookup logic in code logic.
When LOOKUPTYPE=CODELIST, functionality is deferred for SAS Clinical Standards Toolkit 1.3.
When LOOKUPTYPE=METADATA, the code compares column values against a SAS format in the format search path. Code logic is optional (that is, if the user does not specify any code logic, then cstcheck_notincodelist uses default logic, which is PROC SQL code that creates work._cstproblems if one or more errors are detected). The SAS format is specified in the source column metadata XMLCODELIST field.
Required Global Macro Variables: (none)
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_notincodelist.sas

%cstcheck_notsorted

%cstcheck_notsorted(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation check ]
cstcheck_notsorted
Identifies any domain that is not sorted by the keys defined in the metadata.
Example validation check that uses this macro: Identifies domain table that is not correctly sorted.
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_notsorted.sas

%cstcheck_notunique

%cstcheck_notunique(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_notunique
This is a multi-function macro that assesses the uniqueness of data sets, columns, or value-pairs from two columns. Each of these three functions accesses different code sections within the macro.
Function 1: Is data set unique by a set of columns?
Data sets—It is assumed that if control column columnscope is blank, then code cycles through domains that are specified in control column tablescope. Code identifies any records that are not unique by the domain keys defined in the table-level metadata.
Multiple columns—This option allows the specification of a single set of columns (in the form var1+var2+...varn). Code identifies any records that are not unique by the specified set of columns within each domain specified in tablescope. For the purposes of reporting, the specified columns are treated as the domain keys. No code logic is used or currently checked.
Function 2: For any subject, are column values unique?
Single columns—For single columns (for example, **SEQ), code checks for uniqueness in USUBJID (except TSSEQ, in TSPARMCD). No code logic is used or currently checked.
Function 3: Does a combination of two columns have unique values?
Column pairs—For multiple columns (for example, **TEST and **TESTCD), code checks that there are a unique set of values for the pair of columns. These must be specified in the form of matching columnscope sublists. Exactly and only two sublists can be specified. No code logic is used or currently checked.
Function 4: Are the values in one column (Column2) consistent with the values in another column (Column1)?
Column pairs—For multiple columns (for example, **TESTCD and **STRESU), code checks that there is a unique value in Column2 for each value of Column1. These must be specified in the form of matching columnscope sublists. Exactly and only two sublists can be specified, with the first sublist containing Column1 (for example, VSTESTCD), and the second sublist containing Column2 (for example, VSSTRESU). Code logic is required. It is the presence of code logic that distinguishes Function 3 and Function 4 processing.
The columnscope sublists should be bounded by brackets in the following style:
[LBTEST+VSTEST][LBTESTCD+VSTESTCD]
The following limitations apply:
  • The two lists must resolve to the same number of columns.
  • The columns to be compared must be in the same data set.
  • The first item in sublist 1 is paired with the first item in sublist 2, and so on.
The following are the example combinations of tablescope and columnscope:
tableScope columnScope        How code interprets *;
---------- -----------        --------------------------------------------- 
ALL                           For all domains, is each unique by its keys? 
FINDINGS   [**TEST][**TESTCD] For all FINDINGS domains, **TEST and **TESTCD 
                              must map 1:1 
ALL        **SEQ              For all domains, check **SEQ for uniqueness 
                              within USUBJID 
DM                            Is DM unique by its keys (STUDYID+USUBJID)? 
DV         [DVTERM][DVDECOD]  For DV, DVTERM and DVDECOD must map 1:1 
SUPP**                        For all SUPP** domains, are records unique by 
                              their keys? 
DV         USUBJID+DVTERM     For DV, are records unique by USUBJID and 
                              DVTERM?
Required Global Macro Variables:
  • _cstSubjectColumns
  • _cstMetrics*
  • <messaging, error>
Required File Inputs: Single-record control data set identified by _cstControl input parameter.
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_notunique.sas

%cstcheck_recmismatch

%cstcheck_recmismatch(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_recmismatch
Identifies any record mismatches across domains.
Note: Macro requires use of _cstCodeLogic at a SAS DATA step level (that is, a full DATA step or PROC SQL invocation). _cstCodeLogic creates a Work file (_cstproblems) containing records in error.
Example CDISC SDTM validation checks that use this macro: Comments, Relrec, or Supplemental Qualifier RDOMAIN references to other domains or domain records that do not exist.
Required Global Macro Variables:
  • _cstMetrics*
  • <messaging, error>
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_recmismatch.sas

%cstcheck_recnotfound

%cstcheck_recnotfound(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_recnotfound
Generally compares the consistency of one or more columns across two tables. Or, it allows the comparison of the consistency of one <table>.<column> with another <table>.<column>. (For example, in CDISC SDTM, STUDYID in the TA domain does not match STUDYID in the DM domain).
Note: This macro requires the use of _cstCodeLogic at a statement level in a SAS DATA step context. _cstCodeLogic identifies records in error by setting _cstError=1.
Note: This macro requires that tablescope syntax specifies two sublists in the form [DM][TA], comparing one or more columnscope fields across the tables in these sublists.
CDISC SDTM example validation check that uses this macro: DM subjects where no record for the subject is found in the DS table.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_recnotfound.sas

%cstcheck_violatesstd

%cstcheck_violatesstd(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_violatesstd
Identifies any invalid column value or values that are defined in a reference standard.
Note: This macro requires use of _cstCodeLogic at a statement level in a SAS DATA step context. _cstCodeLogic identifies records in errors by setting _cstError=1.
Example validation checks that use this macro include:
  • Identifies a null value found in a column where core attribute is REQ.
  • Identifies a null value found in a column where core attribute is EXP.
  • A column character value is not correctly in uppercase.
  • A numeric column that contains nonnumeric entries.
Required Global Macro Variables:
  • _cstSubjectColumns—Currently used only with the SDTM model. CRT-DDS does not require this global macro. CRT-DDS does not use _cstMetricsNumSubj when running metrics (not subject based).
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_violatesstd.sas

%cstcheck_zeroobs

%cstcheck_zeroobs(_cstControl=);
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_zeroobs
Identifies any data set with zero observations.
Required Global Macro Variables: (none)
Required File Inputs: Single-record control data set identified by control input parameter.
Parameters:
  • _cstControl—The single observation data set that contains check-specific metadata.
File: cstcheck_zeroobs.sas

%cstcheckutil_formatlookup

%cstcheckutil_formatlookup(_cstCol2=, _cstCol2Value=, _cstCol1=&_cstColumn, _cstDomOnly=, _cstDSN=&_cstDSName, _cstRowCt=&_cstDSRowCount, _cstC2Val=&_cstColumn2Value);
[ Exposure: external ] [ Macro Type: SAS Clinical Standards Toolkit Validation Check Utility ]
cstcheckutil_formatlookup
Creates work._cstproblems that contains any records that are included in the _cstSourceDS data set where the value of a column is not found in the format value column. For example, in the TS domain, TSPARMCD has a value of SEX. The $SEXPOP format is associated with this variable and has the following values: BOTH, F, and M. TSVAL has to contain one of these values to be correct. An error condition exists otherwise.
Note: This macro is called within _cstCodeLogic at a SAS DATA step level (that is, a full DATA step or PROC SQL invocation).
Required Global Macro Variables: (none)
Required File Inputs: Single-record control data set identified by control input parameter.
Parameters:
  • _cstCol2—The variable that contains the value to check (TSPARMCD).
  • _cstCol2Value—The actual value to check from _cstCol2.
  • _cstCol1
  • _cstDomOnly—The domain or table that contains _cstCol2.
  • _cstDSN
  • _cstRowCt
  • _cstC2Val
File: cstcheckutil_formatlookup.sas

%cstutil_allocatesasreferences

%cstutil_allocatesasreferences / des='CST: Allocate sasreferences';
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_allocatesasreferences
Method to allocate any librefs and filerefs in the SASReferences data set, and set the autocall and format search paths based on the SASReferences settings.
Must be called outside the context of a DATA step, typically as an initial step in any SAS Clinical Standards Toolkit driver program (for example, cst_validate).
Note: A call to a framework macro to validate the structure and content of the SASReferences data set is a required initial step.
Required Global Macro Variables:
  • _cstResultsDS
  • _cstSASRefsLoc (provides location of the SASReferences input file)
  • _cstSASRefsName (provides name of the SASReferences input file)
  • _cstSASRefs (Work library version of SASReferences)
  • _cstFMTLibraries (include Work and Library in fmtsearch?)
  • _cstMessageOrder (append or merge, where merge honors order precedence)
Required File Inputs: sasreferences.sas7bdat
File: cstutil_allocatesasreferences.sas

%cstutil_allocGlobalMetadataLib

%cstutil_allocGlobalMetadataLib(_cstLibname=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstLibname
File: cstutil_allocglobalmetadatalib.sas

%cstutil_appendresultds

%cstutil_appendresultds(_cstErrorDS=, _cstVersion=&_cstStandardVersion, _cstSource=&_cstCheckSource, _cstStdRef=, _cstOrderBy=);
[ Exposure: internal ] [ Macro Type: Framework utility ]
Appends a check-level work Results data set to the process work Results data set. Parameters passed are check-level, not record-level values.
Must be called outside the context of a DATA step.
Required File Inputs: (none)
Required Global Macro Variables: (none)
Parameters:
  • _cstErrorDS—A SAS Work data set that contains one or more observations documenting the results of check-level validation processing on a source data set record level.
  • _cstVersion—The specific version of the model. This defaults to the global _cstStandardVersion macro variable value. Used to look up an associated message from the Messages data set.
  • _cstSource—The source of the check, allowing source-specific messaging. Used to look up an associated message from the Messages data set.
  • _cstStdRef—Optional. Reference in standard supporting checks.
  • _cstOrderBy—Optional. The order of the records is important, so specify the column order (SQL form, comma-separated columns) that the _cstErrorDS should have when exiting this macro.
File: cstutil_appendresultds.sas

%cstutil_buildcollist

%cstutil_buildcollist(_cstFormatType=DATASET, _cstColWhere=, _cstDomWhere=, _cstColDSName=&_cstColumnMetadata, _cstDomDSName=&_cstTableMetadata, _cstColSubOverride=N, _cstDomSubOverride=N);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_buildcollist
Builds a set of columns (in either list or data set format) based on the value from the validation check control file Validation_Control.columnscope.
The expected result is that the work._csttablemetadata and work._cstcolumnmetadata data sets are created and are in synchronization. This means that they are consistent with regard to the tables based on resolving the tablescope and columnscope check macro fields.
Rules used to interpret columnscope values (using mostly CDISC SDTM examples):
  • Validation_Control.columnscope might be null.
  • Blanks are translated to + (for example, LBDTC LBENDTC becomes LBDTC+LBENDTC).
  • Value should not begin with a + or -.
  • If the blank translation results in multiple + characters, then all but one of these characters are removed (for example, AE1 +DM1 becomes AE1++DM1, which becomes AE1+DM1).
  • No attempt is made to assess the validity of the columnscope value (for example, **TEST-AE1 is allowed, although no change to the resolved set of **TEST columns occurs).
  • The derived set of columns is built by parsing columnscope from left to columns).
  • If <libref> is included, then it must be listed in the SASReferences.SASRef column.
Wildcard Conventions:
  • must use the string **
  • might appear as a suffix (for example, SUPP** for all columns that start with SUPP)
  • might appear as a prefix (for example, **DTC for all columns that end with DTC)
  • might appear alone (for example, **), equivalent to _ALL_
  • <table>.** for all columns in the specified data set
  • **.USUBJID for all USUBJID columns across referenced data sets
  • sublists are delimited by brackets, and resolved lengths (that is, # columns) must be the same unless _cst*SubOverride is set to Y, and they must conform to non-sublist rules stated above
  • A special naming convention of <column>:<value>, such as QUALIFIERS:DATETIME allows specification of a _cstColumnMetadata column and column value to subset columns. In this example, all _cstColumnMetadata.QUALIFIERS= 'DATETIME' columns are returned.
Sample columnscope values:
  • _ALL_ (all columns)
  • AESEQ (a single column)
  • LBDTC+LBENDTC (multiple columns)
  • QUALIFIERS:DATETIME (_cstColumnMetadata.QUALIFIERS='DATETIME')
  • **TEST (all columns ending in TEST)
  • DM** (all columns beginning with DM)
  • **TEST+**TESTCD (all columns ending in TEST or TESTCD)
  • [AESTDY+CMSTDY+EXSTDY][AEENDY+CMENDY+EXENDY] (two paired sublists)
  • SRCDATA1.AE.AESTDY+SRCDATA2.AE.AESTDY (AESTDY column from AE data sets in two different libraries)
  • AE.** (all columns in the AE table)
  • **.USUBJID (all USUBJID columns from all tables)
Required Global Macro Variables (beyond reporting and debugging variables):
  • _cstTableMetadata
  • _cstColumnMetadata
Required File Inputs: work._cstcolumnmetadata
Parameters:
  • _cstFormatType—If the value is LIST, it sets macro variables of # tables and space-delimited list of tables. The value DATASET is the default. Returns a data set of tables matching tablescope specification.
  • _cstColWhere—WHERE clause to subset returned set of columns. Any WHERE clause is applied as the last step.
  • _cstDomWhere—WHERE clause to subset returned set of tables. Any WHERE clause is applied as the last step.
  • _cstColDSName—Name of data set with column metadata returned when _cstFormatType=DATASET.
  • _cstDomDSName—Name of data set with table metadata returned when _cstFormatType=DATASET.
  • _cstColSubOverride—Y or N (default). If Y, then overrides sublist processing to allow sublists of different lengths (such as columnScope=[**DTC][RFSTDTC] ).
  • _cstDomSubOverride—Y or N (default). If Y, then overrides sublist processing to allow sublists of different lengths (such as tableScope=[_ALL_-DM][DM] ).
File: cstutil_buildcollist.sas

%cstutil_builddomlist

%cstutil_builddomlist(_cstFormatType=DATASET, _cstDomWhere=, _cstDomDSName=&_cstTableMetadata, _cstSubOverride=N);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_builddomlist
Builds set of tables (in either list or data set format) based on the value from the validation check control file Validation_Control.tablescope.
Rules used to interpret tablescope values (using mostly CDISC SDTM examples) include:
  • Validation_Control.tablescope might not be null.
  • Blanks are translated to + (for example, AE DM becomes AE+DM).
  • Value should not begin with a + or -.
  • If the blank translation results in multiple + characters, then all but one of the + characters are removed (for example, AE +DM becomes AE++DM, which becomes AE+DM).
  • No attempt is made to assess the validity of the tablescope value (for example, CLASS:FINDINGS-AE is allowed, although no change to the resolved set of CLASS:FINDINGS tables occurs).
  • The derived set of tables is built by parsing tablescope from left to right (for example, _ALL_-CLASS:RELATES builds a set of all tables removing RELREC and SUPP**).
  • If <libref> is included, then it must be listed in the SASReferences.SASRef column.
Wildcard Conventions:
  • must use the string **
  • might appear as a suffix (for example, SUPP** for all tables that start with SUPP)
  • might appear as a prefix (for example, **DM for all tables that end with DM)
  • might appear alone (for example, **), equivalent to _ALL_
  • <libref>.** for all tables in the specified library
  • **.AE for all AE tables across referenced libraries
  • sublists are delimited by brackets, and resolved lengths (that is, # columns) must be the same unless _cst*SubOverride is set to Y, and they must conform to non-sublist rules stated above
  • A special naming convention of <column>:<value>, such as: CLASS:EVENTS allows specification of a _cstTableMetadata column and column value to subset tables. In this example, all CLASS='EVENTS' tables are returned.
Sample tablescope values:
  • _ALL_ (all tables)
  • AE (a single table)
  • DM+DS (multiple tables)
  • CLASS:EVENTS (_cstTableMetadata.CLASS='EVENTS')
  • SUPP** (all Supplemental Qualifier tables)
  • _ALL_-SUPP** (all tables except Supplemental Qualifier tables)
  • [DM][EX] (two sublists comparing DM with EX)
  • SRCDATA1.AE+SRCDATA2.AE (AE table from two different libraries)
  • SRCDATA.** (all tables from the SRCDATA library)
  • **.AE (all AE tables from all sourcedata libraries)
Required Global Macro Variables (beyond reporting and debugging variables):
_cstTableMetadata
Required File Inputs: none
Parameters:
  • _cstFormatType—If the value is LIST, it sets macro variables of # tables and space-delimited list of tables. The value DATASET is the default. Returns a data set of tables matching tablescope specification.
  • _cstDomWhere—WHERE clause to subset returned set of tables. Any WHERE clause is applied as the last step.
  • _cstDomDSName—Name of data set returned when _cstFormatType=DATASET.
  • _cstSubOverride—Y or N (default). If Y, then overrides sublist processing to allow sublists of different lengths (such as tableScope=[_ALL_-DM][DM] ).
File: cstutil_builddomlist.sas

%cstutil_checkds

%cstutil_checkds(_cstdsname=, _csttype=, _cstsubtype=, _cststandard=*, _cststandardversion=*);
[ Exposure: internal ] [ Macro Type: framework check ]
cstutil_checkDS
Validates the structure of the data set against the template data set structure that is provided with the standard.
Required Global Macro Variables: assumes &_cstResultsDS macro is set to a valid two-level name.
Required File Inputs:
Parameters:
  • _cstdsname—Required. The two-level name of the data set to validate.
  • _csttype—Required. The type of data set to be created. This value comes from the TYPE column in the SASReferences file for the standard-version combination.
  • _cstsubtype—Optional. Specifies the subtype for the type. This value comes from the SUBTYPE column in the SASReferences file for the standard-version combination. If the type has no subtypes, then this value can be omitted. Oherwise it must be provided.
  • _cststandard—Optional. The name of the data standard to validate against. By default, all standards are included.
  • _cststandardversion—Optional. The version of the data standard to validate against. By default, all values of standardversion are included.
File: cstutil_checkds.sas

%chkvals

%chkvals;
[ Exposure: Not specified ] [ Macro Type: Not specified ]
***********macro parameters not defined ************
Data set exists and has some records.
Dump contents of template table, compare it to the data set that is passed in.
Only keep those columns that have lookup values provided with the standard.
Load the list of columns to check into macro variable column.
Load the number of columns to check into macro variable numcol.
Separate which lookup columns have a dependency on the refcolumn in the lookup table.
Load the list of columns that have a dependency on a reference column into macro variable refcol.
Load the number of columns that depend on a refcolumn into macro variable numrefcol.
Sort the lookup table.
File: cstutil_checkds.sas

%cstutil_cleanupcstsession

%cstutil_cleanupcstsession(_cstClearCompiledMacros=0, _cstClearLibRefs=0, _cstResetSASAutos=0, _cstResetFmtSearch=0, _cstResetSASOptions=1, _cstDeleteFiles=1, _cstDeleteGlobalMacroVars=0);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_cleanupcstsession
Cleans up after a SAS Clinical Standards Toolkit session, including removing any process-level SAS files and clearing the work.sasmacr catalog.
Most often used at the end of a SAS Clinical Standards Toolkit driver program, such as validate_data. Should be called where a DATA step or PROC is allowed.
Required Global Macro Variables:
  • _cstDeBug
  • _cstsasrefs
  • _cstmessages
Parameters:
  • _cstClearCompiledMacros—Remove all compiled macros from the work.sasmacr catalog. Values: 0 (No, default), 1 (Yes).
  • _cstClearLibRefs—Deallocate all librefs and filerefs set based on the SASReferences content. Values: 0 (No, default), 1 (Yes).
  • _cstResetSASAutos—Reset the autocall search path to its initial state. Values: 0 (No, default), 1 (Yes).
  • _cstResetFmtSearch—Reset the format search path to its initial state. Values: 0 (No, default), 1 (Yes).
  • _cstResetSASOptions—Reset SAS options to their initial state. Values: 0 (No), 1 (Yes, default).
  • _cstDeleteFiles—Delete all SAS Clinical Standards Toolkit Work files and catalogs. Values: 0 (No), 1 (Yes, default). If _cstDebug=1, then files are not deleted even if _cstDeleteFiles=1.
  • _cstDeleteGlobalMacroVars—Delete all SAS Clinical Standards Toolkit global macro variables set based on property filename or value pairs. Values: 0 (No, default), 1 (Yes).
File: cstutil_cleanupcstsession.sas

%cstutil_CreateMetadataReport

%cstutil_CreateMetadataReport(_cstStandardTitle=, _cstValidationDS=, _cstValidationDSWhClause=, _cstMessagesDS=, _cstStdRefDS=, _cstReportOutput=, _cstCheckMDReport=N, _cstMessageReport=N, _cstStdRefReport=N, _cstRecordView=N);
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_createmetadatareport
Create a report documenting a SAS Clinical Standards Toolkit process, based on the Validation Master or Validation Control, Messages, and the Validation StdRef data sets.
Parameters:
  • _cstStandardTitle—Optional. Title that defines the title2 statement for all reports.
  • _cstValidationDS—Required. The validation data set that is used by a SAS Clinical Standards Toolkit process. This would be Validation Master or Validation Control, or a derivative provided by the user.
  • _cstValidationDSWhClause—Optional. WHERE clause applied to _cstValidationDS.
  • _cstMessagesDS—Required. The Messages data set used by a SAS Clinical Standards Toolkit process.
  • _cstStdRefDS—The Validation StdRef data set created for a SAS Clinical Standards Toolkit standard. This file is required if _cstStdRefReport=Y.
  • _cstReportOutput—The file that contains the report. Acceptable files are PDF, RTF, and HTML. The extension is used to determine ODS output.
  • _cstCheckMDReport—Specifies whether panel 2 Check Details is run. Default is N.
  • _cstMessageReport—Specifies whether panel 3 Message Details is run. Default is N.
  • _cstStdRefReport—Specifies whether panel 4 Reference Information is run. Default is N.
  • _cstRecordView—If Y, then a full listing of all available check metadata is generated, by check, in a single listing. Either this listing or the multi-panel report can be generated in a single invocation of this macro, but not both. Default is N.
File: cstutil_createmetadatareport.sas

%cstutil_createreport

%cstutil_createreport(_cstsasreferencesdset=, _cstresultsdset=&_cstRptResultsDS, _cstmetricsdset=&_cstRptMetricsDS, _cstreporterrorsonly=N, _cstreportobs=, _cstreportbytable=N, _csttablechecksdset=, _csttablecheckscode=, _cstkeeptablechecklist=N, _csttablesubset=, _cstreportoutput=, _cstsummaryReport=Y, _cstioReport=Y, _cstmetricsReport=Y, _cstgeneralResultsReport=Y, _cstcheckIdResultsReport=Y);
[ Exposure: external] [ Macro Type: Framework utility]
Creates a report documenting a SAS Clinical Standards Toolkit process, based on the Results and Metrics data sets generated by that process.
Parameters:
  • _cstsasreferencesdset—The SASReferences data set used by a SAS Clinical Standards Toolkit process. Either this data set or the _cstresultsdset must exist.
  • _cstresultsdset—The Results data set created by a SAS Clinical Standards Toolkit process. Either this data set or the _cstsasreferencesdset must exist.
  • _cstmetricsdset—Optional. The Metrics data set created by a SAS Clinical Standards Toolkit process.
  • _cstreporterrorsonly—(Y/N), If Y (default), then print only non-informational Results data set records.
  • _cstreportobs—The number of Results data set records (per checkid) to be printed. If blank, then all records are printed.
  • _cstreportbytable—Y/N. If N (default), then generate Report1 (by checkid) results. If Y, then generate Report2 (by table) results. Any value that is not equal to Y is assumed to be N.
  • _csttablechecksdset—A data set providing a list of tables for each check. Use of this parameter assumes that this data set has been built before running this report.
  • _csttablecheckscode—The code module (macro) to build _csttablechecksdset if it does not exist or is not passed as a parameter. Required only if _cstreportbytable=Y and _csttablechecksdset is not provided.
  • _cstkeeptablechecklist—Y or N (default). If running Report2, then keep the derived list of tables (_csttablechecklist) to reuse in subsequent report requests. Building this file might take awhile. Any value that is not equal to Y is assumed to be N.
  • _csttablesubset—Report 2 parameter, subset Results data set to specified source data set. If blank or _ALL_, then all records are printed. Example: DM.
  • _cstreportoutput—Required. The path and filename where the report output is to be written.
  • _cstsummaryReport—Specifies whether to generate Report Summary panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
  • _cstioReport—Specifies whether to generate Process Inputs/Outputs panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
  • _cstmetricsReport—Specifies whether to generate Process Metrics panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
  • _cstgeneralResultsReport—Specifies whether to generate General Process Reporting panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
  • _cstgeneralResultsReport—Specifies whether to generate General Process Reporting panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
  • _cstcheckIdResultsReport—Specifies whether to generate Process Results panel. Valid values are Y (default) and N. Any value that is not equal to N is assumed to be Y.
File: cstutil_createreport.sas

%cstutil_createTempMessages

%cstutil_createTempMessages(_cstCreationFlag=);
[ Exposure: internal ] [ Macro Type: Framework ]
Creates a temporary Messages data set using the CST-FRAMEWORK messages. If the Messages data set specified by the macro variable &_cstMessages does not exist, then this macro creates a temporary version. It looks for the default version of the SAS Clinical Standards Toolkit framework. It copies the Messages data set specified in the default SASReferences file to the name specified in the &_cstMessages macro variable. If the caller supplies the name of a macro variable in _cstCreationFlag, then this is set if the data set was created in this macro.
Parameters:
  • _cstCreationFlag—Optional. The name of a macro variable that is set in the macro. It is set to 0 if the macro did not create the Messages data set (because it existed). It is set to 1 if this macro created the data set. It is strongly suggested that the caller use this variable to ensure that the temporary data set is cleaned up afterward.
File: cstutil_createtempmessages.sas

%cstutil_deleteDataSet

%cstutil_deleteDataSet(_cstDataSetName=);
[ Exposure: internal ] [ Macro Type: standard_name ]
Deletes a data set if it exists. _cst_rc is set to 0 if it is successful, and 1 otherwise. If the library is not assigned, or the data set does not exist, then this still returns 0.
Parameters:
  • _cstDataSetName—Required. The (LIBNAME.)memname of the data set to be deleted.
File: cstutil_deletedataset.sas

%cstutil_getRandomNumber

%cstutil_getRandomNumber(_cstVarname=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstVarname
File: cstutil_getrandomnumber.sas

%cstutil_getsasreference

%cstutil_getsasreference(_cstStandard=, _cstStandardVersion=, _cstSASRefType=, _cstSASRefSubtype=, _cstSASRefsasref=, _cstSASRefmember=, _cstConcatenate=0, _cstFullname=0, _cstAllowZeroObs=0);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_getsasreference
Gets the row-level metadata from the SASReferences data set given the type and subtype.
Assumptions: SASReferences exists and has interpretable content.
Required Global Macro Variables (beyond reporting and debugging variables):
  • _cstTableMetadata
  • _cstColumnMetadata
  • _cstSASRefs
Required File Inputs: SASReferences data set (as defined by &_cstSASRefs)
Parameters:
  • _cstStandard—Identifies the name of a registered standard. If blank, then no subsetting by standard is attempted.
  • _cstStandardVersion—Identifies the version of a registered standard. If blank, then no subsetting by version is attempted.
  • _cstSASRefType—Required. File or data type from sasreferences.type. Representative values: autocall, control, fmtsearch, messages, properties, referencecontrol, referencemetadata, results, sourcedata, and sourcemetadata.
  • _cstSASRefSubtype—Optional. File or data subtype from sasreferences.subtype. Values are specific to type. Some types do not have subtypes. Representative values: column, data, log, lookup, metrics, package, reference, results, table, and validation.
  • _cstSASRefsasref—Identifies the calling macro variable name to populate with the value of sasreferences.sasref.
  • _cstSASRefmember—Identifies the calling macro variable name to populate with the value of sasreferences.memname, based on the value of the _cstFullname parameter.
  • _cstConcatenate—If 1, then return multiple row values, space delimited, for each macro variable requested (sasref, member).
  • _cstFullname—If 1, then return full name from sasreferences.memname.
  • _cstAllowZeroObs—If 1, then allow SASReferences to operate without warnings when a row that is requested is not found and returns zero observations. Default=0. Create warning when zero observations are encountered.
File: cstutil_getsasreference.sas

%cstutil_getsubjectcount

%cstutil_getsubjectcount(_cstDS=, _cstsubid=&_cstSubjectColumns);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_getsubjectcount
Part of metrics processing. Populates the Metrics global macro variable _cstMetricsCntNumSubj with the count of the number of subjects.
Called by any macro code module for which a count of the number of subjects is wanted.
Required Global Macro Variables (beyond reporting and debugging variables): _cstSubjectColumns (used by default for a null _cstsubid input parameter)
Required File Inputs: source data set to be processed (as parameter _cstDS)
Parameters:
  • _cstDS—The source data set that contains subject data of interest.
  • _cstsubid—The set of subject identifiers appropriate for the _cstDS.
File: cstutil_getsubjectcount.sas

%cstutil_internalmanageresults

%cstutil_internalmanageresults(_cstAction=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstAction
File: cstutil_internalmanageresults.sas

%cstutil_messagesdsattr

%cstutil_messagesdsattr /des='CST: Messages data set column attributes';
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_messagesdsattr
Defines Messages data set column attributes.
Use: Statement level in a SAS DATA step, where a SAS ATTRIB statement might be used.
Required Global Macro Variables: (none)
Required File Inputs: (none)
File: cstutil_messagesdsattr.sas

%cstutil_metricsdsattr

%cstutil_metricsdsattr /des='CST: Metrics data set column attributes';
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_metricsdsattr
Defines Metrics data set column attributes.
Use: Statement level in a SAS DATA step, where a SAS ATTRIB statement might be used.
Required Global Macro Variables: (none)
Required File Inputs: (none)
File: cstutil_metricsdsattr.sas

%cstutil_parsecolumnscope

%cstutil_parsecolumnscope(_cstscopestr=, _cstopsource=, _cstsublistnum=);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_parsecolumnscope
Parses input parameter strings to add or remove columns from the Work data set _cstColumnMetadata.
Called only by cstutil_buildcollist.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs:
  • work._csttempcolumnmetadata
  • work._cstcolumnmetadata
Parameters:
  • _cstscopestr—The string value being parsed. Generally, this is the entire columnscope value if there are no sublists, or a specific sublist.
  • _cstopsource—A modified string value used to populate the _cstRefValue macro value.
  • _cstsublistnum—The sublist number in columnscope. If there is no sublist, then this is set to 1.
File: cstutil_parsecolumnscope.sas

%cstutil_parsescopesegment

%cstutil_parsescopesegment(_cstPart=, _cstVarName=, _cstMessageID=CST0004);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_parsescopesegment
Parses validation check metadata columns tablescope and columnscope to handle extended values such as <libref>.<table>.<column> and wildcarding to build a logical SAS code string to subset _cstTableMetadata and _cstColumnMetadata.
Called only by cstutil_parsecolumnscope and cstutil_parsetablescope.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs: (none)
Parameters:
  • _cstPart—Which part of the tablescope or columnscope string is to be interpreted. Expected values are _cstLibPart, _cstTabPart, or _cstColPart.
  • _cstVarName—The column name in either _csttablemetadata or _cstcolumnmetadata. Typical values are sasref, table, or column.
  • _cstMessageID
File: cstutil_parsescopesegment.sas

%cstutil_parsetablescope

%cstutil_parsetablescope(_cstscopestr=, _cstopsource=, _cstsublistnum=);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_parsetablescope
Parses input parameter strings to add or remove tables from the Work data set _cstTableMetadata.
Called only by cstutil_builddomlist.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs:
  • work._csttablemetadata
  • work._csttemptablemetadata
Parameters:
  • _cstscopestr—The string value being parsed. Generally, this is the entire tablescope value if there are no sublists, or a specific sublist.
  • _cstopsource—A modified string value used to populate the _cstRefValue macro value.
  • _cstsublistnum—The sublist number within tablescope. If there is no sublist, then this is set to 1.
File: cstutil_parsetablescope.sas

%cstutil_processsetup

%cstutil_processsetup(_cstSASReferencesSource=SASREFERENCES, _cstSASReferencesName=sasreferences, _cstSASReferencesLocation=);
[ Exposure: external] [ Macro Type: SAS Clinical Standards Toolkit Framework]
cstutil_processsetup
Set up model-specific study metadata.
The basic function of this code module is to set up study metadata when using the various SAS driver programs (for example, validate_data, cst_reports, and so on).
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs: (none)
Parameters:
  • _cstSASReferencesSource—Setup should be based on what initial source? Valid values are SASREFERENCES (default) or RESULTS data set. If RESULTS, then no other parameters are required, and set up responsibility is passed to the cstutil_reportsetup macro.
  • _cstSASReferencesName—The name of the SASReferences data set (default is SASREFERENCES).
  • _cstSASReferencesLocation—The path (folder location) of the SASReferences data set (default is the path to the Work library).
File: cstutil_processsetup.sas

%cstutil_readcontrol

%cstutil_readcontrol /des=“CST: Create control file macro variables”;
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_readcontrol
To read a single Validation Control record, as passed in through the data set referenced by the _cstThisCheckDS global macro variable, and to create local macro variables for each column in the control file. These macro variables are available in the context of each specific check macro.
Called by each check macro.
Required Global Macro Variables: _cstThisCheckDS
Required File Inputs: Control file as stored in _cstThisCheckDS
File: cstutil_readcontrol.sas

%cstutil_reportgeneralprocess

%cstutil_reportgeneralprocess;
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportinputsoutputs
Creates the General Process Reporting panel.
Parameters: (none)
File: cstutil_reportgeneralprocess.sas

%cstutil_reportinputsoutputs

%cstutil_reportinputsoutputs;
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportinputsoutputs
Creates the Process Inputs/Outputs panel.
Parameters: (none)
File: cstutil_reportinputsoutputs.sas

%cstutil_reportprocessmetrics

%cstutil_reportprocessmetrics
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportprocessmetrics
Creates the Process Metrics panel.
Parameters: (none)
File: cstutil_reportprocessmetrics.sas

%cstutil_reportprocessresults

%cstutil_reportprocessresults;
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportprocessresults
Creates the Process Results panel.
Parameters: (none)
File: cstutil_reportprocessresults.sas

%cstutil_reportprocesssummary

%cstutil_reportprocesssummary;
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportprocesssummary
Creates the Process Summary panel.
Parameters: (none)
File: cstutil_reportprocesssummary.sas

%cstutil_reportsetup

%cstutil_reportsetup(_cstRptType=Metadata);
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reportsetup
Performs a setup function for SAS Clinical Standards Toolkit reporting. If _cstSetupSrc=RESULTS, then the code interprets information from a Results data set referenced by the _cstRptResultsDS macro variable. Otherwise, the code interprets information from the SASReferences data set referenced by the _cstSASRefs global macro variable.
Parameters:
  • _cstRptType—Identifies the type of report to be generated. Valid values include metadata (report on SAS Clinical Standards Toolkit validation check metadata) and results (report on SAS Clinical Standards Toolkit process results and metrics).
Assumptions:
_cstSASRefs global macro variable exists and specifies a valid SASReferences data set. (Either SASREFERENCES (default) or RESULTS).
File: cstutil_reportsetup.sas

%cstutil_reporttabledata

%cstutil_reporttabledata;
[ Exposure: external] [ Macro Type: Framework utility ]
cstutil_reporttabledata
Creates work._cstrptresultsdom, which represents work._cstrptresults expanded to include records for each table applicable to the originally reported results.
Assumptions:
  • This module is applicable only to Report2 and CDISC standards reporting table-level results (that is, CDISC SDTM and CDISC ADaM).
  • This module includes a call to a CDSIC SDTM specific macro that only is known or found in a CDISC SDTM autocall path.
Parameters: (none)
File: cstutil_reporttabledata.sas

%cstutil_resultsdsattr

%cstutil_resultsdsattr /des='CST: Results data set column attributes';
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_resultsdsattr
Defines Results data set column attributes.
Use: Statement level in a SAS DATA step, where a SAS ATTRIB statement might be used.
Required Global Macro Variables: (none)
Required File Inputs: (none)
File: cstutil_resultsdsattr.sas

%cstutil_resultsdskeep

%cstutil_resultsdskeep /des='CST: Results data set columns';
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_resultsdskeep
Specifies Results data set columns to keep in a DATA step.
Use: Statement level in a SAS DATA step, where a SAS KEEP statement might be used.
Required Global Macro Variables: (none)
Required File Inputs: (none)
File: cstutil_resultsdskeep.sas

%cstutil_saveresults

%cstutil_saveresults(_cstIncludeValidationMetrics=0);
[ Exposure: internal] [ Macro Type: Framework utility ]
cstutil_saveresults
Saves process results to a file or files that are specified in SASReferences with type= RESULTS values.
Required Global Macro Variables:
  • _cstMetricsDS
  • _cstResultsDS
Parameters:
  • _cstIncludeValidationMetrics—Specifies whether process results includes validation metrics. Valid values are 0 (No, default) and 1 (Yes).
File: cstutil_saveresults.sas

%cstutil_setcstgroot

%cstutil_setcstgroot;
[ Exposure: Not specified ] [ Macro Type: Not specified ]
File: cstutil_setcstgroot.sas

%cstutil_setmodel

%cstutil_setmodel /des=“Set Which Model Definition to Use”;
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_setmodel
To establish the comparison reference metadata for a check. This is based on the Validation_Control.usesourcemetadata flag. If this flag is Y, then sourcemetadata.* serves as the comparison metadata. Otherwise, reference metadata.* does.
Called for each check, but only by builddomlist and buildcollist macros.
Required Global Macro Variables (beyond reporting and debugging variables):
  • _cstTableMetadata
  • _cstColumnMetadata
Required File Inputs:
  • Source tables and column metadata (derived from SASReferences)
  • Reference tables and column metadata (derived from SASReferences)
Assumptions:
  • While there should generally be only a single source of referencemetadata.* from the SASReferences control data set, the code allows multiple sources. These are concatenated in the derivation of the work._cstTableMetadata and work._cstColumnMetadata data sets.
  • There might be multiple sources of sourcemetadata.* from the SASReferences control data set. These are concatenated in the derivation of the work._cstTableMetadata and work._cstColumnMetadata data sets.
File: cstutil_setmodel.sas

%cstutil_writecubexml

%cstutil_writecubexml(_cstXMLOut=, _cstMDPFile=, _cstDebug=);
[ Exposure: Not specified ] [ Macro Type: Not specified ]
Parameters:
  • _cstXMLOut
  • _cstMDPFile
  • _cstDebug
File: cstutil_writecubexml.sas

%cstutil_writemetric

%cstutil_writemetric(_cstMetricParameter=, _cstResultID=, _cstResultSeqParm=, _cstMetricCnt=, _cstSrcDataParm=, _cstMetricsDSParm=&_cstMetricsDS);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_writemetric
Adds a single record to the Metrics data set based solely on parameter values.
Must be called outside the context of a DATA step.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs: &_cstMetricsDS (as parameter _cstMetricsDSParm)
Parameters:
  • _cstMetricParameter—Metric parameter. Extensible set of metrics. Examples include: # of subjects, # of records tested, # of distinct check invocations, Errors (severity=High) reported, Warnings (severity=Medium) reported, Notes (severity=Low) reported, # of structural errors, and # of content errors. METRICS value.
  • _cstResultID
  • _cstResultSeqParm—Generally 1, unless duplicate values of resultid need to be distinguished, such as multiple invocations of the same validation checkid.
  • _cstMetricCnt—Record counter for _cstMetricParameter.
  • _cstSrcDataParm—Information to link metric back to source (for example, SDTM domain name or calling validation code module).
  • _cstMetricsDSParm—The base (cross-check) Metrics data set to which this record is to be appended. By default, this is the data set referenced by the _cstMetricsDS global macro variable.
File: cstutil_writemetric.sas

%cstutil_writeresult

%cstutil_writeresult(_cstResultID=, _cstValCheckID=, _cstResultParm1=, _cstResultParm2=, _cstResultSeqParm=1, _cstSeqNoParm=1, _cstSrcDataParm=, _cstResultFlagParm=0, _cstRCParm=0, _cstActualParm=, _cstKeyValuesParm=, _cstResultDetails=, _cstResultsDSParm=&_cstResultsDS);
[ Exposure: internal ] [ Macro Type: Framework utility ]
cstutil_writeresult
Adds a single record to the Results data set based solely on parameter values.
Must be called outside the context of a DATA step.
Required Global Macro Variables (beyond reporting and debugging variables): (none)
Required File Inputs:
  • &_cstMessages (created by cstutil_allocatesasreferences)
  • &_cstResultsDS (as parameter _cstResultsDSParm)
Parameters:
  • _cstResultID—Set to validation process ID (for example, CST0017). Should have matching entry in Messages data set.
  • _cstValCheckID—Validation check identifier from Validation Control data set.
  • _cstResultParm1—An optional parameter to appear in first substitution field of the associated message with the same resultid.
  • _cstResultParm2—An optional parameter to appear in second substitution field of the associated message with the same resultid.
  • _cstResultSeqParm—Generally 1, unless duplicate values of resultid need to be distinguished, such as multiple invocations of the same validation checkid.
  • _cstSeqNoParm—Sequence number within _cstResultSeqParm, beginning with 1 and incremented by 1 for each observation that is written to a data set.
  • _cstSrcDataParm—Information to link result back to source (for example, SDTM domain name or calling validation code module).
  • _cstResultFlagParm—Problem detected? Set to 0 if this is an informational rather than error record. A positive value indicates that an error was detected. A negative value indicates that the check failed to run for some reason.
  • _cstRCParm—Value of _cst_rc at the point the result is written to data set.
  • _cstActualParm—Source data value or values that are causing result to be written to data set.
  • _cstKeyValuesParm—Information to link result back to a specific source data record (for example, data set key or XML row and column values).
  • _cstResultDetails—Provides the ability to specify run-time details about the result. These take precedence over metadata result details.
  • _cstResultsDSParm—The base (cross-check) result data set to which this record is to be appended. By default, this is the data set referenced by the _cstResultsDS global macro variable.
File: cstutil_writeresult.sas