Macros for SAS Application Developers
https://github.com/sasjs/core
mp_getconstraints.sas File Reference

Get constraint details at column level. More...

Go to the source code of this file.

Detailed Description

Useful for capturing constraints before they are dropped / reapplied during an update.

proc sql;
create table work.example(
  TX_FROM float format=datetime19.,
  DD_TYPE char(16),
  DD_SOURCE char(2048),
  DD_SHORTDESC char(256),
  constraint pk primary key(tx_from, dd_type,dd_source),
  constraint unq unique(tx_from, dd_type),
  constraint nnn not null(DD_SHORTDESC)
);

%mp_getconstraints(lib=work,ds=example,outds=work.constraints)
Parameters
[in]lib=(WORK) The target library
[in]ds=The target dataset. Leave blank (default) for all datasets.
[in]mdebug=(0) Set to 1 to preserve temp tables, print var values etc
[out]outds=(mp_getconstraints) the output dataset

SAS Macros

Version
9.2
Author
Allan Bowe

Definition in file mp_getconstraints.sas.