Creating the Define.xml file from Customized Data

Overview: Creating the Define.xml file from Customized Data

The CDISC-Define Creation transformation operates on saved data so that SAS programmers who are familiar with the table model representation for CRT-DDS can add customizations to a define.xml file. This is a two-step process:
  1. Insert custom study metadata into the saved CRT-DDS tables.
  2. Generate a customized define.xml file from these updated tables.
Here is example code that creates a define.xml file from saved data. Edit this example code to point to the location of the customized tables.
%let SASCrtddsTables = %nrquote(\\myCDIServer\mydatatables);
%let DefPath = %nrquote(\\myCDIServer\myDefineLocation);
%let DefFile = %nrquote(define.xml);
%cst_setStandardProperties(_cstStandard=CST-FRAMEWORK,_cstSubType=initialize);
%cst_setStandardProperties(_cstStandard=CDISC-CRTDDS,_cstSubType=initialize);
%let workPath=%sysfunc(pathname(work));
%let _cstSASRefs=work.sasreferences;
%let _cstSASRefsLoc=&workpath;
%let _cstSASRefsName=sasreferences;
%let _cstResultsds=crtdds_results;
%cst_createdsfromtemplate(_cstStandard=CST-FRAMEWORK, _cstType=control,_cstSubType=reference, _cstOutputDS=work.sasreferences);
%LET _CSTSTANDARD=CDISC-CRTDDS;
%LET _CSTSTANDARDVERSION=1.0;
proc sql;
insert into work.sasreferences
values ("CST-FRAMEWORK" "1.2" "messages" "" "messages" "libref" "input" "dataset" 
                "N" "" "" 1 "" "")
values ("&_cstStandard" "&_cstStandardVersion" "messages" "" "crtmsg" "libref" "input" "dataset" 
                "N" "" "" 2 "" "")
values ("&_cstStandard" "&_cstStandardVersion" "autocall" "" "auto1" "fileref" "input" "folder" "
                N" "" "" 1 "" "")
values ("&_cstStandard" "&_cstStandardVersion" "control" "reference" "control" "libref" "both" "dataset" 
                "Y" "" "&workpath" . "sasreferences" "")
values ("&_cstStandard" "&_cstStandardVersion" "sourcedata" "" "srcdata" "libref" "input" "folder" 
                "N" "" "&SASCrtddsTables" . "" "")
values ("&_cstStandard" "&_cstStandardVersion" "externalxml" "xml" "extxml" "fileref" "output" "file" 
                "Y" "" "&defpath" . "&deffile" "")
values ("&_cstStandard" "&_cstStandardVersion" "referencexml" "stylesheet" "xslt01" "fileref" "output" "file" "
                Y" "" "" . "" "")
;
quit;
%let _cstReallocateSasrefs=1;
%cstutil_allocatesasreferences;
%crtdds_write(_cstCreateDisplayStyleSheet=1,_cstResultsOverrideDS=&_cstResultsDS);
In the example code, edit SASCrtddsTables to specify the location where the saved data sets exist, and edit DefPath to specify the location to write the resulting define.xml file.
Note: If you are viewing an electronic version of this document, you can cut and paste the example code.

Create a Define.xml File Using Customized Data

To create a define.xml file using customized data, perform the following steps:
  1. Create an empty job.
    For detailed information about creating an empty job, see the SAS Data Integration Studio: User's Guide or the SAS Data Integration Studio online Help.
  2. In the Transformations tree, expand Data, and then drag and drop User Written Code onto the diagram.
  3. In the diagram, double-click User Written.
    The User Written Properties dialog box appears.
  4. Click the Code tab.
  5. From the Code generation mode drop-down list, select All user written.
  6. In the code editor, enter the code to create the define.xml file.
  7. Click OK and then click Run.
  8. From the Windows Start menu, select Run, and then enter the location where the data sets are located (for example, \\myCDIServer\mydata\crtdds_tables).
  9. Open the define.xml file to view the customizations that you created.