/*------------------------------------------------------------*
* program:     cdisc22.sas                                     *
* Description: Case #22. Consistent Lab Values For LAB domains, this identifies Short Name of Measurement,*
*              Test or Examination values where standard units value *
*              (Standard Units) is not consistent across all records.*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/
 
libname templib '../data';

*** Create some data to be selected ***;
data templib.lb(label="Laboratory Test Results");
attrib STUDYID	label="Study Identifier" length=$100;
attrib DOMAIN	label="Domain Abbreviation" length=$100;
attrib USUBJID	label="Unique Subject Identifier" length=$100;
attrib LBSEQ	label="Sequence Number" length=8;
attrib LBGRPID	label="Group ID" length=$100;
attrib LBREFID	label="Specimen ID" length=$100;
attrib LBSPID	label="Sponsor-Defined Identifier" length=$100;
attrib LBTESTCD	label="Lab Test or Examination Short Name" length=$100;
attrib LBTEST	label="Lab Test or Examination Name" length=$100;
attrib LBCAT	label="Category for Lab Test" length=$100;
attrib LBSCAT	label="Subcategory for Lab Test" length=$100;
attrib LBORRES	label="Result or Finding in Original Units" length=$100;
attrib LBORRESU	label="Original Units" length=$100;
attrib LBORNRLO	label="Reference Range Lower Limit in Orig Unit" length=$100;
attrib LBORNRHI	label="Reference Range Upper Limit in Orig Unit" length=$100;
attrib LBSTRESC	label="Character Result/Finding in Std Format" length=$100;
attrib LBSTRESN	label="Numeric Result/Finding in Standard Units" length=8;
attrib LBSTRESU	label="Standard Units" length=$100;
STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test1';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit1';
output;
STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test1';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit1';
output;

STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test2';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit1';
output;

STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test2';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit2';
output;

STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test3';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit3';
output;

STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test3';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit2';
output;

STUDYID='test';DOMAIN='test';USUBJID='test';LBSEQ=1;LBGRPID='test';LBREFID='test';LBSPID='test';LBTESTCD='test4';LBTEST='test';
LBCAT='test';LBSCAT='test';LBORRES='test';LBORRESU='test';LBORNRLO='test';LBORNRHI='test';LBSTRESC='test';LBSTRESU='unit4';
output;
run;
%cdisc(datlib=templib,datname=lb);
