CDISC Procedure Examples for CDISC ODM |
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.AE.
The example illustrates the default behavior for KeySet members written to the output SAS data set. All KeySet members that are in the input XML document are converted to SAS variables and values in the output SAS data set.
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:
The LIBNAME statement assigns the libref RESULTS to the physical location of the output SAS data set.
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.
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.
ODMMINIMUMKEYSET=NO in the ODM statement specifies that all KeySet members are written to the output SAS data set. This is the default setting for ODMMINIMUMKEYSET=.
The CLINICALDATA statement identifies the output SAS data set, which is RESULTS.AE, and specifies the CDISC ODM ItemGroupDef attribute that indicates where the data content in the XML document begins, which is AE.
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=no; 4 clinicaldata out=results.AE sasdatasetname="AE"; 5 run; proc contents data=results.AE varnum; 6 run; filename xmlinp clear; 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=NO, all KeySet members are written to the output SAS data set. These are the first 10 variables listed in the output. (The first two characters in resulting SAS variable names are two underscores.)
The maximum OID length, which is 100, is allocated to each KeySet member.
PROC CONTENTS Output for RESULTS.AE
The SAS System 1 The CONTENTS Procedure Data Set Name RESULTS.AE Observations 2 Member Type DATA Variables 29 Engine V9 Indexes 0 Created Monday, March 09, 2009 10:25:34 AM Observation Length 1208 Last Modified Monday, March 09, 2009 10:25:34 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 13 Obs in First Data Page 2 Number of Data Set Repairs 0 Filename C:\ae.sas7bdat Release Created 9.0202M0 Host Created XP_PRO The SAS System 10:23 Monday, March 9, 2009 2 The CONTENTS Procedure Variables in Creation Order # Variable Type Len Format Informat 1 __StudyOID Char 100 2 __MetaDataVersionOID Char 100 3 __SubjectKey Char 100 4 __StudyEventOID Char 100 5 __StudyEventRepeatKey Char 100 6 __FormOID Char 100 7 __FormRepeatKey Char 100 8 __ItemGroupOID Char 100 9 __ItemGroupRepeatKey Char 100 10 __TransactionType Char 100 11 TAREA Char 4 $TAREAF. 12 PNO Char 15 13 SCTRY Char 4 $SCTRYF. 14 F_STATUS Char 1 $F_STATU. 15 LINE_NO Num 8 2. 16 AETERM Char 100 17 AESTMON Num 8 2. 18 AESTDAY Num 8 2. 19 AESTYR Num 8 4. 20 AESTDT Num 8 DATE. 21 AEENMON Num 8 2. 22 AEENDAY Num 8 2. 23 AEENYR Num 8 4. 24 AEENDT Num 8 DATE. 25 AESEV Char 1 $AESEV. 26 AEREL Char 1 $AEREL. 27 AEOUT Char 1 $AEOUT. 28 AEACTTRT Char 1 $AEACTTR. 29 AECONTRT Char 1 $AECONTR.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.