@sasjs/core 4.57.2 → 4.57.4
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 +11 -10
- package/package.json +1 -1
- package/viya/mv_createfile.sas +14 -7
- package/viya/mv_createfolder.sas +1 -1
- package/viya/mv_createwebservice.sas +3 -3
- package/viya/mv_deletejes.sas +5 -4
package/README.md
CHANGED
|
@@ -147,16 +147,17 @@ filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
|
|
|
147
147
|
- macro names must be lowercase
|
|
148
148
|
- one macro per file
|
|
149
149
|
- prefixes:
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
150
|
+
- _mcf__: macro compiled functions (proc fcmp)
|
|
151
|
+
- _mddl__: macros containing DDL (Data Definition Language)
|
|
152
|
+
- _mf__: macro functions (can be used in open code).
|
|
153
|
+
- _mfv__: macro functions that work only in Viya
|
|
154
|
+
- _ml__: macros that are used to compile LUA modules
|
|
155
|
+
- _mm__: metadata macros (interface with the metadata server).
|
|
156
|
+
- _mmx__: macros that use metadata and are XCMD enabled (working on both windows and unix)
|
|
157
|
+
- _mp__: macro procedures (which generate sas code)
|
|
158
|
+
- _ms__: macro procedures that will only work with [@sasjs/server](https://github.com/sasjs/server)
|
|
159
|
+
- _mv__: macro procedures that will only work in Viya
|
|
160
|
+
- _mx__: macros that work on Viya, SAS 9 EBI and SASjs Server
|
|
160
161
|
- follow verb-noun convention
|
|
161
162
|
- unix style line endings (lf)
|
|
162
163
|
- individual lines should be no more than 80 characters long
|
package/package.json
CHANGED
package/viya/mv_createfile.sas
CHANGED
|
@@ -157,8 +157,10 @@ run;
|
|
|
157
157
|
%end;
|
|
158
158
|
"Accept"="*/*";
|
|
159
159
|
run;
|
|
160
|
-
%put &sysmacroname DELETE &base_uri&fileuri
|
|
161
|
-
|
|
160
|
+
%put &sysmacroname DELETE &base_uri&fileuri;
|
|
161
|
+
%if &SYS_PROCHTTP_STATUS_CODE ne 204 %then %do;
|
|
162
|
+
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
|
163
|
+
%end;
|
|
162
164
|
%end;
|
|
163
165
|
|
|
164
166
|
%local url mimetype ext;
|
|
@@ -187,7 +189,14 @@ proc http method='POST' out=&fname1 &oauth_bearer in=&fref
|
|
|
187
189
|
%if &grant_type=authorization_code %then %do;
|
|
188
190
|
"Authorization"="Bearer &&&access_token_var"
|
|
189
191
|
%end;
|
|
190
|
-
|
|
192
|
+
"Content-Disposition"=
|
|
193
|
+
%if "&ext"="SVG" %then %do;
|
|
194
|
+
"filename=""&name"";"
|
|
195
|
+
%end;
|
|
196
|
+
%else %do;
|
|
197
|
+
"&contentdisp filename=""&name""; name=""&name"";"
|
|
198
|
+
%end;
|
|
199
|
+
;
|
|
191
200
|
run;
|
|
192
201
|
%if &mdebug=1 %then %put &sysmacroname POST &=url
|
|
193
202
|
&=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
|
@@ -198,7 +207,7 @@ run;
|
|
|
198
207
|
%local libref2;
|
|
199
208
|
%let libref2=%mf_getuniquelibref();
|
|
200
209
|
libname &libref2 JSON fileref=&fname1;
|
|
201
|
-
|
|
210
|
+
/* Grab the follow on link */
|
|
202
211
|
data &outds;
|
|
203
212
|
set &libref2..links end=last;
|
|
204
213
|
if rel='createChild' then do;
|
|
@@ -207,9 +216,7 @@ data &outds;
|
|
|
207
216
|
end;
|
|
208
217
|
run;
|
|
209
218
|
|
|
210
|
-
%put &sysmacroname:
|
|
211
|
-
%put &base_uri%mfv_getpathuri(&path/&name);%put;
|
|
219
|
+
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
|
|
212
220
|
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
|
|
213
|
-
%put &sysmacroname:;
|
|
214
221
|
|
|
215
222
|
%mend mv_createfile;
|
package/viya/mv_createfolder.sas
CHANGED
|
@@ -122,7 +122,7 @@ options noquotelenmax;
|
|
|
122
122
|
%let path=%substr(&path,1,%length(&path)-1);
|
|
123
123
|
|
|
124
124
|
/* ensure folder exists */
|
|
125
|
-
|
|
125
|
+
%&dbg.put &sysmacroname: Path &path being checked / created;
|
|
126
126
|
%mv_createfolder(path=&path)
|
|
127
127
|
|
|
128
128
|
%local base_uri; /* location of rest apis */
|
|
@@ -955,7 +955,7 @@ run;
|
|
|
955
955
|
libname &libref1 clear;
|
|
956
956
|
%end;
|
|
957
957
|
|
|
958
|
-
%put
|
|
959
|
-
%put
|
|
958
|
+
%put &sysmacroname: Job &name created! Check it out:;
|
|
959
|
+
%put &url/SASJobExecution?_PROGRAM=&path/&name;
|
|
960
960
|
|
|
961
961
|
%mend mv_createwebservice;
|
package/viya/mv_deletejes.sas
CHANGED
|
@@ -69,8 +69,7 @@
|
|
|
69
69
|
options noquotelenmax;
|
|
70
70
|
%local base_uri; /* location of rest apis */
|
|
71
71
|
%let base_uri=%mf_getplatform(VIYARESTAPI);
|
|
72
|
-
|
|
73
|
-
%put &sysmacroname: fetching details for &path ;
|
|
72
|
+
/* fetch the members of the folder to get the uri */
|
|
74
73
|
%local fname1;
|
|
75
74
|
%let fname1=%mf_getuniquefileref();
|
|
76
75
|
proc http method='GET' out=&fname1 &oauth_bearer
|
|
@@ -108,7 +107,9 @@ proc http method='GET' out=&fname1a &oauth_bearer
|
|
|
108
107
|
headers "Authorization"="Bearer &&&access_token_var";
|
|
109
108
|
%end;
|
|
110
109
|
run;
|
|
111
|
-
%
|
|
110
|
+
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
|
|
111
|
+
%put &=sysmacroname &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
|
|
112
|
+
%end;
|
|
112
113
|
%local libref1a;
|
|
113
114
|
%let libref1a=%mf_getuniquelibref();
|
|
114
115
|
libname &libref1a JSON fileref=&fname1a;
|
|
@@ -140,7 +141,7 @@ run;
|
|
|
140
141
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
|
141
142
|
)
|
|
142
143
|
%end;
|
|
143
|
-
%else %put &sysmacroname: &path/&name
|
|
144
|
+
%else %put &sysmacroname: &path/&name deleted;
|
|
144
145
|
|
|
145
146
|
/* clear refs */
|
|
146
147
|
filename &fname1 clear;
|