/*------------------------------------------------------------*
* program:     cdisc75.sas                                    *
* Description: Case #75. Subject Element Code For All domains, this identifies records where*
*              the value for Subject Element Code is not found in the TE domain.*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.se(label="Subject Elements");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib USUBJID	label="Unique Subject Identifier" length=$100;
attrib SESEQ	label="Sequence Number" length=8;
attrib ETCD		label="Element Code" length=$100;
attrib ELEMENT	label="Description of Element" length=$100;
attrib SESTDTC	label="Start Date/Time of Element" length=$100;
attrib SEENDTC	label="End Date/Time of Element" length=$100;
attrib TAETORD	label="Planned Order of Elements within Arm" length=8;
attrib EPOCH	label="Epoch" length=$100;
attrib SEUPDES	label="Description of Unplanned Element" length=$100;
STUDYID='test';DOMAIN='test';USUBJID='test';SESEQ=1;ETCD='SCREEN';ELEMENT='test';SESTDTC='2000-01-01';SEENDTC='2000-01-01';TAETORD=1;EPOCH='test';SEUPDES='test';output;
STUDYID='test';DOMAIN='test';USUBJID='test';SESEQ=1;ETCD='IV';ELEMENT='test';SESTDTC='2000-01-01';SEENDTC='2000-01-01';TAETORD=1;EPOCH='test';SEUPDES='test';output;
STUDYID='test';DOMAIN='test';USUBJID='test';SESEQ=1;ETCD='ORAL';ELEMENT='test';SESTDTC='2000-01-01';SEENDTC='2000-01-01';TAETORD=1;EPOCH='test';SEUPDES='test';output;
STUDYID='test';DOMAIN='test';USUBJID='test';SESEQ=1;ETCD='ORAL';ELEMENT='test';SESTDTC='2000-01-01';SEENDTC='2000-01-01';TAETORD=1;EPOCH='test';SEUPDES='test';output;
STUDYID='test';DOMAIN='test';USUBJID='test';SESEQ=1;ETCD='FOLLOWUP';ELEMENT='test';SESTDTC='2000-01-01';SEENDTC='2000-01-01';TAETORD=1;EPOCH='test';SEUPDES='test';output;
run;

data templib.te(label="Trial Elements");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib ETCD		label="Element Code" length=$100;
attrib ELEMENT	label="Description of Element" length=$100;
attrib TESTRL	label="Rule for Start of Element" length=$100;
attrib TEENRL	label="Rule for End of Element" length=$100;
attrib TEDUR	label="Planned Duration of Element" length=$100;
STUDYID='test';DOMAIN='test';ETCD='SCRN';ELEMENT='test';TESTRL='test';TEENRL='test';TEDUR='test';output;
STUDYID='test';DOMAIN='test';ETCD='SCRN';ELEMENT='test';TESTRL='test';TEENRL='test';TEDUR='test';output;
STUDYID='test';DOMAIN='test';ETCD='FOLLOWUP';ELEMENT='test';TESTRL='test';TEENRL='test';TEDUR='test';output;
STUDYID='test';DOMAIN='test';ETCD='ORAL';ELEMENT='test';TESTRL='test';TEENRL='test';TEDUR='test';output;
STUDYID='test';DOMAIN='test';ETCD='IV';ELEMENT='test';TESTRL='test';TEENRL='test';TEDUR='test';output;
run;

%cdisc(datlib=templib,datname=se);
