/*------------------------------------------------------------*
* program:     cdisc86.sas                                    *
* Description: Case #86. SUPPQUAL Target Domain For Supplemental Qualifiers domains, this identifies Supplemental *
*              Qualifiers domain reference to a record that doesn't exist in the target domain.*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/

libname datalib '../data';
options nofmterr;

data datalib.SUPTE (label="Adverse Events");
attrib STUDYID label="Study Identifier" length=$100; 
attrib RDOMAIN label="Related Domain Abbreviation" length=$100; 
attrib USUBJID label="Unique Subject Identifier" length=$100; 
attrib IDVAR label="Identifier Variable" length=$100; 
attrib IDVARVAL label="Identifier Variable Value" length=$100; 
attrib RELTYPE label="Relationship Type" length=$100; 
attrib RELID label="Relationship Identifier" length=$100; 

 STUDYID  ="001"; 
 RDOMAIN   ="DM";
 USUBJID  ="001";
 IDVAR    ="BRTHDTC";
 IDVARVAL  ="001";
 RELTYPE  ="ONE";
 RELID   ="CURLIB.DM";
 output;

 STUDYID  ="001"; 
 RDOMAIN   ="DM";
 USUBJID  ="002";
 IDVAR    ="BRTHDTC";
 IDVARVAL  ="008";
 RELTYPE  ="ONE";
 RELID   ="CURLIB.DM";
 output;

 STUDYID  ="001"; 
 RDOMAIN   ="DM";
 USUBJID  ="003";
 IDVAR    ="BRTHDTC";
 IDVARVAL  ="001";
 RELTYPE  ="ONE";
 RELID   ="CURLIB.DM";
 output;


run;
/*----------------------------------------------------*
* Program: cdisc.sas
* Path: C:\Program Files\SAS 9.2\SASFoundation\9.2
* Description: Verify SAS datasets against CDISC standards
* By: Jeanny Huynhh, %cdisc, 10/05/2009,  2:55:15 pm
*-----------------------------------------------------*/
*** Apply the CDISC check ***;
%cdisc (datlib=datalib,
        datname= SUPTE);
