Module Framework

Overview

This is the primary SAS Clinical Standards Toolkit Framework run-time autocall macro library.
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
Framework
%cst_getstandardsubtypes( _cstStandard=CDISC-TERMINOLOGY, _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_columnexists (_cstControl=);
External
Validation Check
%cstcheck_columnvarlist (_cstControl=);
External
Validation Check
%cstcheck_comparedomains(_cstControl=);
External
Validation Check
%cstcheck_crossstdcomparedomains(_cstControl=);
External
Validation Check
%cstcheck_crossstdmetamismatch(_cstControl=);
Internal
System Check
%cstcheck_java();
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);
External
Utility
%cstutil_buildformatsfromxml(_cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English);
Internal
Framework Check
%cstutil_checkds(_cstdsname=, _csttype=, _cstsubtype=, _cststandard=*, _cststandardversion=*);
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 Utility
%cstutil_createsubdir(_cstSubDir=);
Internal
Framework Utility
%cstutil_createsublists();
Internal
Framework
%cstutil_createtempmessages(_cstCreationFlag=);
Internal
Framework Utility
%cstutil_createunixsubdir(_cstSubDir=);
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";
Internal
Framework Utility
%cstutil_readxmltags( _cstxmlfilename=inxml, _cstxmlreporting=Results, cstxmlelementds=work.cstodmelements, _cstxmlattrds=work.cstodmattributes );
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
CDISC-CRT-DDS
%cstutil_writeodmcubexml(_cstXMLOut=);
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:
  • (Required) _cstStandard: The name of a registered standard.
  • (Optional) _cstStandardVersion: 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.
  • (Required) _cstType: The type of data set to be created. This value comes from the TYPE column in the SASReferences file for the standard-version combination.
  • (Optional) _cstSubType: 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.
  • (Required) _cstOutputDS: The name of the data set to be created.
  • (Optional) _cstResultsOverrideDS: 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.
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:
  • (Required) _cstStandard: The name of a registered standard.
  • (Optional) _cstStandardVersion: 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.
  • (Required) _cstOutputLibrary: The LIBNAME in which the table shells should be created.
  • (Optional) _cstResultsOverrideDS: 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:
  • (Required) _cstPropertiesLocation: The location of the property file. The format depends on the value of _cstLocationType.
  • (Required) _cstLocationType: 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).
  • (Optional) _cstResultsOverrideDS: 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_getstandardsubtypes

%cst_getstandardsubtypes( _cstStandard=CDISC-TERMINOLOGY, _cstOutputDS=, _cstResultsDS=);
[ Exposure: external ] [ Macro Type: framework ]
Generates a data set containing the installed Clinical Terminology subtypes (for example, SDTM, CDASH, ADAM, any user-customizations).
Parameters:
  • (Required) _cstStandard: The name of a registered standard.
  • _cstOutputDS: The libname.memname of the data set to create.
  • _cstResultsDS: The results of the creation process.
File: cst_getstandardsubtypes.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.
Parameters:
  • (Required) _cstSASReferences: The (LIBNAME.)member that refers to a valid SASReferences file.
  • (Optional) _cstResultsOverrideDS: 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:
  • (Required) _cstStandard: The name of a registered standard.
  • (Optional) _cstStandardVersion: 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.
  • (Required) _cstOutputDS: The (LIBNAME.)member name of the output data set to be created.
  • (Optional) _cstResultsOverrideDS: 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:
  • (Optional) _cstSASReferences: 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.
  • (Required) _cstOutputDS: The output data set to create that contains the completed information.
  • _cstAddRequiredCSTRefs
  • (Optional) _cstResultsOverrideDS: 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

%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:
  • (Required)_cstPropertiesLocation: The location of the property file. The format depends on the value of _cstLocationType.
  • (Required) _cstLocationType: 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).
  • (Optional) _cstResultsOverrideDS: 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 you. For example, CST_FRAMEWORK provides a property subType of 'required' that points to a property file that has default settings for required properties. You can call this method using this code to set these properties:
%cst_setstandardproperties(
_cstStandard=CST_FRAMEWORK,
_cstStandardVersion=1.2,
_cstSubType=required);
Parameters:
  • (Required) _cstStandard: The name of a registered standard.
  • (Optional) _cstStandardVersion: Specified that the standard has a default set. Otherwise, it is mandatory. This specifies the version of the standard.
  • (Required) _cstSubType: The name of the properties subtype that is to be read and from where properties are set.
  • (Optional) _cstResultsOverrideDS: 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:
  • (Required) _cstPropertiesLocation: The location of the property file. The format depends on the value of _cstLocationType.
  • (Required) _cstLocationType: 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).
  • (Optional) _cstResultsOverrideDS: 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_columnexists

