In this case study,
whether the values for standard units (**STRESU) are consistent within
each test code (**TESTCD) across all records in the CDISC SDTM findings
domains is determined.
You want to include
the domains you actually have (that is, source data and metadata).
So, set usesourcemetadata to Y. Next, you want to test all findings
domains, which typically contain these two domain columns (**STRESU
and **TESTCD). So, you might want to set tablescope to CLASS:FINDINGS.
Because you want to compare two columns in each domain, set columnscope
to [**TESTCD][**STRESU].
(For more
information about tablescope and columnscope syntax, see Column Descriptions of the Validation Master Data Set.)
The code logic for CDISC
SDTM check SDTM0623 is listed:
data work._cstunique;
set work._cstunique;
by &_cstColumn1 &_cstColumn2;
if first.&_cstColumn1=0 or last.&_cstColumn1=0 then _checkError=1;
run;
proc sort data=&_cstDSName out=&_cstclds;
by &_cstColumn1 &_cstColumn2;
run;
data work._cstuniqueerrors;
merge work._cstunique (where=(_checkerror=1) in=un)
&_cstclds (in=ds);
by &_cstColumn1 &_cstColumn2;
if un and ds and first.&_cstColumn2;
run;
This case study shows
how the SAS Clinical Standards Toolkit uses local macro variables
for column comparisons. The columnscope syntax [**TESTCD][**STRESU]
tells the SAS Clinical Standards Toolkit to create two sublists. The
first sublist is for all TESTCD columns, and the second is for all
STRESU columns. These are referenced as &_cstColumn1 and &_cstColumn2
in code logic, respectively.
In this case, the validation
check macro that calls and interprets code logic output (cstcheck_notunique)
reports all work._cstuniqueerrors records as failing this instance
of CDISC SDTM check SDTM0623.
It fails now because
of the way it has been configured. The following sections show how
to solve the problem. The generated Results data set contains this
excerpt:
Example of a Results Data Set Excerpt for Check SDTM0623
The
actual and
resultdetails values give clues about
the problem. The SAS Clinical Standards Toolkit resolves the columnscope
sublist [**TESTCD] to five columns. It resolves the sublist [**STRESU]
to four columns. The SAS Clinical Standards Toolkit column comparisons
require sublists of equal length so that valid comparisons can be
made. There appears to be a findings domain that has TESTCD, but not
STRESU. In this case, the domain IE does not have the column IESTRESU.
Attempting to compare IETESTCD with LBSTRESU is not the intention.
Tablescope and columnscope
syntax supports wildcarding and addition and subtraction operators.
However, this flexible functionality is not required. You can submit
explicit table and column references. CDISC SDTM check SDTM0623 could
be defined in the Validation Master data set as shown here:
Consider this alternative
definition for the check:
Both of the above definitions
will run correctly, but do not yet match the record metadata for SDTM0623
in the SAS Validation Master data set:
The reason
LB
is excluded from tablescope is because CDISC SDTM
check SDTM0631 is a specific test of these LB domain columns (the
Validation Master
checksource and
sourceid fields show SDTM0631 to be an implementation
of the WebSDM check IR5006). SDTM0623 is simply a generalization of
SDTM0631 to include all findings domains. There is no reason to redundantly
test LB.