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:
@@ -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
|
||||
**/
|
||||
|
||||
@@ -92,6 +92,7 @@ data &ds2;
|
||||
%end;
|
||||
output;
|
||||
end;
|
||||
stop;
|
||||
run;
|
||||
proc sort data=&ds2 nodupkey;
|
||||
by &pk_fields;
|
||||
|
||||
22
tests/crossplatform/mf_existvar.test.sas
Normal file
22
tests/crossplatform/mf_existvar.test.sas
Normal 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
|
||||
)
|
||||
Reference in New Issue
Block a user