mirror of
https://github.com/sasjs/core.git
synced 2026-01-05 00:20:05 +00:00
feat: new mf_increment macro
This commit is contained in:
29
all.sas
29
all.sas
@@ -1598,6 +1598,35 @@ Usage:
|
||||
&engine
|
||||
|
||||
%mend mf_getxengine;
|
||||
/**
|
||||
@file
|
||||
@brief Increments a macro variable
|
||||
@details Useful outside of do-loops - will increment a macro variable every
|
||||
time it is called.
|
||||
|
||||
Example:
|
||||
|
||||
%let cnt=1;
|
||||
%put We have run %mf_increment(cnt) lines;
|
||||
%put Now we have run %mf_increment(cnt) lines;
|
||||
%put There are %mf_increment(cnt) lines in total;
|
||||
|
||||
@param [in] MACRO_NAME the name of the macro variable to increment
|
||||
@param [in] ITER= The amount to add or subtract to the macro
|
||||
|
||||
<h4> Related Files </h4>
|
||||
@li mf_increment.test.sas
|
||||
|
||||
**/
|
||||
|
||||
%macro mf_increment(macro_name,incr=1);
|
||||
|
||||
/* iterate the value */
|
||||
%let ¯o_name=%eval(&&¯o_name+&incr);
|
||||
/* return the value */
|
||||
&&¯o_name
|
||||
|
||||
%mend mf_increment;
|
||||
/**
|
||||
@file mf_isblank.sas
|
||||
@brief Checks whether a macro variable is empty (blank)
|
||||
|
||||
Reference in New Issue
Block a user