Previous Page | Next Page

CDISC Procedure Examples for CDISC ODM

Example: Listing a Directory with the DATASETS Statement


Overview

This example illustrates how to produce a directory listing in the SAS log of a CDISC ODM XML document. The output lists the name of the CDISC ODM SAS data set that is in the XML document named AE.XML. The output also lists the attributes of the XML document, such as ODM version and date of creation.

The example includes two different programs, which illustrate how the ODM statement LONGNAMES= processing option determines the sources of captured SAS names 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 produces a directory listing 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.

  4. The DATASETS statement produces a directory listing of the XML document in the SAS log.

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

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


Output with LONGNAMES=NO

Directory Listing of the AE.XML Document in the SAS Log

                                   Directory of CDISC ODM Tables

Libref                XMLINP
ODM Version           1.2
AsOfDateTime          2009-03-31T14:01:41
CreationDateTime      2009-03-31T14:01:41
SourceSystem          
SourceSystemVersion   

                                 #  Tablename

                                 1  AE

Program with LONGNAMES=YES

The following SAS program produces a directory listing 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 is captured from the Name= attribute in the ODM ItemGroupDef element.

  4. The DATASETS statement produces a directory listing of the XML document in the SAS log.

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

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


Output with LONGNAMES=YES

Directory Listing of the AE.XML Document in the SAS Log

                                   Directory of CDISC ODM Tables

Libref                XMLINP
ODM Version           1.2
AsOfDateTime          2009-03-31T14:01:41
CreationDateTime      2009-03-31T14:01:41
SourceSystem          
SourceSystemVersion   

                                 #  Tablename

                                 1  Adverse_Events

Previous Page | Next Page | Top of Page