Creating and Modifying Files

Should I Modify SAS Clinical Standards Toolkit Files Supplied by SAS If I Want to Test Changes or Make Permanent Changes to Any of Those Files?

A best practice recommendation is that you do not (permanently) modify framework autocall macros or global standards library files. Instead, modify copies of the files. This allows seamless updates to those files provided by SAS without overwriting or losing your changes.
Note: The SAS Clinical Standards Toolkit provides an internal backup of the global standards library files for specific standards provided by SAS in the sample study library directory subfolders for a specific standard.

How Do I Modify a Sample Driver Program to Point to My Own Study Data?

Each sample driver program sets a &studyRootPath macro variable to point to the root path of the sample study SAS supplies for each standard. This macro enables you to point to your own study root path by resetting the value of this macro variable. You might prefer to use explicit paths in your SASReferences data set and not use &studyRootPath at all.
The sample drivers assume a study folder hierarchy like that of the sample study, but this hierarchy is not required. If you have another organization for your study, you might need to make other changes to the paths specified in your driver program.

How Do I Create the Required Study Metadata?

Each supported standard might define study metadata differently. The SAS representation of the 32 standard CDISC SDTM 3.1.2 domains differs from the SAS representation of the three types of tables supported in CDISC ADaM 2.1.
Most users have metadata about their studies in some form and file format other than that used by the SAS Clinical Standards Toolkit. You have to convert or map some of that metadata into the source_study, source_tables, and source_columns format specified in the sample study metadata folder (such as the sample study library directory/cdisc-adam-2.1-1.6/sascstdemodata/metadata directory). Some standards provide sample code that supports this task. For CDISC ADaM, look at the create_sourcemetadata.sas sample driver program as an example.
Note: The structure of the source metadata corresponds to the reference metadata for each standard as defined in the global standards library (such as global standards library directory/standards/cdisc-adam-2.1-1.6/metadata reference_tables and reference_columns data sets).
Note: SAS Clinical Standards Toolkit 1.6 has an initial implementation that supports the creation of Define-XML 2.0 files. The Define-XML 2.0 standard has different metadata needs than the CRT-DDS 1.0.0 standard. The previous paragraphs of this question describe metadata used for the creation of CRT-DDS 1.0 define.xml files. For more information about the creation of Define-XML 2.0 define.xml files, see Chapter 9, “XML-Based Standards,” in the SAS Clinical Standards Toolkit: User's Guide.

Can I Modify the Check Metadata Columns tableScope and columnScope to Match My Study?

Yes. The initial values are based on the sample data associated with each standard. Your study data almost certainly differs. For CDISC SDTM and CDISC ADaM, your domains and analysis data sets reflect your study protocol. Some checks might not apply to some of your domains because your implementation of that domain might deviate from other domains from the same class (such as Findings).
Be aware that tableScope and columnScope wildcarding is a convenience. Instead, you can explicitly reference a specific table or column in any check invocation.
See “Validation Check Metadata: Validation Master” in Chapter 7, “Compliance Assessment Against a Reference Standard,” in the SAS Clinical Standards Toolkit: User's Guide.

Can I Add My Own New Validation Checks for SDTM or ADaM?

Yes. You can add checks to any SAS Clinical Standards Toolkit standard that supports validation. Each check is defined as a set of metadata (in the validation_master data set found in the global standards library directory/standards/standard/validation/control directory) and a message to be used when an error is detected (in the messages data set found in the global standards library directory/standards/standard/messages directory).
For each new check, you must create the check metadata to conform to the validation_master template and an associated message to conform to the messages data set metadata structure.
For more information about check metadata and the available SAS Clinical Standards Toolkit validation check macros, see Chapter 8, “Internal Validation,” in the SAS Clinical Standards Toolkit: User's Guide.

How Do I Use My Own Controlled Terminology?

The SAS Clinical Standards Toolkit permits the use of any set of controlled terminology or any coding dictionaries. Generally, controlled terminology is defined to the SAS Clinical Standards Toolkit as SAS format catalogs and coding dictionaries as SAS data sets. Either format is valid.
The SASReferences data set is used to document these format catalogs and coding dictionaries and to facilitate run-time references to these reference input sources. In the SAS Clinical Standards Toolkit sample drivers, a SASReferences type=fmtsearch record points to each SAS format catalog (and allows specification of a reference order for like-named formats), and a type=referencecterm record points to each specific coding dictionary to be referenced. The format search path is set with the call to the cstutil_processsetup macro.
For more information about using controlled terminology in validation processes, see “Special Topic: Using Alternative Controlled Terminologies” in Chapter 7, “Compliance Assessment Against a Reference Standard,” in the SAS Clinical Standards Toolkit: User's Guide.

How Do I Point to My Company’s Version of MedDRA?

The sample SDTM SASReferences data set offers an example of referencing the MedDRA dictionary. The type=referencecterm record points to a folder (which can be anywhere) that can contain a MedDRA data set (using any name).
The SDTM validation check (SDTM0451) provided by SAS that compares AEDECOD to MedDRA preferred terms expects that the MedDRA data set contains the column PT_NAME. If your data set uses other column names, see If I Disagree with or Choose to Modify the Codelogic of a Specific Validation Check, What Needs to Be Done?.
See “Building a Validation Process” in Chapter 7, “Compliance Assessment Against a Reference Standard,” in the SAS Clinical Standards Toolkit: User's Guide.

How Do I Use My Own Style Sheet with a define.xml File Generated by SAS Clinical Standards Toolkit?

The SAS Clinical Standards Toolkit uses the crtdds_write macro (for CRT-DDS 1.0.0) or the define_write macro (for Define-XML 2.0) to create a define.xml file. This macro has the optional parameter _cstCreateDisplayStyleSheet that determines two things:
  • whether the macro creates a style sheet in the same folder as the output define.xml file
  • whether the macro creates a reference to that style sheet in the define.xml file