%cstcheck_columnexists (_cstControl=) /des='CST: Does column exist?';
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_columnexists
Determines whether one or more of the columns defined in columnScope exist in each of the tables defined in tableScope.
Note: By default, this check does not require the use of codeLogic. If the check metadata includes a non-null value of codeLogic, it will be used. If codeLogic is used, it must populate the macro variable _cstDataRecords with a count that represents the number of columns found in the specific table defined by _cstDSName _cstDomainOnly. A _cstDataRecords count of 0 will be reported as an error.
Note: Care must be exercised when columnScope contains either multiple columns (for example, TRTP+TRTPn) or a column when using a wildcard (for example, TRT**P). In both cases, the default code will report an error ONLY if NONE of the columns are found.
Note: This is a metadata-only check against column and table metadata files. No source data sets are referenced.
Example validation checks that use this macro:
  • ADAM0090: (for BDS data sets) Does the column TRTP exist?
Parameters:
  • _cstControl: The single observation data set containing check-specific metadata.
File: cstcheck_columnexists.sas

%cstcheck_columnvarlist

%cstcheck_columnvarlist (_cstControl=) /des='CST: Column varlist processing';
[ Exposure: external ] [ Macro Type: Validation Check ]
cstcheck_columnvarlist
Supports comparison of multiple columns within the same data set or across multiple data sets.
Note: As a general rule, this macro expects a check metadata columnScope syntax of {_cstList:var1+var2+var3...varn} for within-data set assessments and {_cstList:var1...varn}{_cstList:var1...varn} for multi-data set assessments.
Note: Macro requires use of _cstCodeLogic at a DATA step level (for example, a full DATA step or PROC SQL invocation). _cstCodeLogic creates a work file (_cstproblems) containing records in error. _cstCodeLogic must handle any data set joins when multiple data sets are involved in the column comparisons.
Example validation checks that use this macro:
  • ADAM0152 - (for BDS data sets) BASE is populated and BASE is not equal to AVAL where ABLFL is equal to "Y" for a given value of PARAM and BASETYPE.
Parameters:
  • _cstControl: The single observation data set containing check-specific metadata.

%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_crossstdcomparedomains

%cstcheck_crossstdcomparedomains(_cstControl=) /des='CST: Cross-std Matching column values not found';
[ Exposure: external ] [ Macro Type: Validation Check ]
This macro generally compares values for 1+ columns in one table against either those same columns in another domain in another standard, or compares values against metadata from the comparison standard.
Note: This macro requires the use of _cstCodeLogic as a full DATA step or PROC SQL invocation. This DATA step or PROC SQL invocation 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.
Example validation checks that use this macro include:
  • ADaM subject not found in SDTM DM domain.
  • ADaM SDTM domain reference (for traceability) is found, but SDTM domain is unknown.
Required global macro variables: (none)
Parameters:
  • _cstControl: The single-observation data set that contains check-specific metadata.
File: cstcheck_crossstdcomparedomains.sas

%cstcheck_crossstdmetamismatch

%cstcheck_crossstdmetamismatch(_cstControl=) /des='CST: Cross-std metadata inconsistencies';
[ Exposure: external ] [ Macro Type: Validation Check ]
This macro identifies inconsistencies between metadata across registered standards.
Note: This macro requires the use of _cstCodeLogic as a full DATA step or PROC SQL invocation. This DATA step or PROC SQL invocation 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 are available to assess compliance.
  • _cstProblems includes two columns (or more if needed):
    • &_cstMnemonic._value (for example, ADaM_value containing the value of the column of interest from the primary standard)
    • &_cstCRMnemonic._value (for example, SDTM_value containing the value of the column of interest from the comparison standard)
The mnemonics are from the global standards library Standards data set.
Required macro variables:
  • _cstcrossstd: The name of the comparison standard.
  • _cstcrossstdver: The version of the comparison standard.
  • _cstrunstd: The name of the primary standard.
  • _cstrunstdver: The version of the primary standard.
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_crossstdmetamismatch.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_java

%cstcheck_java()/des='CST: Were there Java issues in the DATA step?';
[ Exposure: internal ] [ Macro Type: System Check ]
This macro determines whether any Java or related to Java issues exist in the previous DATA step. This macro must be called immediately after the DATA step that declares the Java object.
Note: This macro will be deprecated in future releases of the SAS Clinical Standards Toolkit. It will be replaced in the SAS Clinical Standards Toolkit 1.5 with the cstutil_checkjava macro.
The following Java issues and issues related to Java are caught:
No Java installed:
  • ERROR: The Java proxy is not responding.
  • ERROR: The Java proxys JNI call to start the VM failed.
  • ERROR: Could not create Java VM.
  • SYSERR 0
  • SYSERRORTEXT Could not create Java VM.
