@sasjs/core 4.59.2 → 4.59.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/base/mp_replace.sas +1 -1
- package/package.json +1 -1
- package/viya/mfv_existfolder.sas +5 -0
- package/viya/mfv_getpathuri.sas +4 -0
- package/viya/mv_createfile.sas +10 -0
- package/viya/mv_createfolder.sas +22 -1
package/base/mp_replace.sas
CHANGED
package/package.json
CHANGED
package/viya/mfv_existfolder.sas
CHANGED
package/viya/mfv_getpathuri.sas
CHANGED
package/viya/mv_createfile.sas
CHANGED
|
@@ -95,6 +95,11 @@
|
|
|
95
95
|
%end;
|
|
96
96
|
%else %let dbg=*;
|
|
97
97
|
|
|
98
|
+
%mp_abort(
|
|
99
|
+
iftrue=(&syscc ne 0),
|
|
100
|
+
msg=Cannot enter &sysmacroname with syscc=&syscc
|
|
101
|
+
)
|
|
102
|
+
|
|
98
103
|
%local oauth_bearer;
|
|
99
104
|
%if &grant_type=detect %then %do;
|
|
100
105
|
%if %symexist(&access_token_var) %then %let grant_type=authorization_code;
|
|
@@ -251,4 +256,9 @@ run;
|
|
|
251
256
|
libname &libref2 clear;
|
|
252
257
|
%end;
|
|
253
258
|
|
|
259
|
+
%mp_abort(
|
|
260
|
+
iftrue=(&syscc ne 0),
|
|
261
|
+
msg=Cannot leave &sysmacroname with syscc=&syscc
|
|
262
|
+
)
|
|
263
|
+
|
|
254
264
|
%mend mv_createfile;
|
package/viya/mv_createfolder.sas
CHANGED
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
%end;
|
|
47
47
|
%else %let dbg=*;
|
|
48
48
|
|
|
49
|
+
%mp_abort(
|
|
50
|
+
iftrue=(&syscc ne 0),
|
|
51
|
+
msg=Cannot enter &sysmacroname with syscc=&syscc
|
|
52
|
+
)
|
|
53
|
+
|
|
49
54
|
%if %mfv_existfolder(&path)=1 %then %do;
|
|
50
55
|
%&dbg.put &sysmacroname: &path already exists;
|
|
51
56
|
data &outds;
|
|
@@ -55,6 +60,7 @@
|
|
|
55
60
|
run;
|
|
56
61
|
%return;
|
|
57
62
|
%end;
|
|
63
|
+
%mp_abort(iftrue=(&syscc ne 0),msg=syscc=&syscc when folder checking)
|
|
58
64
|
|
|
59
65
|
%local oauth_bearer;
|
|
60
66
|
%if &grant_type=detect %then %do;
|
|
@@ -108,6 +114,17 @@ options noquotelenmax;
|
|
|
108
114
|
headers "Authorization"="Bearer &&&access_token_var";
|
|
109
115
|
%end;
|
|
110
116
|
run;
|
|
117
|
+
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
|
|
118
|
+
/* relates to: https://github.com/sasjs/core/issues/400 */
|
|
119
|
+
%put 401 thrown in &sysmacroname;
|
|
120
|
+
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
|
|
121
|
+
proc http method='GET' out=&fname1 &oauth_bearer
|
|
122
|
+
url="&base_uri/folders/folders/@item?path=&newpath";
|
|
123
|
+
%if &grant_type=authorization_code %then %do;
|
|
124
|
+
headers "Authorization"="Bearer &&&access_token_var";
|
|
125
|
+
%end;
|
|
126
|
+
run;
|
|
127
|
+
%end;
|
|
111
128
|
%local libref1;
|
|
112
129
|
%let libref1=%mf_getuniquelibref();
|
|
113
130
|
libname &libref1 JSON fileref=&fname1;
|
|
@@ -115,7 +132,7 @@ options noquotelenmax;
|
|
|
115
132
|
iftrue=(
|
|
116
133
|
&SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404
|
|
117
134
|
)
|
|
118
|
-
,mac
|
|
135
|
+
,mac=mv_createfolder124
|
|
119
136
|
,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE)
|
|
120
137
|
)
|
|
121
138
|
%if &mdebug=1 %then %do;
|
|
@@ -194,4 +211,8 @@ options noquotelenmax;
|
|
|
194
211
|
filename &fname1 clear;
|
|
195
212
|
libname &libref1 clear;
|
|
196
213
|
%end;
|
|
214
|
+
%mp_abort(
|
|
215
|
+
iftrue=(&syscc ne 0),
|
|
216
|
+
msg=Cannot leave &sysmacroname with syscc=&syscc
|
|
217
|
+
)
|
|
197
218
|
%mend mv_createfolder;
|