SPDSUSAV Macro Variable

Specifies whether to save rows with non-unique (rejected) keys to a separate SAS table.

Valid in: SPD Server
Default: NO
Restriction: Assignments for macro variables with character input (for example, YES | NO | BINARY arguments) must be entered in uppercase (capitalized).
Interactions: Corresponding table option is UNIQUESAVE=.
Use in conjunction with the SPDSUSDS reserved macro variable.
Note: This macro variable has no effect when the SYNCADD= table option is set to YES.

Syntax

SPDSUSAV=YES | NO | REP

Required Arguments

YES

writes rejected rows to a separate, system-created table. This table can be accessed by a reference to the macro variable SPDSUSDS.

NO

ignores duplicate rows rejected by an Append or Insert operation.

REP

replaces the current row in the master table with the duplicate row from the Insert or Append operation, instead of saving the rows to a separate table. This setting is useful when updating a master table from a transaction table, where the two tables share identical column structures.

Details

When the SPDSAUNQ macro variable is set to NO (the default value), rows with duplicate index values are rejected unless you specify UNIQUESAVE=YES (or set the SPDSUSAV macro variable to YES). By using UNIQUESAVE=YES, you can save rejected values to a hidden system table. When UNIQUESAVE=YES, a NOTE on the log identifies the name of the table. To access that table you can either cut-and-paste from the log, or refer to that table by using the reserved macro variable SPDSUSDS.

Example

Append several tables to the EMPLOYEE table, using employee number as a unique key. The appended tables should not have rows with duplicate employee numbers.
At the beginning of the job, configure SPD Server to write any rejected (identical) employee number rows to a SAS table. The macro variable SPDSUSDS holds the name of the SAS table for the rejected keys.
%let SPDSUSAV=YES 
Use a %PUT statement to display the name of the table, and then print the table.
%put Set the macro variable spdsusds to &spdsusds;

title 'Duplicate (nonunique) employee numbers found in
       EMPS';
proc print data=&spdsusds run;

See Also

SPD Server macro variables:
Last updated: February 8, 2017