1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

chore: updating header, adding stop statement in mp_makedata(), writing test for mf_existvar()

This commit is contained in:
munja
2021-12-23 19:29:37 +00:00
parent 66b0c9e77e
commit 6c6b55dcea
3 changed files with 29 additions and 2 deletions

View File

@@ -7,8 +7,12 @@
%put %mf_existvar(work.someds, somevar)
@param libds (positional) - 2 part dataset or view reference
@param var (positional) - variable name
@param [in] libds 2 part dataset or view reference
@param [in] var variable name
<h4> Related Macros </h4>
@li mf_existvar.test.sas
@version 9.2
@author Allan Bowe
**/

View File

@@ -92,6 +92,7 @@ data &ds2;
%end;
output;
end;
stop;
run;
proc sort data=&ds2 nodupkey;
by &pk_fields;

View File

@@ -0,0 +1,22 @@
/**
@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)=1),
desc=Checking existing var exists,
outds=work.test_results
)
%mp_assert(
iftrue=(%mf_existvar(sashelp.class,isjustanumber)=0),
desc=Checking non existing var does not exist,
outds=work.test_results
)