@sasjs/core 4.27.3 → 4.27.6
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/mp_jsonout.sas
CHANGED
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
%do i=1 %to &numcols;
|
|
232
232
|
%if &i>1 %then "," ;
|
|
233
233
|
%if &action=OBJ %then """&&name&i"":" ;
|
|
234
|
-
&&name&i
|
|
234
|
+
"&&name&i"n /* name literal for reserved variable names */
|
|
235
235
|
%end;
|
|
236
236
|
%if &action=ARR %then "]" ; %else "}" ; ;
|
|
237
237
|
/* now write the long strings to _webout 1 byte at a time */
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
@file
|
|
3
|
-
@brief Create
|
|
2
|
+
@file
|
|
3
|
+
@brief Create an empty dataset from a metadata definition
|
|
4
4
|
@details This macro was built to support viewing empty tables in
|
|
5
|
-
|
|
6
|
-
contacting the author (Allan Bowe).
|
|
5
|
+
https://datacontroller.io
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
The table can be retrieved using LIBRARY.DATASET reference, or directly
|
|
8
|
+
using the metadata URI.
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
The dataset is written to the WORK library.
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
Usage:
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
%mm_createdataset(libds=metlib.some_dataset)
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
or
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
%mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
|
|
20
19
|
|
|
21
20
|
<h4> SAS Macros </h4>
|
|
22
21
|
@li mm_getlibs.sas
|
|
@@ -26,9 +25,9 @@
|
|
|
26
25
|
@param libds= library.dataset metadata source. Note - table names in metadata
|
|
27
26
|
can be longer than 32 chars (just fyi, not an issue here)
|
|
28
27
|
@param tableuri= Metadata URI of the table to be created
|
|
29
|
-
@param outds= The dataset to create
|
|
30
|
-
|
|
31
|
-
@param mdebug=
|
|
28
|
+
@param outds= (work.mm_createdataset) The dataset to create. The table name
|
|
29
|
+
needs to be 32 chars or less as per SAS naming rules.
|
|
30
|
+
@param mdebug= (0) Set to 1 to enable DEBUG messages
|
|
32
31
|
|
|
33
32
|
@version 9.4
|
|
34
33
|
@author Allan Bowe
|
|
@@ -54,14 +53,23 @@
|
|
|
54
53
|
%mm_gettables(uri=&liburi,outds=&tempds2)
|
|
55
54
|
data _null_;
|
|
56
55
|
set &tempds2;
|
|
57
|
-
|
|
56
|
+
where upcase(tablename)="%upcase(%scan(&libds,2,.))";
|
|
57
|
+
&dbg putlog tableuri=;
|
|
58
58
|
call symputx('tableuri',tableuri);
|
|
59
59
|
run;
|
|
60
60
|
%end;
|
|
61
61
|
|
|
62
|
-
data;run
|
|
62
|
+
data;run;
|
|
63
|
+
%let tempds3=&syslast;
|
|
63
64
|
%mm_getcols(tableuri=&tableuri,outds=&tempds3)
|
|
64
65
|
|
|
66
|
+
%if %mf_nobs(&tempds3)=0 %then %do;
|
|
67
|
+
%put &libds (&tableuri) has no columns defined!!;
|
|
68
|
+
data &outds;
|
|
69
|
+
run;
|
|
70
|
+
%return;
|
|
71
|
+
%end;
|
|
72
|
+
|
|
65
73
|
data _null_;
|
|
66
74
|
set &tempds3 end=last;
|
|
67
75
|
if _n_=1 then call execute('data &outds;');
|
|
@@ -264,7 +264,7 @@ data _null_;
|
|
|
264
264
|
put ' %do i=1 %to &numcols; ';
|
|
265
265
|
put ' %if &i>1 %then "," ; ';
|
|
266
266
|
put ' %if &action=OBJ %then """&&name&i"":" ; ';
|
|
267
|
-
put ' &&name&i ';
|
|
267
|
+
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
268
268
|
put ' %end; ';
|
|
269
269
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
270
270
|
put ' /* now write the long strings to _webout 1 byte at a time */ ';
|
package/package.json
CHANGED
|
@@ -266,7 +266,7 @@ data _null_;
|
|
|
266
266
|
put ' %do i=1 %to &numcols; ';
|
|
267
267
|
put ' %if &i>1 %then "," ; ';
|
|
268
268
|
put ' %if &action=OBJ %then """&&name&i"":" ; ';
|
|
269
|
-
put ' &&name&i ';
|
|
269
|
+
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
270
270
|
put ' %end; ';
|
|
271
271
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
272
272
|
put ' /* now write the long strings to _webout 1 byte at a time */ ';
|
|
@@ -408,7 +408,7 @@ data _null_;
|
|
|
408
408
|
put ' %do i=1 %to &numcols; ';
|
|
409
409
|
put ' %if &i>1 %then "," ; ';
|
|
410
410
|
put ' %if &action=OBJ %then """&&name&i"":" ; ';
|
|
411
|
-
put ' &&name&i ';
|
|
411
|
+
put ' "&&name&i"n /* name literal for reserved variable names */ ';
|
|
412
412
|
put ' %end; ';
|
|
413
413
|
put ' %if &action=ARR %then "]" ; %else "}" ; ; ';
|
|
414
414
|
put ' /* now write the long strings to _webout 1 byte at a time */ ';
|
package/xplatform/mx_getcode.sas
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
%if &platform=SASJS %then %do;
|
|
35
35
|
%ms_getfile(&loc..sas, outref=&outref)
|
|
36
36
|
%end;
|
|
37
|
-
%else %if &platform=SAS9 %then %do;
|
|
37
|
+
%else %if &platform=SAS9 or &platform=SASMETA %then %do;
|
|
38
38
|
%mm_getstpcode(tree=&loc,outloc=&outref)
|
|
39
39
|
%end;
|
|
40
40
|
%else %if &platform=SASVIYA %then %do;
|