Describing a CDISC ODM SAS Data Set with the CONTENTS Statement

Overview

This example illustrates how to list the attributes of a CDISC ODM SAS data set in the CDISC ODM XML document named AE.XML. The output displays in the SAS log.
The example includes two different programs, which illustrate how the ODM statement LONGNAMES= processing option determines the sources of captured SAS names parameters based on the value of the option.
To view the AE.XML document, see Sample CDISC ODM XML Document.

Program with LONGNAMES=NO

The following SAS program lists the attributes of a CDISC ODM SAS data set by using the ODM statement LONGNAMES=NO processing option:
  1. The FILENAME statement assigns the fileref XMLINP to the physical location of the input XML document (complete pathname, filename, and file extension).
  2. The PROC CDISC statement specifies CDISC ODM as the model and the fileref XMLINP, which references the physical location of the input XML document to be imported.
  3. The ODM statement specifies CDISC ODM version 1.2 and the LONGNAMES=NO processing option, which determines the following:
    • ODM name attributes are converted to SAS names that can be a maximum of eight characters in length.
    • The SAS data set name is captured from the SASDatasetName= attribute in the ODM ItemGroupDef element. SAS variable names are captured from the SASFieldName= attribute in ODM ItemDef elements. SAS format names are captured from the SASFormatName= attribute in ODM CodeList elements.
  4. The CONTENTS statement writes the contents of the CDISC ODM SAS data set in the SAS log. Note that the CONTENTS statement must specify the name that is in the SASDatasetName= attribute in the ODM ItemGroupDef element.
filename  xmlinp  'C:\XML\ae.xml'; 1

proc cdisc model=odm read=xmlinp; 2
   odm odmversion="1.2" longnames=no; 3
   contents table="AE"; 4
run;

Output with LONGNAMES=NO


                                    Contents of CDISC ODM Table

Name                  AE
Libref                XMLINP
ODM Version           1.2
AsOfDateTime          2005-05-18T14:01:41
CreationDateTime      2005-05-18T14:01:41
SourceSystem          SAS 9.1
SourceSystemVersion   9.01.01M3D05172005

                                 Engine/Host Dependent Information

OID                   IG.AE
Name                  Adverse Events
SASDatasetName        AE
IsReferenceData
Repeating             Yes
Domain                AE
Origin
Role
Purpose
Comment               Some adverse events from this trial

                                 List of Variables and Attributes

                 #     Variable     Datatype  Length    SigDig   Format     Label

                 1     AECONTRT     string         1
                 2     AEACTTRT     string         1
                 3     AEOUT        string         1
                 4     AEREL        string         1
                 5     AESEV        string         1
                 6     AEENDT       date                         DATE
                 7     AEENYR       integer        4
                 8     AEENDAY      integer        2
                 9     AEENMON      integer        2
                10     AESTDT       date                         DATE
                11     AESTYR       integer        4
                12     AESTDAY      integer        2
                13     AESTMON      integer        2
                14     AETERM       string       100
                15     LINE_NO      integer        2
                16     F_STATUS     string         1
                17     SCTRY        string         4
                18     PNO          string        15
                19     TAREA        string         4

Program with LONGNAMES=YES

The following SAS program lists the attributes of a CDISC ODM SAS data set by using the ODM statement LONGNAMES=YES processing option:
  1. The FILENAME statement assigns the fileref XMLINP to the physical location of the input XML document (complete pathname, filename, and file extension).
  2. The PROC CDISC statement specifies CDISC ODM as the model and the fileref XMLINP, which references the physical location of the input XML document to be imported.
  3. The ODM statement specifies CDISC ODM version 1.2 and the LONGNAMES=YES processing option, which determines the following:
    • ODM name attributes are converted to SAS names that can be a maximum of 32 characters in length.
    • The SAS data set name, SAS variable names, and SAS format names are captured from the Name= attribute in the ODM ItemGroupDef, ItemDef, and CodeList elements.
  4. The CONTENTS statement writes the contents of the CDISC ODM SAS data set in the SAS log. Note that the CONTENTS statement must specify the name that is in the Name= attribute in the ODM ItemGroupDef element.
filename xmlinp 'C:\XML\ae.xml'; 1

proc cdisc model=odm 2 read=xmlinp;
   odm odmversion="1.2" longnames=yes; 3
   contents table="Adverse_Events"; 4
run;

Output with LONGNAMES=YES


                                    Contents of CDISC ODM Table

Name                  Adverse_Events
Libref                XMLINP
ODM Version           1.2
AsOfDateTime          2005-05-18T14:01:41
CreationDateTime      2005-05-18T14:01:41
SourceSystem          SAS 9.1
SourceSystemVersion   9.01.01M3D05172005

                                 Engine/Host Dependent Information

OID                   IG.AE
Name                  Adverse Events
SASDatasetName        AE
IsReferenceData
Repeating             Yes
Domain                AE
Origin
Role
Purpose
Comment               Some adverse events from this trial

                                 List of Variables and Attributes

     #     Variable                             Datatype  Length    SigDig   Format     Label

     1     Actions_taken__other                 string         1
     2     Actions_taken_re_study_drug          string         1
     3     Outcome                              string         1
     4     Relationship_to_study_drug           string         1
     5     Severity                             string         1
     6     Derived_Stop_Date                    date                         DATE
     7     Stop_Year___Enter_Four_Digit_Yea     integer        4
     8     Stop_Day___Enter_Two_Digits_01_3     integer        2
     9     Stop_Month___Enter_Two_Digits_01     integer        2
    10     Derived_Start_Date                   date                         DATE
    11     Start_Year___Enter_Four_Digit_Ye     integer        4
    12     Start_Day___Enter_Two_Digits_01_     integer        2
    13     Start_Month___Enter_Two_Digits_0     integer        2
    14     Conmed_Indication                    string       100
    15     Line_Number                          integer        2
    16     Record_status__5_levels__interna     string         1
    17     Country                              string         4
    18     Protocol_Number                      string        15
    19     Therapeutic_Area                     string         4