mirror of
https://github.com/sasjs/core.git
synced 2026-01-09 02:10:06 +00:00
fix: setting blank value to 0 in mf_isint()
This commit is contained in:
@@ -20,8 +20,11 @@
|
|||||||
|
|
||||||
%macro mf_isint(arg
|
%macro mf_isint(arg
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
/* remove minus sign if exists */
|
|
||||||
|
|
||||||
|
/* blank val is not an integer */
|
||||||
|
%if "&arg"="" %then %do;0%return;%end;
|
||||||
|
|
||||||
|
/* remove minus sign if exists */
|
||||||
%local val;
|
%local val;
|
||||||
%if "%substr(%str(&arg),1,1)"="-" %then %let val=%substr(%str(&arg),2);
|
%if "%substr(%str(&arg),1,1)"="-" %then %let val=%substr(%str(&arg),2);
|
||||||
%else %let val=&arg;
|
%else %let val=&arg;
|
||||||
|
|||||||
@@ -30,4 +30,12 @@
|
|||||||
),
|
),
|
||||||
desc=Checking mf_isint(-1),
|
desc=Checking mf_isint(-1),
|
||||||
outds=work.test_results
|
outds=work.test_results
|
||||||
|
)
|
||||||
|
|
||||||
|
%mp_assert(
|
||||||
|
iftrue=(
|
||||||
|
"%mf_isint()"="0"
|
||||||
|
),
|
||||||
|
desc=Checking mf_isint(),
|
||||||
|
outds=work.test_results
|
||||||
)
|
)
|
||||||
Reference in New Issue
Block a user