diff --git a/all.sas b/all.sas index 7205750..4e9f2d3 100644 --- a/all.sas +++ b/all.sas @@ -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 diff --git a/base/mf_existvar.sas b/base/mf_existvar.sas index 4ca518d..368cd97 100755 --- a/base/mf_existvar.sas +++ b/base/mf_existvar.sas @@ -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 diff --git a/tests/crossplatform/mcf_init.test.sas b/tests/crossplatform/mcf_init.test.sas index e01ef56..ecf1df2 100644 --- a/tests/crossplatform/mcf_init.test.sas +++ b/tests/crossplatform/mcf_init.test.sas @@ -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), diff --git a/tests/crossplatform/mf_existvar.test.sas b/tests/crossplatform/mf_existvar.test.sas index efb6ca9..18e5dff 100644 --- a/tests/crossplatform/mf_existvar.test.sas +++ b/tests/crossplatform/mf_existvar.test.sas @@ -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 ) \ No newline at end of file diff --git a/tests/crossplatform/mp_applyformats.test.sas b/tests/crossplatform/mp_applyformats.test.sas index d6a5fdf..154f3f8 100644 --- a/tests/crossplatform/mp_applyformats.test.sas +++ b/tests/crossplatform/mp_applyformats.test.sas @@ -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 ) diff --git a/tests/crossplatform/mp_filterstore.test.sas b/tests/crossplatform/mp_filterstore.test.sas index 370f824..d8a867c 100644 --- a/tests/crossplatform/mp_filterstore.test.sas +++ b/tests/crossplatform/mp_filterstore.test.sas @@ -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 ) diff --git a/tests/crossplatform/mp_getpk.test.sas b/tests/crossplatform/mp_getpk.test.sas index 2459597..0813ca8 100644 --- a/tests/crossplatform/mp_getpk.test.sas +++ b/tests/crossplatform/mp_getpk.test.sas @@ -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)