@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.
@@ -148,6 +148,6 @@ data _null_;
148
148
  run;
149
149
 
150
150
  /* END */
151
- %put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
151
+ *%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
152
152
 
153
153
  %mend mp_replace;
package/package.json CHANGED
@@ -32,5 +32,5 @@
32
32
  "lint": "npx @sasjs/cli lint",
33
33
  "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
34
34
  },
35
- "version": "4.59.2"
35
+ "version": "4.59.4"
36
36
  }
@@ -45,4 +45,9 @@
45
45
  %let syscc=0;
46
46
  %end;
47
47
 
48
+ %mf_abort(
49
+ iftrue=(&syscc ne 0),
50
+ msg=Cannot leave mfv_existfolder.sas with syscc=&syscc
51
+ )
52
+
48
53
  %mend mfv_existfolder;
@@ -49,4 +49,8 @@
49
49
  %let syscc=0;
50
50
  %end;
51
51
 
52
+ %mf_abort(
53
+ iftrue=(&syscc ne 0),
54
+ msg=Cannot leave &sysmacroname with syscc=&syscc
55
+ )
52
56
  %mend mfv_getpathuri;
@@ -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;
@@ -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=&sysmacroname
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;