/*------------------------------------------------------------*
* program:     cdisc90.sas                                    *
* Description: Case #90. Country Codelist For DM domains, this identifies records where*
*              value for [COUNTRY] is not found in Codelist [COUNTRY].*
* By:          Sy Truong, 10/14/2009                          *
*-------------------------------------------------------------*/

libname datalib '../data';
options nofmterr;
data datalib.DM (label="Demographics Domain Model");
attrib STUDYID label="Study Identifier"  length=$100;
attrib DOMAIN label="Domain Abbreviation"  length=$100;
attrib USUBJID  label="Unique Subject Identifier"  length=$100;
attrib SUBJID  label="Subject Identifier for the Study" length=$100;
attrib RFSTDTC  label="Subject Reference Start Date/Time" length=$100;
attrib RFENDTC label="Subject Reference End Date/Time" length=$100;
attrib SITEID  label="Study Site Identifier"  length=$100;
attrib INVID  label="Investigator Identifier"  length=$100;
attrib INVNAM  label="Investigator Name"  length=$100;
attrib BRTHDTC  label="Date/Time of Birth"  length=$100;
attrib AGE  label="Age in AGEU at RFSTDTC " length=8;   
attrib AGEU  label="Age Units"  length=$100; 
attrib SEX  label="Sex"  length=$100 ; 
attrib RACE label="Race"  length=$100; 
attrib ETHNIC label="Ethnicity"  length=$100; 
attrib ARMCD  label="Planned Arm Code"  length=$100; 
attrib ARM  label="Description of Planned Arm" length=$100; 
attrib COUNTRY  label="Country"  length=$100 format=$COUNTRY.; 
attrib DMDTC  label="Date/Time of Collection"  length=$100; 
attrib DMDY  label="Study Day of Collection" length=8;   


STUDYID="001";
DOMAIN="001";
USUBJID="001";
SUBJID="001";
RFSTDTC="001";
RFENDTC="001";
SITEID="001";
INVID="001";
INVNAM="001";
BRTHDTC="001";
AGE=23;
AGEU="001";
SEX="U";
RACE="001";
ETHNIC="001";
ARMCD="001";
COUNTRY="USA";
output;

STUDYID="001";
DOMAIN="001";
USUBJID="003";
SUBJID="001";
RFSTDTC="001";
RFENDTC="001";
SITEID="001";
INVID="001";
INVNAM="001";
BRTHDTC="001";
AGE=1;
AGEU="001";
SEX="F";
RACE="001";
ETHNIC="001";
ARMCD="001";
COUNTRY="HUE";
output;

STUDYID="001";
DOMAIN="001";
USUBJID="002";
SUBJID="001";
RFSTDTC="001";
RFENDTC="001";
SITEID="001";
INVID="001";
INVNAM="001";
BRTHDTC="001";
AGE=23;
AGEU="001";
SEX="U";
RACE="001";
ETHNIC="001";
ARMCD="001";
COUNTRY="HUE";
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= dm);
