Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_getconstraints.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mp_getconstraints.sas macro
4
5 <h4> SAS Macros </h4>
6 @li mf_nobs.sas
7 @li mp_getconstraints.sas
8 @li mp_assert.sas
9
10**/
11
12proc sql;
13create table work.example(
14 TX_FROM float format=datetime19.,
15 DD_TYPE char(16),
16 DD_SOURCE char(2048),
17 DD_SHORTDESC char(256),
18 constraint pk primary key(tx_from, dd_type,dd_source),
19 constraint unq unique(tx_from, dd_type),
20 constraint nnn not null(DD_SHORTDESC)
21);
22
23%mp_getconstraints(lib=work,ds=example,outds=work.constraints)
24
25%mp_assert(
26 iftrue=(%mf_nobs(work.constraints)=6),
27 desc=Output table work.constraints created with correct number of records,
28 outds=work.test_results
29)