Metadata Management Macros

Overview

Metadata management macros enable you to customize the metadata of any data standard that is used by the SAS Clinical Standards Toolkit. The macros provide a mechanism, the transaction log data set, to track changes.
The metadata management macros included in SAS Clinical Standards Toolkit are shown in this table.
Metadata Management Macros
Macro
Description
%CSTUTILADDDATASET
Adds a data set.
%CSTUTILADDDSCOLUMN
Adds a column to a data set.
%CSTUTILAPPENDMETADATARECORDS
Adds records to a data set by either merging or appending.
%CSTUTILDELETEDSCOLUMN
Removes a column from a data set.
%CSTUTILDELETEMETADATARECORDS
Removes a record from a data set.
%CSTUTILMODIFYCOLUMNATTRIBUTE
Changes an attribute of a column in a data set.
%CSTUTILUPDATEMETADATARECORDS
Modifies a record in a data set.
%CSTUTILREGISTERCTSUBTYPE
Enables the registration of a new set of controlled terminology
Note: Information about all macros is in the SAS Clinical Standards Toolkit: Macro API Documentation.

Test Mode

To verify changes before they are written to a permanent data set, all of the metadata management macros can be run in test mode except as noted below.
Write access permission is required to the target permanent data set. Write access permission is checked as an initial step in the metadata management macros. If Write access permission is not available, the macro does complete successfully, even in test mode.
Note: cstutiladddataset and cstutiladddscolumn cannot be run in test mode.
All test mode output is generated in the SAS Work directory, and the transaction log data set is not updated. After you have verified that the changes are correct, run the macro again with test mode disabled, and the permanent data set is modified.

Problem Reporting

There are two ways to report problems: in the _cstResults data set or in the SAS log file.
Because a full SAS Clinical Standards Toolkit environment (one in which all global macro variables are defined) is not required for a macro to run, a macro reports problems in one of two locations, in this order:
  1. If the _cstResultsDS macro variable and the data set specified by the value of _cstResultsDS exist, problems are reported in the _cstResults data set.
  2. If the _cstResultsDS macro variable or the data set specified by the value of _cstResultsDS does not exist, problems are reported in the SAS log file.
Note: After the first submission of a macro, a work._cstresults data set might exist and the _cstResultsDS macro variable might specify the data set. Subsequent macro submissions report problems to the work._cstresults data set instead of to the SAS log file. This happens because some of the macros call other internal macros that generate a work._cstresults data set. This data set is then used by subsequent macros for problem reporting.
If the SAS log file is used to report problems, the SAS Clinical Standards Toolkit distinguishes problems from normal SAS log messages by displaying a message similar to this one:
[CSTLOGMESSAGE.CSTUTILDELETEDSCOLUMN] ERROR: results.transactionlog could not be found.