@sasjs/core 4.27.2 → 4.27.5

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_abort.sas CHANGED
@@ -84,8 +84,8 @@
84
84
  %end;
85
85
  %end;
86
86
 
87
- /* Stored Process Server web app context */
88
- %if %symexist(_METAFOLDER)
87
+ /* Web App Context */
88
+ %if %symexist(_PROGRAM)
89
89
  or "&SYSPROCESSNAME "="Compute Server "
90
90
  or &mode=INCLUDE
91
91
  %then %do;
@@ -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 mm_createdataset.sas
3
- @brief Create a dataset from a metadata definition
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
- https://datacontroller.io - a free evaluation copy is available by
6
- contacting the author (Allan Bowe).
5
+ https://datacontroller.io
7
6
 
8
- The table can be retrieved using LIBRARY.DATASET reference, or directly
9
- using the metadata URI.
7
+ The table can be retrieved using LIBRARY.DATASET reference, or directly
8
+ using the metadata URI.
10
9
 
11
- The dataset is written to the WORK library.
10
+ The dataset is written to the WORK library.
12
11
 
13
- usage:
12
+ Usage:
14
13
 
15
- %mm_createdataset(libds=metlib.some_dataset)
14
+ %mm_createdataset(libds=metlib.some_dataset)
16
15
 
17
- or
16
+ or
18
17
 
19
- %mm_createdataset(tableuri=G5X8AFW1.BE00015Y)
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, default is `work.mm_createdataset`.
30
- The table name needs to be 32 chars or less as per SAS naming rules.
31
- @param mdebug= set DBG to 1 to disable DEBUG messages
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
- if upcase(tablename)="%upcase(%scan(&libds,2,.))";
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;%let tempds3=&syslast;
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
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "3.13.0"
37
37
  },
38
- "version": "4.27.2"
38
+ "version": "4.27.5"
39
39
  }
@@ -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 */ ';
@@ -2,7 +2,8 @@
2
2
  @file mx_createwebservice.sas
3
3
  @brief Create a web service in SAS 9, Viya or SASjs
4
4
  @details Creates a SASJS ready Stored Process in SAS 9, a Job Execution
5
- Service in SAS Viya, and a Stored Program on SASjs Server
5
+ Service in SAS Viya, or a Stored Program on SASjs Server - depending on the
6
+ executing environment.
6
7
 
7
8
  Usage:
8
9
 
@@ -24,7 +25,9 @@ Usage:
24
25
  %webout(OBJ,example2) * Object format, easier to work with ;
25
26
  %webout(CLOSE)
26
27
  ;;;;
27
- %mp_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
28
+
29
+ %* create the service (including webout macro and dependencies);
30
+ %mx_createwebservice(path=/Public/app/common,name=appInit,replace=YES)
28
31
 
29
32
  <h4> SAS Macros </h4>
30
33
  @li mf_getplatform.sas
@@ -43,7 +46,6 @@ Usage:
43
46
  location
44
47
  @param [in] mDebug= (0) set to 1 to show debug messages in the log
45
48
 
46
- @version 9.2
47
49
  @author Allan Bowe
48
50
 
49
51
  **/