1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-15 16:14:36 +00:00
Files
core/tests/base/mf_existvar.test.sas
allan 32dd057e83 fix: avoid open file handle when the variable to find is not provided (in mf_existvar)
Includes a test that was failing and is now passing
2023-04-05 15:29:53 +01:00

40 lines
637 B
SAS

/**
@file
@brief Testing mf_existvar macro
<h4> SAS Macros </h4>
@li mf_existvar.sas
@li mp_assert.sas
**/
%mp_assert(
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
)
data work.lockcheck;
a=1;
output;
stop;
run;
%mp_assert(
iftrue=(%mf_existvar(work.lockcheck,)=0),
desc=Checking non-provided var does not exist
)
proc sql;
update work.lockcheck set a=2;
%mp_assert(
iftrue=(&syscc=0),
desc=Checking the lock was released,
outds=work.test_results
)