Implementing Duplicate-Data-Checking Macros

About Implementing Duplicate-Data-Checking Macros

When a job is generated and deployed from a SAS IT Resource Management client, the duplicate-data property becomes a SAS macro variable. In this appendix, any reference to the duplicate-data or DUPMODE property of a staging transformation can also be interpreted to refer to the duplicate-data-checking macro variable.
Note: If you edit the generated source code to modify the mode for duplicate-data checking, then your changes to the code will be lost if the job is regenerated or redeployed. Although you can save the functionality of the source code to the local file system, the original source code is preserved and the mode for duplicate-data checking is not updated in the SAS Metadata Repository entries.
To implement duplicate-data-checking macros, you must first set up processing without duplicate-data checking. Afterward, you can choose whether to implement duplicate-data checking by specifying parameters in the staging transformation.

Steps to Implement Duplicate-Data-Checking Macros

The steps and considerations that are required for implementing duplicate-data checking vary according to whether you are using a staging transformation for a supported adapter or if you are using user-written staging code.
If you are using a staging transformation for a supported adapter, perform the following steps:
  1. Double-click to open the job that contains the staging transformation for the adapter that you want to work with. Right-click the staging transformation, and from the drop-down list, select Properties. On the Properties dialog box, select the Staging Parameters tab. This tab lists the parameters that apply to the staging transformation.
  2. Specify the Duplicate checking option as FORCE, DISCARD, or TERMINATE. The staging transformation arranges for the %RMDUPINT, %RMDUPDSN, %RMDUPCHK, and %RMDUPUPD macro calls to be invoked accordingly in the adapter-specific staging code.
    The following list describes the active parameters for duplicate-data checking. The corresponding macro call values are included in parentheses.
    • FORCE
      If the %RMDUPCHK macro specifies FORCE=YES, “duplicate” data is allowed into the IT data mart. The “duplicate” data should be data that appears to the macros to be duplicate, but is data that you want to process anyway. For example, perhaps the “duplicate” data was processed into the IT data mart before but was accidentally deleted. Or the “duplicate” data is being processed into a table that was not in use in the IT data mart when the data was processed earlier.
    • TERMINATE
      If the %RMDUPCHK macro specifies TERM=YES, processing terminates if duplicate data is encountered.
    • DISCARD
      If the %RMDUPCHK macro does not specify FORCE=YES and does not specify TERMINATE=YES, duplicate data is discarded.
If you are using user-written staging code, perform the following steps:
  1. Place the calls to the %RMDUPINT, %RMDUPDSN, %RMDUPCHK, and %RMUPUPD macros in the staging code.
  2. Set the values of the FORCE= and TERM= macros in the call to %RMDUPCHK. This step is required for the code to process.
  3. Click OK to close the Properties dialog box for the staging transformation.

Steps to Prevent Implementation of Duplicate-Data-Checking Macros

If you are using a staging transformation for a supported adapter and you do not want to implement duplicate-data checking, perform the following steps:
  1. Access the Staging Parameters tab for the staging transformation.
  2. Specify the Duplicate checking option as INACTIVE.