/*------------------------------------------------------------*
* program:     cdisc111.sas                                     *
* Description: Case #111. DV Count (R4104) For DV domains, this identifies records that*
*              violate the condition [count (distinct Protocol Deviation Term) = *
*              count(distinct Protocol Deviation Coded Term)], limited to records *
*              where [Protocol Deviation Term is not null].*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.DV(label="Demographics");
attrib STUDYID   label="Study Identifier" length=$100;
attrib DOMAIN  	 label="Domain Abbreviation" length=$100;
attrib USUBJID    label="Sequence Number" length=$100;
attrib DVSEQ  	 label="Subject Identifier for the Study" length=$100;
attrib DVREFID   label="Subject Reference Start Date/Time" length=$100;
attrib DVSPID    label="Sponsor-Defined Identifier" length=$100;
attrib SITEID  	 label="Study Site Identifier" length=$100;
attrib DVTERM  	 label="Protocol Deviation Term" length=$100;
attrib DVDECOD   label="Protocol Deviation Coded Term" length=$100;

STUDYID ='test'; 
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='test';DVDECOD  ='test';
output;
STUDYID ='test';
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='test';DVDECOD  ='test';
output;
STUDYID ='test';
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='test';DVDECOD  ='test';
output;
STUDYID ='test';
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='test';DVDECOD  ='';
output;
STUDYID ='test';
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='test';DVDECOD  ='test';
output;
STUDYID ='test';
DOMAIN='test';USUBJID='test';  DVSEQ  ='test';DVREFID  ='test';DVSPID  ='test';SITEID  ='test';DVTERM  ='';DVDECOD  ='test';
output;
run;
%cdisc(datlib=templib,datname=DV);
