1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 22:14:35 +00:00
This commit is contained in:
munja
2022-01-25 16:28:47 +01:00
parent 6e0fe0ff25
commit 90adf8dcdd
7 changed files with 18 additions and 22 deletions

View File

@@ -242,11 +242,11 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex
/** @endcond *//**
@file
@brief Checks if a variable exists in a data set.
@details Returns 0 if the variable does NOT exist, and return the position of
the var if it does.
Usage:
@details Returns 0 if the variable does NOT exist, and the position of the var
if it does.
Usage:
%put %mf_existvar(work.someds, somevar)
%put %mf_existvar(work.someds, somevar)
@param [in] libds 2 part dataset or view reference
@param [in] var variable name

View File

@@ -1,11 +1,11 @@
/**
@file
@brief Checks if a variable exists in a data set.
@details Returns 0 if the variable does NOT exist, and return the position of
the var if it does.
Usage:
@details Returns 0 if the variable does NOT exist, and the position of the var
if it does.
Usage:
%put %mf_existvar(work.someds, somevar)
%put %mf_existvar(work.someds, somevar)
@param [in] libds 2 part dataset or view reference
@param [in] var variable name

View File

@@ -37,8 +37,8 @@
desc=Check original returns 1
)
%mp_assert(
iftrue=(%mcf_init(t)=0),
desc=Check subset returns 0
iftrue=(%mcf_init(t)=1),
desc=Check subset returns 1
)
%mp_assert(
iftrue=(&syscc=0),

View File

@@ -10,13 +10,11 @@
%mp_assert(
iftrue=(%mf_existvar(sashelp.class,age)=1),
desc=Checking existing var exists,
outds=work.test_results
iftrue=(%mf_existvar(sashelp.class,age)>0),
desc=Checking existing var exists
)
%mp_assert(
iftrue=(%mf_existvar(sashelp.class,isjustanumber)=0),
desc=Checking non existing var does not exist,
outds=work.test_results
desc=Checking non existing var does not exist
)

View File

@@ -34,7 +34,7 @@ run;
%mp_applyformats(work.cols2)
%mp_assert(
iftrue=("&orig_fmt"=""),
iftrue=("&origfmt"=""),
desc=Check that formats were cleared,
outds=work.test_results
)

View File

@@ -41,7 +41,7 @@ run;
outquery=work.query,
mdebug=1
)
%mp_assert(iftrue=(&syscc>0),
%mp_assert(iftrue=(&syscc=0),
desc=Ensure macro runs without errors,
outds=work.test_results
)

View File

@@ -52,14 +52,13 @@ create table work.example2(
%mp_getpk(work,ds=example2,outds=test2)
data _null_;
set work.test1;
set work.test2;
call symputx('test2',pk_fields);
run;
%mp_assert(
iftrue=("&test2"="TX_FROM DD_TYPE"),
desc=mp_getpk gets unique constraint with NOT NULL in correct order,
outds=work.test_results
desc=mp_getpk gets unique constraint with NOT NULL in correct order
)
/* unique key without NOT NULL NOT captured */
@@ -71,8 +70,7 @@ create table work.example3(
DD_SHORTDESC char(256),
constraint unq1 unique(tx_from, dd_type),
constraint unq2 unique(tx_from, dd_type, dd_source),
constraint nnn not null(tx_from),
constraint nnnn not null(dd_type)
constraint nnn not null(tx_from)
);
%mp_getpk(work,ds=example3,outds=test3)