/*------------------------------------------------------------*
* program:     cdisc39.sas                                    *
* Description: Case #39. Duration Zero For All (Timing) variables, this identifies records that violate the condition *
*              [Duration greater than or equal to 0], limited to records where [Duration is not null].*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.ex(label="Exposure");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib USUBJID	label="Unique Subject Identifier" length=$100;
attrib EXSEQ	label="Sequence Number" length=8;
attrib EXGRPID	label="Group ID" length=$100;
attrib EXSPID	label="Sponsor-Defined Identifier" length=$100;
attrib EXTRT	label="Name of Actual Treatment" length=$100;
attrib EXCAT	label="Category for Treatment" length=$100;
attrib EXSCAT	label="Subcategory for Treatment" length=$100;
attrib EXDOSE	label="Dose per Administration" length=8;
attrib EXDUR	label="Duration of Treatment" length=$50;

STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=0;EXDUR='-PT15M';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=1;EXDUR='PT8H';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=2;EXDUR='PT8H';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=.;EXDUR='PT8H';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=4;EXDUR='PT8H';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';EXSEQ=1;EXGRPID='test';EXSPID='test';EXTRT='test';EXCAT='test';EXSCAT='test';EXDOSE=.;EXDUR='PT8H';
output;


run;
%cdisc(datlib=templib,datname=ex);
