Previous Page | Next Page

CDISC Procedure Examples for CDISC ODM

Example: Importing a CDISC ODM XML Document Specifying KeySet Processing Options


Overview

This example imports clinical trials data from a CDISC ODM XML document that is named AE.XML, and creates a SAS data set that is named RESULTS.AEMIN.

The example illustrates the results of specifying the KeySet processing options ODMMINIMUMKEYSET=YES and ODMMAXIMUMOIDLENGTH= in the ODM statement. Only the unique SubjectKey member is written to the output SAS data set. The character length for the KeySet members is reduced from the default OID length.

To view the AE.XML document, see Sample CDISC ODM XML Document.


Program

The following SAS program imports the XML document as a SAS data set:

  1. The LIBNAME statement assigns the libref RESULTS to the physical location of the output SAS data set.

  2. The FILENAME statement assigns the fileref XMLINP to the physical location of the input XML document (complete pathname, filename, and file extension) to be imported.

  3. The PROC CDISC statement specifies the following:

    • CDISC ODM as the model.

    • Fileref XMLINP, which references the physical location of the input XML document to be imported.

    • FORMATACTIVE=YES to convert CDISC ODM CodeList content in the XML document to SAS formats.

    • FORMATNOREPLACE=NO to replace existing SAS formats in the FORMAT catalog that have the same name as the converted formats.

  4. ODMMINIMUMKEYSET=YES in the ODM statement specifies that only the SubjectKey is written to the output SAS data set.

    ODMMAXIMUMOIDLENGTH=18 in the ODM statement allocates a storage space of 18 characters for the KeySet member character length, instead of the default maximum OID length.

  5. The CLINICALDATA statement identifies the output SAS data set, which is RESULTS.AEMIN, and specifies the CDISC ODM ItemGroupDef attribute that indicates where the data content in the XML document begins, which is AE.

  6. The CONTENTS procedure lists the contents of the output SAS data set. The VARNUM option lists the variables in the order in which they were created.

libname results 'C:\myfiles\'; 1  

filename xmlinp 'C:\XML\ae.xml'; 2 

proc cdisc model=odm 3 
                  read=xmlinp 
                  formatactive=yes
                  formatnoreplace=no;

   odm odmversion="1.2"
                  odmminimumkeyset=yes 4 
                  odmmaximumoidlength=18;                 

   clinicaldata out=results.AEMIN sasdatasetname="AE"; 5 
run;

filename xmlinp clear;

proc contents data=results.AEMIN varnum; 6 
run;

libname results clear;


Output

The output from PROC CONTENTS displays the attributes of each interpreted variable, such as the variable's type and length. The attributes are obtained from the embedded metadata content.

Because ODMMINIMUMKEYSET=YES, only the SubjectKey is written to the output SAS data set, which is the first variable listed in the output.

Because ODMMAXIMUMOIDLENGTH=18, an OID length of 18 is allocated.

PROC CONTENTS Output for RESULTS.AEMIN

                                         The SAS System                                         1

                                     The CONTENTS Procedure

      Data Set Name        RESULTS.AEMIN                          Observations          2
      Member Type          DATA                                   Variables             20
      Engine               V9                                     Indexes               0
      Created              Monday, March 09, 2009 10:45:26 AM     Observation Length    224
      Last Modified        Monday, March 09, 2009 10:45:26 AM     Deleted Observations  0
      Protection                                                  Compressed            NO
      Data Set Type                                               Sorted                NO
      Label                Some adverse events from this trial
      Data Representation  WINDOWS_32
      Encoding             wlatin1  Western (Windows)


                                Engine/Host Dependent Information

                          Data Set Page Size          16384
                          Number of Data Set Pages    1
                          First Data Page             1
                          Max Obs per Page            72
                          Obs in First Data Page      2
                          Number of Data Set Repairs  0
                          Filename                    C:\aemin.sas7bdat
                          Release Created             9.0202M0
                          Host Created                XP_PRO


                                   Variables in Creation Order

                    #    Variable        Type    Len    Format       Informat

                    1    __SubjectKey    Char     18
                    2    TAREA           Char      4    $TAREAF.
                    3    PNO             Char     15
                    4    SCTRY           Char      4    $SCTRYF.
                    5    F_STATUS        Char      1    $F_STATU.
                    6    LINE_NO         Num       8                 2.
                    7    AETERM          Char    100
                    8    AESTMON         Num       8                 2.
                    9    AESTDAY         Num       8                 2.
                   10    AESTYR          Num       8                 4.
                   11    AESTDT          Num       8    DATE.
                   12    AEENMON         Num       8                 2.
                   13    AEENDAY         Num       8                 2.
                   14    AEENYR          Num       8                 4.
                   15    AEENDT          Num       8    DATE.
                   16    AESEV           Char      1    $AESEV.
                   17    AEREL           Char      1    $AEREL.
                   18    AEOUT           Char      1    $AEOUT.
                   19    AEACTTRT        Char      1    $AEACTTR.
                   20    AECONTRT        Char      1    $AECONTR.

Previous Page | Next Page | Top of Page