@sasjs/core 4.32.14 → 4.33.1
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/README.md +1 -0
- package/base/mf_increment.sas +29 -0
- package/base/mp_getconstraints.sas +4 -1
- package/base/mp_getddl.sas +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -237,6 +237,7 @@ If you find this library useful, please leave a [star](https://github.com/sasjs/
|
|
|
237
237
|
|
|
238
238
|
The following repositories are also worth checking out:
|
|
239
239
|
|
|
240
|
+
* [SASJedi/sas-macros](https://github.com/SASJedi/sas-macros)
|
|
240
241
|
* [chris-swenson/sasmacros](https://github.com/chris-swenson/sasmacros)
|
|
241
242
|
* [greg-wotton/sas-programs](https://github.com/greg-wootton/sas-programs)
|
|
242
243
|
* [KatjaGlassConsulting/SMILE-SmartSASMacros](https://github.com/KatjaGlassConsulting/SMILE-SmartSASMacros)
|
|
@@ -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;
|
|
@@ -94,8 +94,11 @@ create table &outds as
|
|
|
94
94
|
/**
|
|
95
95
|
* We cannot apply this clause to the underlying dictionary table. See:
|
|
96
96
|
* https://communities.sas.com/t5/SAS-Programming/Unexpected-Where-Clause-behaviour-in-dictionary-TABLE/m-p/771554#M244867
|
|
97
|
+
* cannot use`where calculated libref="&lib"` either as it will STILL execute
|
|
98
|
+
* all the underlying constraint queries, causing exception errors in some
|
|
99
|
+
* cases: https://github.com/sasjs/core/issues/283
|
|
97
100
|
*/
|
|
98
|
-
where
|
|
101
|
+
where a.TABLE_CATALOG="&lib"
|
|
99
102
|
%if "&ds" ne "" %then %do;
|
|
100
103
|
and upcase(a.TABLE_NAME)="&ds"
|
|
101
104
|
and upcase(b.TABLE_NAME)="&ds"
|
package/base/mp_getddl.sas
CHANGED
|
@@ -130,13 +130,13 @@ run;
|
|
|
130
130
|
|
|
131
131
|
%local x curds;
|
|
132
132
|
%if &flavour=SAS %then %do;
|
|
133
|
-
data _null_;
|
|
134
|
-
file &fref mod;
|
|
135
|
-
put "/* SAS Flavour DDL for %upcase(&libref).&curds */";
|
|
136
|
-
put "proc sql;";
|
|
137
|
-
run;
|
|
138
133
|
%do x=1 %to %sysfunc(countw(&dsnlist));
|
|
139
134
|
%let curds=%scan(&dsnlist,&x);
|
|
135
|
+
data _null_;
|
|
136
|
+
file &fref mod;
|
|
137
|
+
put "/* SAS Flavour DDL for %upcase(&libref).&curds */";
|
|
138
|
+
put "proc sql;";
|
|
139
|
+
run;
|
|
140
140
|
data _null_;
|
|
141
141
|
file &fref mod;
|
|
142
142
|
length lab $1024 typ $20;
|
package/package.json
CHANGED