@sasjs/core 4.17.0 → 4.18.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 +9 -0
- package/base/mf_existfeature.sas +7 -6
- package/base/mp_abort.sas +2 -2
- package/base/mp_loadformat.sas +5 -3
- package/package.json +1 -1
- package/server/ms_deletefile.sas +35 -0
- package/server/ms_getfile.sas +1 -1
- package/viya/mv_deleteviyafolder.sas +1 -0
package/README.md
CHANGED
|
@@ -217,6 +217,15 @@ If you find this library useful, please leave a [star](https://github.com/sasjs/
|
|
|
217
217
|
|
|
218
218
|

|
|
219
219
|
|
|
220
|
+
## Other SAS Repositories
|
|
221
|
+
|
|
222
|
+
The following repositories are also worth checking out:
|
|
223
|
+
|
|
224
|
+
* [chris-swenson/sasmacros](https://github.com/chris-swenson/sasmacros)
|
|
225
|
+
* [greg-wotton/sas-programs](https://github.com/greg-wootton/sas-programs)
|
|
226
|
+
* [KatjaGlassConsulting/SMILE-SmartSASMacros](https://github.com/KatjaGlassConsulting/SMILE-SmartSASMacros)
|
|
227
|
+
* [scottbass/sas](https://github.com/scottbass/SAS)
|
|
228
|
+
* [yabwon/sas_packages](https://github.com/yabwon/SAS_PACKAGES)
|
|
220
229
|
|
|
221
230
|
## Contributors ✨
|
|
222
231
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
package/base/mf_existfeature.sas
CHANGED
|
@@ -9,19 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
%put %mf_existfeature(PROCLUA);
|
|
11
11
|
|
|
12
|
-
@param feature
|
|
12
|
+
@param [in] feature The feature to detect.
|
|
13
13
|
|
|
14
14
|
@return output returns 1 or 0 (or -1 if not found)
|
|
15
15
|
|
|
16
16
|
<h4> SAS Macros </h4>
|
|
17
17
|
@li mf_getplatform.sas
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
@version 8
|
|
21
20
|
@author Allan Bowe
|
|
22
21
|
**/
|
|
23
22
|
/** @cond */
|
|
24
|
-
|
|
25
23
|
%macro mf_existfeature(feature
|
|
26
24
|
)/*/STORE SOURCE*/;
|
|
27
25
|
%let feature=%upcase(&feature);
|
|
@@ -29,7 +27,11 @@
|
|
|
29
27
|
%let platform=%mf_getplatform();
|
|
30
28
|
|
|
31
29
|
%if &feature= %then %do;
|
|
32
|
-
%put
|
|
30
|
+
%put No feature was requested for detection;
|
|
31
|
+
%end;
|
|
32
|
+
%else %if &feature=COLCONSTRAINTS %then %do;
|
|
33
|
+
%if %substr(&sysver,1,1)=4 %then 0;
|
|
34
|
+
%else 1;
|
|
33
35
|
%end;
|
|
34
36
|
%else %if &feature=PROCLUA %then %do;
|
|
35
37
|
/* https://blogs.sas.com/content/sasdummy/2015/08/03/using-lua-within-your-sas-programs */
|
|
@@ -43,5 +45,4 @@
|
|
|
43
45
|
%put &sysmacroname: &feature not found;
|
|
44
46
|
%end;
|
|
45
47
|
%mend mf_existfeature;
|
|
46
|
-
|
|
47
|
-
/** @endcond */
|
|
48
|
+
/** @endcond */
|
package/base/mp_abort.sas
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
%end;
|
|
86
86
|
|
|
87
87
|
/* Stored Process Server web app context */
|
|
88
|
-
%if %symexist(
|
|
88
|
+
%if %symexist(_metaport)
|
|
89
89
|
or "&SYSPROCESSNAME "="Compute Server "
|
|
90
90
|
or &mode=INCLUDE
|
|
91
91
|
%then %do;
|
|
@@ -260,4 +260,4 @@
|
|
|
260
260
|
%end;
|
|
261
261
|
%mend mp_abort;
|
|
262
262
|
|
|
263
|
-
/** @endcond */
|
|
263
|
+
/** @endcond */
|
package/base/mp_loadformat.sas
CHANGED
|
@@ -134,7 +134,7 @@ run;
|
|
|
134
134
|
* First, extract only relevant formats from the catalog
|
|
135
135
|
*/
|
|
136
136
|
proc sql noprint;
|
|
137
|
-
select distinct fmtname into: fmtlist separated by ' ' from &libds;
|
|
137
|
+
select distinct upcase(fmtname) into: fmtlist separated by ' ' from &libds;
|
|
138
138
|
|
|
139
139
|
%mp_cntlout(libcat=&libcat,fmtlist=&fmtlist,cntlout=&base_fmts)
|
|
140
140
|
|
|
@@ -144,8 +144,11 @@ select distinct fmtname into: fmtlist separated by ' ' from &libds;
|
|
|
144
144
|
*/
|
|
145
145
|
%mddl_sas_cntlout(libds=&template)
|
|
146
146
|
data &inlibds;
|
|
147
|
+
length &delete_col $3;
|
|
147
148
|
if 0 then set &template;
|
|
148
149
|
set &libds;
|
|
150
|
+
if &delete_col='' then &delete_col='No';
|
|
151
|
+
fmtname=upcase(fmtname);
|
|
149
152
|
if missing(type) then do;
|
|
150
153
|
if substr(fmtname,1,1)='$' then type='C';
|
|
151
154
|
else type='N';
|
|
@@ -156,7 +159,6 @@ data &inlibds;
|
|
|
156
159
|
end;
|
|
157
160
|
run;
|
|
158
161
|
|
|
159
|
-
|
|
160
162
|
/**
|
|
161
163
|
* Identify new records
|
|
162
164
|
*/
|
|
@@ -263,7 +265,7 @@ options ibufsize=&ibufsize;
|
|
|
263
265
|
%end;
|
|
264
266
|
|
|
265
267
|
%mp_storediffs(&libcat-FC
|
|
266
|
-
,&
|
|
268
|
+
,&base_fmts
|
|
267
269
|
,FMTNAME START
|
|
268
270
|
,delds=&outds_del
|
|
269
271
|
,modds=&outds_mod
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file
|
|
3
|
+
@brief Deletes a file from SASjs Drive
|
|
4
|
+
@details Deletes a file from SASjs Drive, if it exists.
|
|
5
|
+
|
|
6
|
+
Example:
|
|
7
|
+
|
|
8
|
+
filename stpcode temp;
|
|
9
|
+
data _null_;
|
|
10
|
+
file stpcode;
|
|
11
|
+
put '%put hello world;';
|
|
12
|
+
run;
|
|
13
|
+
%ms_createfile(/some/stored/program.sas, inref=stpcode)
|
|
14
|
+
|
|
15
|
+
%ms_deletefile(/some/stored/program.sas)
|
|
16
|
+
|
|
17
|
+
@param [in] driveloc The full path to the file in SASjs Drive
|
|
18
|
+
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
**/
|
|
22
|
+
|
|
23
|
+
%macro ms_deletefile(driveloc
|
|
24
|
+
,mdebug=0
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
proc http method='DELETE'
|
|
28
|
+
url="&_sasjs_apiserverurl/SASjsApi/drive/file?_filePath=&driveloc";
|
|
29
|
+
%if &mdebug=1 %then %do;
|
|
30
|
+
debug level=2;
|
|
31
|
+
%end;
|
|
32
|
+
run;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
%mend ms_deletefile;
|
package/server/ms_getfile.sas
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
filename &outref temp;
|
|
23
23
|
|
|
24
24
|
proc http method='GET' out=&outref
|
|
25
|
-
url="&_sasjs_apiserverurl/SASjsApi/drive/file?
|
|
25
|
+
url="&_sasjs_apiserverurl/SASjsApi/drive/file?_filePath=&driveloc";
|
|
26
26
|
%if &mdebug=1 %then %do;
|
|
27
27
|
debug level=2;
|
|
28
28
|
%end;
|