1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-06 17:10:05 +00:00

fix: refactored mp_getconstraints due to apparent bug in dictionary.table_constraints. Added test. Closes #83

This commit is contained in:
Allan Bowe
2021-10-01 13:04:26 +01:00
parent cb0ddfb61c
commit 35ddccaa16
4 changed files with 43 additions and 5 deletions

View File

@@ -0,0 +1,29 @@
/**
@file
@brief Testing mp_getconstraints.sas macro
<h4> SAS Macros </h4>
@li mf_nobs.sas
@li mp_getconstraints.sas
@li mp_assert.sas
**/
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)
%mp_assert(
iftrue=(%mf_nobs(work.constraints)=6),
desc=Output table work.constraints created with correct number of records,
outds=work.test_results
)