diff --git a/base/mp_replace.sas b/base/mp_replace.sas index 00af6d0..fcacbae 100644 --- a/base/mp_replace.sas +++ b/base/mp_replace.sas @@ -148,6 +148,6 @@ data _null_; run; /* END */ -%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run; +*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run; %mend mp_replace; diff --git a/viya/mv_createfolder.sas b/viya/mv_createfolder.sas index fdbaba1..90820fd 100644 --- a/viya/mv_createfolder.sas +++ b/viya/mv_createfolder.sas @@ -114,6 +114,17 @@ options noquotelenmax; headers "Authorization"="Bearer &&&access_token_var"; %end; run; + %if &SYS_PROCHTTP_STATUS_CODE=401 %then %do; + /* relates to: https://github.com/sasjs/core/issues/400 */ + %put 401 thrown in &sysmacroname; + %put sleeping: %sysfunc(sleep(10,1)) - will try once more; + proc http method='GET' out=&fname1 &oauth_bearer + url="&base_uri/folders/folders/@item?path=&newpath"; + %if &grant_type=authorization_code %then %do; + headers "Authorization"="Bearer &&&access_token_var"; + %end; + run; + %end; %local libref1; %let libref1=%mf_getuniquelibref(); libname &libref1 JSON fileref=&fname1; @@ -121,7 +132,7 @@ options noquotelenmax; iftrue=( &SYS_PROCHTTP_STATUS_CODE ne 200 and &SYS_PROCHTTP_STATUS_CODE ne 404 ) - ,mac=&sysmacroname + ,mac=mv_createfolder124 ,msg=%str(&SYS_PROCHTTP_STATUS_CODE &SYS_PROCHTTP_STATUS_PHRASE) ) %if &mdebug=1 %then %do;