/*------------------------------------------------------------*
* program:     cdisc112.sas                                     *
* Description: Case #112. SE Unplanned Element For SE domains, this identifies records that*
*              violate the condition [Description of Unplanned Element is not null], *
*              limited to records where [Subject Element Code='UNPLAN'].*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.se(label="Demographics");
attrib STUDYID   label="Study Identifier" length=$100;
attrib DOMAIN  	 label="Domain Abbreviation" length=$100;
attrib USESEQ   label="Unique Subject Identifier" length=$100;
attrib SESEQ   label="Sequence Number" length=$100;
attrib ETCD  label="Element Code" length=$100;
attrib ELEMENT   label="Description of Element" length=$100;
attrib SEUPDES	 label="Description of Unplanned Element" length=$100;
attrib SESTDTC 	 label="Start Date/Time of Element" length=$100;

STUDYID ='test'; 
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='UNPLAN';ELEMENT  ='test';SEUPDES  ='';SESTDTC  ='test';
;
output;
STUDYID ='test';
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='test';ELEMENT  ='test';SEUPDES  ='';SESTDTC  ='test';
output;
STUDYID ='test';
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='test';ELEMENT  ='test';SEUPDES  ='test';SESTDTC  ='test';
;
output;
STUDYID ='test';
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='UNPLAN';ELEMENT  ='test';SEUPDES  ='test';SESTDTC  ='test';
output;
STUDYID ='test';
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='UNPLAN';ELEMENT  ='test';SEUPDES  ='test';SESTDTC  ='test';
;
output;
STUDYID ='test';
DOMAIN='test';USESEQ='test';  SESEQ  ='test';ETCD  ='UNPLAN';ELEMENT  ='test';SEUPDES  ='';SESTDTC  ='test';
output;
run;
%cdisc(datlib=templib,datname=se);