If you set this macro parameter to 1, the macro looks in the provided SASReferences file for a record with a type/subtype of referencexml/stylesheet and uses that file.
By default, the crtdds_write macro and the define_write macro create a style sheet reference in the define.xml file and copy a style sheet in the same folder as the define.xml file. This default style sheet, define1-0-0.xsl (for CRT-DDS 1.0.0) or define2-0-0.xsl (for Define-XML 2.0), is copied from the global standards library directory/standards/cdisc-crtdds-1.0/stylesheet directory (for CRT-DDS 1.0.0) or the global standards library directory/standards/cdisc-definexml-2.0/stylesheet directory (for Define-XML 2.0). The default style sheet is identical to the style sheet that was originally made available by CDISC as part of the original release of the define.xml file.
See “Writing XML Files” in Chapter 9, “XML-Based Standards,” in the SAS Clinical Standards Toolkit: User's Guide.

Can I Associate a Style Sheet with an ODM XML File Generated by the SAS Clinical Standards Toolkit?

Although it is not common to associate a style sheet with an ODM XML file, the SAS Clinical Standards Toolkit allows it. To do this, you must call the macro odm_write with macro parameter cstCreateDisplayStyleSheet=1 and add a record to the SASReferences file with type/subtype of referencexml/stylesheet pointing to the style sheet to be used.
Note: SAS does not supply a default style sheet for ODM.
See the online macro API reference material about ODM.

How Do I Add Supplemental Data (Not Directly Derivable from Other Standards Such as CDISC SDTM) Used to Create a define.xml File?

When the SAS Clinical Standards Toolkit creates a CRT-DDS 1.0 define.xml file, it converts the information from a SAS data set representation of the CRT-DDS model into XML. For CDISC CRT-DDS 1.0, this means that 39 data sets (such as itemdefs) are the source for creating the define.xml element and attribute structure. The content of these 39 data sets can be derived in part from other standards (such as CDISC SDTM).
You can directly maintain these 39 data sets so that you can add data that needs to be part of the define.xml. To maintain these 39 data sets, you must be familiar with the structure of these data sets and the relationships among these data sets. For example, to add Value Level Metadata to the define.xml file, add rows to four data sets: itemdefs, valuelists, valuelistitemrefs, and itemvaluelistrefs.
See the online API reference material about CRT-DDS 1.0 SAS data sets and “Writing XML Files” in Chapter 9, “XML-Based Standards,” in the SAS Clinical Standards Toolkit: User's Guide.

How Do I Create the Data Sets That Are Used to Create an ODM XML File?

When the SAS Clinical Standards Toolkit creates an ODM XML file, it converts the information from a SAS data set representation of the ODM model into XML. For CDISC ODM 1.3.1, this means that 76 data sets (such as itemdefs) are the source for creating the ODM XML element and attribute structure.
You can directly maintain these 76 data sets so that you can add data that needs to be part of the ODM XML file. To maintain these 76 data sets, you must be familiar with the structure of these data sets and the relationships among these data sets.
Normally, you would not use SAS to create an ODM XML file because it is assumed that there is a workflow in which a data collection and management system exports metadata definitions and data content in the form of a transactional or snapshot ODM XML file. When SAS is used to create an ODM XML file, the initial SAS representation of the ODM model can be created by using one of these methods:
  • Call %cst_createTablesForDataStandard(_cstStandard=CDISC-ODM, _cstStandardVersion=1.3.1, _cstOutputLibrary=work); to build zero-observation SAS data sets.
  • Call the %odm_read macro to import an ODM XML file that can serve as a template for the creation of the SAS representation of the ODM XML data model.
See “Writing XML Files” in Chapter 9, “XML-Based Standards,” in the SAS Clinical Standards Toolkit: User's Guide.

How Do I Modify the autocall Path to Point to My Own Macros?

The SAS Clinical Standards Toolkit autocall path is set by default to SASAUTOS, which includes the SAS Clinical Standards Toolkit framework macros found in the !SASROOT\cstframework\sasmacro directory (Microsoft Windows) or in the !SASROOT/sasautos directory (UNIX).
A macro library is defined for each standard in the global standards library. (See Where Do the Framework and Standard-Specific Macros Reside?.) In the SASReferences data set, one or more records with type=autocall can be used to reset the SAS autocall path, where the order column specifies the order each macro library is to be referenced. You can use the same strategy to reference any user-defined macro libraries, even if those libraries are not associated with a specific standard.
See Chapter 6, “SASReferences File,” in the SAS Clinical Standards Toolkit: User's Guide.

Do I Have to Create and Use a SASReferences Data Set for Any SAS Clinical Standards Toolkit Process That I Run?

No. However, the SAS Clinical Standards Toolkit has adopted this method to define and document the input and output file and library references, to build the macro autocall, and to format search paths for each SAS Clinical Standards Toolkit process. Although you can perform all library and file allocations and set SAS system options yourself, it is highly recommended that you use the SASReferences approach.
See Chapter 6, “SASReferences File,” in the SAS Clinical Standards Toolkit: User's Guide.

Do I Need to Use Properties Files to Define My Own Global Macro Variables?

No. However, doing so standardizes your approach to creating and documenting global macro variables.
Within the SAS Clinical Standards Toolkit, either of these two methods is always used to process properties files:
  • adding a type=properties record to the SASReferences data set, which is then processed in the routine call to cstutil_processsetup
  • directly calling cst_setproperties
See “Properties” in Chapter 3, “Metadata File Descriptions,” in the SAS Clinical Standards Toolkit: User's Guide.