/*------------------------------------------------------------*
* program:     cdisc41.sas                                    *
* Description: Case #41. Format Null For Findings domains, this identifies records that violate the condition *
*              [Result or Finding in Standard Format is not null], limited to records where [Derived Flag='Y'].*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.qs(label="Questionnaires");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib USUBJID	label="Unique Subject Identifier" length=$100;
attrib QSSEQ	label="Sequence Number" length=8;
attrib QSGRPID	label="Group ID" length=$100;
attrib QSSPID	label="Sponsor-Defined Identifier" length=$100;
attrib QSTESTCD	label="Question Short Name" length=$100;
attrib QSTEST	label="Question Name" length=$100;
attrib QSCAT	label="Category of Question" length=$100;
attrib QSSCAT	label="Subcategory for Question" length=$100;
attrib QSORRES	label="Finding in Original Units" length=$100;
attrib QSORRESU	label="Original Units" length=$100;
attrib QSSTRESC	label="Character Result/Finding in Std Format" length=$100;
attrib QSSTRESN	label="Numeric Finding in Standard Units" length=8;
attrib QSSTRESU	label="Standard Units" length=$100;
attrib QSREASND	label="Reason Not Performed" length=$100;
attrib QSBLFL	label="Baseline Flag" length=$100;
attrib QSDRVFL	label="Derived Flag" length=$100;
attrib VISITNUM	label="Visit Number" length=8;
attrib VISIT	label="Visit Name" length=$100;
attrib VISITDY	label="Planned Study Day of Visit" length=8;
attrib QSDTC	label="Date/Time of Finding" length=$100;
attrib QSDY		label="Study Day of Finding" length=8;
attrib QSTPT	label="Planned Time Point Name" length=$100;
attrib QSTPTNUM	label="Planned Time Point Number" length=8;
attrib QSELTM	label="Planned Elapsed Time from Time Point Ref" length=$100;
attrib QSTPTREF	label="Time Point Reference" length=$100;
attrib QSRFTDTC	label="Date/Time of Reference Time Point" length=$100;
attrib QSEVLINT	label="Evaluation Interval" length=$100;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '123';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = '';QSSTRESC = 'test';QSSTRESU = 'test';QSREASND = 'test';QSBLFL = 'Y';QSDRVFL='Y';
output;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '123';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = 'test';QSSTRESC = 'test';QSSTRESU = 'test';QSREASND = 'test';QSBLFL = 'Y';QSDRVFL='Y';
output;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '456';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = 'test';QSSTRESC = 'test';QSSTRESU = 'test';QSREASND = 'test';QSBLFL = '';QSDRVFL='';
output;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '456';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = '';QSSTRESC = '';QSSTRESU = '';QSREASND = 'test';QSBLFL = 'Y';QSDRVFL='Y';
output;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '789';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = 'test';QSSTRESC = 'test';QSSTRESU = 'test';QSREASND = 'test';QSBLFL = '';QSDRVFL='';
output;
STUDYID = 'test';DOMAIN = 'test';USUBJID = '789';QSSEQ = 1;QSGRPID = 'test';QSSPID = 'test';QSTESTCD = 'test';QSTEST = 'test';QSCAT = 'test';QSSCAT = 'test';QSORRES = 'test';
QSORRESU = '';QSSTRESC = 'test';QSSTRESU = 'test';QSREASND = 'test';QSBLFL = 'Y';QSDRVFL='Y';
output;
run;
%cdisc(datlib=templib,datname=qs);
