Each SAS
Clinical Standards Toolkit validation process requires you to specify
the validation checks to be run. This is accomplished by cloning,
subsetting, or building a set of validation checks based on the Validation
Master data set. (See
Validation Check of Metadata: Validation Master.) The SAS Clinical Standards Toolkit
assumes that each Validation Control data set is structurally equivalent
to the Validation Master data set.
A sample
CDISC SDTM 3.1.1 Validation Control data set is deployed to the following
SAS 9.1.3 directory. (The deployed location for SAS 9.2 is different,
but similar.)
!sasroot/../SASClinicalStandardsToolkitSDTM311/1.3/sample/cdisc-sdtm-3.1.1/sascstdemodata/control
By default,
the Validation Control data set name is validation_control.sas7bdat.
As a required
input to a validation process, the Validation Control data set must
be referenced in the run-time SASReferences file. The following display
shows how the SASReferences file and the Validation Control data set
are defined in the sample CDISC SDTM 3.1.1 SASReferences data set:
Defining Validation Control and SASReferences Data Set Locations
The &studyRootPath
value is assumed to have been set to
!sasroot/../SASClinicalStandardsToolkitSDTM311/1.3/sample/cdisc-sdtm-3.1.1/sascstdemodata
.
The following
table provides examples of how to create a Validation Control data
set from the Validation Master data set. The sample code is written
assuming that the code will be submitted in a context where libraries
have been allocated and the format search and autocall paths have
been set.
Sample Code to Create Validation Control Data Set
|
|
All checks provided
with the SAS Clinical Standards Toolkit.
|
data control.validation_control;
set refcntl.validation_master;
|
Structural checks (metadata-only
checks that do not require access to the domain data).
|
data control.validation_control;
set refcntl.validation_master
(where=(upcase(checktype)="METADATA")); run;
|
Content checks (checks
that require access to the domain data).
|
data control.validation_control;
set refcntl.validation_master
(where=(upcase(checktype) ne "METADATA"));
|
Checks with a production
status.
|
data control.validation_control;
set refcntl.validation_master
(where=(checkstatus>0));
|
WebSDM checks (CDISC
SDTM only).
|
data control.validation_control;
set refcntl.validation_master
(where=(upcase(checksource)= "WEBSDM"));
|
Sampling of checks,
one for each check macro.
|
proc sort
data=refcntl.validation_master out=work.control;
proc sort
data=work.control out=control.validation_control (label="Check sampler");
|
|
data control.validation_control;
set refcntl.validation_master
(where=(standardVersion = "3.1.1" or standardVersion = "***"));
|
All codelist-related
checks (checks that use the cstcheck_notincodelist macro).
|
data control.validation_control;
set refcntl.validation_master
(where=(upcase(checksource)="CSTCHECK_NOTINCODELIST"));
|
All checks applicable
to a specific domain.
|
%macro buildcheckdomainlist
(_cstCheckDS=,_cstOutputDS=work._cstcheckdomains);
%let _cstCheckSeqCount=0;
if 0 then
set &_cstCheckDS nobs=_numobs;
call symputx('_cstCheckCnt',_numobs);
attrib checkid
format=$8. label="Validation check identifier"
table format=$32.
label="Table Name"
standardversion
format=$20. label="Standard version"
checksource
format=$40. label="Source of check"
resultseq
format=8. label="Unique invocation of check";
%do check=1
%to &_cstCheckCnt;
set &_cstCheckDS
(keep=checkid standardversion checksource tablescope columnscope usesourcemetadata
call symputx('_cstCheckID',checkid);
call symputx('_cstStandardVersion',standardversion);
call symputx('_cstChecksource',checksource);
call symputx('_cstTableScope',tablescope);
call symputx('_cstColumnScope',columnscope);
call symputx('_cstUseSourceMetadata',usesourcemetadata);
|
|
%if &_cstCheckID=&_cstOldCheckID
%then %do;
%let _cstCheckSeqCount=%eval(&_cstCheckSeqCount+1)
;
%else %let
_cstCheckSeqCount=1;
%* Call
macro to interpret tableScope and columnScope to build work._cstcolumnmetadata
for each check *;
%* _cstDomSubOverride=Y
parameter allows us to also look at check records with unequal sublist
lengths *;
%cstutil_buildcollist(_cstFormatType=DATASET,_cstDomSubOverride=Y);
create table
work._csttempds as
select distinct
table, "&_cstCheckID" as checkid length=8,
&_cstCheckSeqCount
as resultseq,
"&_cstStandardVersion"
as standardversion length=20,
"&_cstChecksource"
as checksource length=40
from work._cstcolumnmetadata;
proc append
base=&_cstOutputDS data=work._csttempds force;
%let _cstOldCheckID=&_cstCheckID;
* Clear
contents for next loop, in case of problems *;
|
|
%* Run this
only once per stable reference validation_master - it takes a while...
;
%buildcheckdomainlist(_cstCheckDS=refcntl.validation_master);
%* The libname
for validation_control is assigned in sasreferences. In the sample
study it is cntl_v. This might need to be changed either in this macro
or the call to it.;
%macro subsetdomainlist(_cstInputDS=work._cstcheckdomains,_cstOutputDS=cntl_v.validation_control,
create table
&_cstOutputDS as
select vm.*
from refcntl.validation_master vm
right join
&_cstInputDS dom
on vm.checkid=dom.checkid
and vm.standardversion=dom.standardversion and
vm.checksource=dom.checksource
where table="&_cstDomain";
%* Example
call: subset validation data set just to those checks for the specified
domain ;
%* Returns
all records for checkid/standardversion/checksource if any matches
domain - needs tweaking... ;
%subsetdomainlist(_cstDomain=AE);
|
Generally,
the SAS Clinical Standards Toolkit processes validation checks in
the order in which they appear in the Validation Control data set.
Each validation process honors the default validation property _cstCheckSortOrder.
If this property is not set, then the data set order is assumed. As
a part of the Validation Control derivation, checks can be sorted
in any user-defined order. Or, _cstCheckSortOrder can be set to sort
the Validation Control data set at run time by any fields in that
data set.
Best Practice Recommendation: Users might find the prioritization
of checks to be helpful in identifying problems early in the process,
or for using as prerequisites for checks that follow.