No picklist:
  • ERROR: The Java picklist file was not found.
  • ERROR: Could not initialize classpath from picklist file.
  • SYSERR 0
  • SYSERRORTEXT Could not initialize classpath from picklist file.
Edit picklist has the wrong content:
  • ERROR: File(s) are missing from the Java repository.
  • ERROR: Could not initialize classpath from picklist file.
  • SYSERR 0
  • SYSERRORTEXT Could not initialize classpath from picklist file.
Missing JAR file:
  • ERROR: Could not find class com/sas/ptc/transform/xml/StandardXMLTransformerParams at line 3 column 22. Please ensure that the CLASSPATH is correct.
  • ERROR: DATA STEP Component Object failure. Aborted during the EXECUTION phase.
  • SYSERR 1012
  • SYSERRORTEXT DATA STEP Component Object failure. Aborted during the EXECUTION phase
Required global macro variables: (none)
Required file inputs: (none)
File: cstcheck_java.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 invocation 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 you do 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 your responsibility code correct joins and lookup logic in code logic.
When LOOKUPTYPE=CODELIST, functionality is deferred for the 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 you do 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 this style:
[LBTEST+VSTEST][LBTESTCD+VSTESTCD]
These 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.
Here 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 these 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: The location of the SASReferences input file.
  • _cstSASRefsName: The name of the SASReferences input file.
  • _cstSASRefs: The Work library version of SASReferences.
  • _cstFMTLibraries: Specifies whether to include Work and Library in fmtsearch.
  • _cstMessageOrder: Specifies whether to (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.
  • (Optional) _cstStdRef: Reference in standard supporting checks.
  • (Optional) _cstOrderBy: 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: The name of the data set with column metadata returned when _cstFormatType=DATASET.
  • _cstDomDSName: The name of the 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: The name of the 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_buildformatsfromxml

%cstutil_buildformatsfromxml(_cstFmtLib=, _cstReplaceFmtCat=Y, _cstFmtCatPrefix=, _cstFmtCatLang=, _cstFmtCatLangOption=English) /des='CST: Build formats from xml codelists';
[ Exposure: external ] [ Macro Type: Utility ]
This utility macro is designed for use with CDISC XML-based standards such as CRTDDS and ODM. Those standards capture acceptable values in codelists. This module reads that codelist information to create one or more SAS format catalogs, based on the xml:lang language tags.
This macro is called by the odm_read and crtdds_read macros.
Parameters:
  • (Optional) _cstFmtLib: The location where catalogs are written. If this parameter is not specified, the default value is first derived from SASReferences, then WORK.
  • (Optional) _cstReplaceFmtCat: Specifies whether an existing format catalog by the same name in _cstFmtLib is replaced. Values: N | Y. Default behavior: Y (overwrite existing catalog).
  • (Optional) _cstFmtCatPrefix: The prefix to use for catalog names. If this parameter is not specified, the default value is <standard mnemonic>FmtCat (such as ODMFmtCat). This default produces an English format catalog name of ODMFmtCat_en.
  • (Optional) _cstFmtCatLang: If this parameter is specified, it creates a format catalog only for the specified language. Example: _cstFmtCatLang=en. If no records exist for the specified language, an empty catalog is created.
  • (Optional) _cstFmtCatLangOption: Specifies the action to take when no language tag is provided in the XML. Values: Ignore | English | Use_cstFmtCatLang.
    • If the value is Ignore, records are ignored (but they are reported in the SAS log).
    • If the value is English, records are added to the English catalog (default).
    • If the value is Use_cstFmtCatLang, records are added to the language catalog specified in the _cstFmtCatLang parameter.
Assumptions:
  • If EnumeratedItems are encountered, these items are added to each language-specific format catalog that is created.
File: cstutil_buildformatsfromxml.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:
  • (Required) _cstdsname: The two-level name of the data set to validate.
  • (Required) _csttype: The type of data set to be created. This value comes from the TYPE column in the SASReferences file for the standard-version combination.
  • (Optional) _cstsubtype: 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. Otherwise, it must be provided.
  • (Optional) _cststandard: The name of the data standard to validate against. By default, all standards are included.
  • (Optional) _cststandardversion: The version of the data standard to validate against. By default, all values of standardversion are included.
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: Title that defines the title2 statement for all reports.
  • (Required) _cstValidationDS: 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 you.
  • (Optional) _cstValidationDSWhClause: WHERE clause applied to _cstValidationDS.
  • (Required) _cstMessagesDS: 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.
  • (Optional) _cstmetricsdset: 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.
  • (Required) _cstreportoutput: 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_createsubdir

%cstutil_createsubdir(_cstSubDir=)/des='CST: Create subdirectory';
[ Exposure: internal ] [ Macro Type: Framework utility ]
This macro creates subdirectories on a computer that is not Microsoft Windows. The SAS Clinical Standards Toolkit sample drivers create output files that need to have Read and Write access to the subdirectories. This macro creates the subdirectories in the specified workspace. If a value is missing, the StudyOutputPath points to the Work directory, and any subdirectories are created under it. StudyOutputPath is referenced in SASReferences.
Required global macro variables: (none)
File: cstutil_createsubdir.sas

%cstutil_createsublists

%cstutil_createsublists() /des ="CST: Create sublists from columnscope";
[ Exposure: internal ] [ Macro Type: Framework utility ]
This macro creates the work._cstsublists data set that has interpreted validation check metadata as specified in the columnScope column in the expected form of [var1][var2]. This macro is called directly only as a validation check metadata codelogic value.
Note: This macro is not always called for the derivation of work._cstsublists.
Required global macro variables (beyond reporting and debugging variables): _cstColumnScope
Required file inputs: work._cstcolumnmetadata
File: cstutil_createsublists.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:
  • (Optional) _cstCreationFlag: 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_createunixsubdir

Note: This macro will be deprecated in future releases of the SAS Clinical Standards Toolkit. It is replaced in the SAS Clinical Standards Toolkit 1.4 with the cstutil_createsubdir(_cstSubDir=) utility macro.
%cstutil_createunixsubdir(_cstSubDir=)/des='CST: Create subdirectories on UNIX';
[ Exposure: internal ] [ Macro Type: Framework utility ]
This macro creates subdirectories on a UNIX computer. The SAS Clinical Standards Toolkit sample drivers create output data sets that need to have Read and Write access to the subdirectories. On UNIX computers, these sample study programs are in read-only areas. This macro creates the subdirectories in a temporary workspace. StudyOutputPath points to the Work directory, and any subdirectories are created under it. StudyOutputPath is referenced in SASReferences.
Required global macro variables: workpath, typically pathname(work)
File: cstutil_createunixsubdir.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:
  • (Required) _cstDataSetName: 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.
  • (Required) _cstSASRefType: File or data type from sasreferences.type. Representative values: autocall, control, fmtsearch, messages, properties, referencecontrol, referencemetadata, results, sourcedata, and sourcemetadata.
  • (Optional) _cstSASRefSubtype: 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_readxmltags

%cstutil_readxmltags( _cstxmlfilename=inxml, _cstxmlreporting=Results, cstxmlelementds=work.cstodmelements, _cstxmlattrds=work.cstodmattributes ) / des='CST: Parse xml for elements and attributes';
[ Exposure: internal ] [ Macro Type: Framework tool ]
This code provides a proof-of-concept implementation of a tool to read the element tags and attributes of an XML file to identify those element tags and attributes that the SAS Clinical Standards Toolkit does not currently handle using the CDISC ODM odm_read macro.
This macro relies on a defined set of XSLT modules, metadata that specifies a SAS representation of ODM, and a SAS XML map file that reads a derived cubexml file. Each of these makes assumptions about the XML content to be read.
Assumptions:
  • The XML file has previously been defined with a SAS fileref.
  • ODM reference metadata is available as defined in SASReferences.
Limitations:
  • The code does not work on a continuous-stream (no line returns) XML file.
  • The code might not work well on multi-element rows like <Study><MetaDataVersion OID><...>.
  • The code might not handle PCDATA.
Parameters:
  • (Required) _cstxmlfilename: The fileref for the input XML file.
  • (Required) _cstxmlreporting: Specifies how results are reported. Valid values: Dataset or Results. If the value is Dataset, these two parameters are referenced. If the value is Results, the differences that are detected are reported in the process results data set (as defined by the &_cstResultsDS global macro variable).
  • (Optional) _cstxmlelementds: The libref.dataset for file elements. Default=work.cstodmelements.
  • (Optional) _cstxmlattrds: The libref.dataset for file attributes. Default=work.cstodmattributes.
File: cstutil_readxmltags.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 the 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 the SAS Clinical Standards Toolkit validation check metadata) and results (report on the 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 CDISC 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_writeodmcubexml

%cstutil_writeodmcubexml(_cstXMLOut=);
[ Exposure: internal ] [ Macro Type: CDISC-CRT-DDS ]
cstutil_writeodmcubexml
Build XML file for define.xml
Utility macro to create an XML file to be used by the define.xml process. There is one input to this macro: the MDP SAS data set that contains the member names and library references needed for the define process. There is one output: the XML file.
Example:
%cstutil_odmwritecubexml(_cstXMLOut=c:\crtdds\test2.xml)
Required global macro variables: (none)
Parameters:
  • (Required)_cstXMLOut: The destination and filename for XML output.
  • (Required) _cstMDPFile: The libref (for example, srcdata.mdp). If the libref is omitted, the macro fails.
  • (Optional) _cstDebug: If set, information useful for validating the macro is included in the output.
File: cstutil_writeodmcubexml.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