@sasjs/core 4.32.15 → 4.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/mf_increment.sas +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Increments a macro variable
|
|
4
|
+
@details Useful outside of do-loops - will increment a macro variable every
|
|
5
|
+
time it is called.
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
|
|
9
|
+
%let cnt=1;
|
|
10
|
+
%put We have run %mf_increment(cnt) lines;
|
|
11
|
+
%put Now we have run %mf_increment(cnt) lines;
|
|
12
|
+
%put There are %mf_increment(cnt) lines in total;
|
|
13
|
+
|
|
14
|
+
@param [in] MACRO_NAME the name of the macro variable to increment
|
|
15
|
+
@param [in] ITER= The amount to add or subtract to the macro
|
|
16
|
+
|
|
17
|
+
<h4> Related Files </h4>
|
|
18
|
+
@li mf_increment.test.sas
|
|
19
|
+
|
|
20
|
+
**/
|
|
21
|
+
|
|
22
|
+
%macro mf_increment(macro_name,incr=1);
|
|
23
|
+
|
|
24
|
+
/* iterate the value */
|
|
25
|
+
%let ¯o_name=%eval(&&¯o_name+&incr);
|
|
26
|
+
/* return the value */
|
|
27
|
+
&&¯o_name
|
|
28
|
+
|
|
29
|
+
%mend mf_increment;
|
package/package.json
CHANGED