Skip to content

Commit cdd2b88

Browse files
authored
Merge pull request #403 from sasjs/issue400
Issue400
2 parents ff519c7 + 7e4fb4a commit cdd2b88

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

all.sas

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11943,7 +11943,7 @@ data _null_;
1194311943
run;
1194411944

1194511945
/* END */
11946-
*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
11946+
/* %put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) secs to run; */
1194711947

1194811948
%mend mp_replace;
1194911949
/**
@@ -24098,12 +24098,14 @@ run;
2409824098
msg=Cannot enter mfv_existfolder.sas with syscc=&syscc
2409924099
)
2410024100

24101-
%local fref rc;
24101+
%local fref rc var;
2410224102
%let fref=%mf_getuniquefileref();
2410324103

2410424104
%if %sysfunc(filename(fref,,filesrvc,folderPath="&path"))=0 %then %do;
2410524105
1
24106+
%let var=_FILESRVC_&fref._URI;
2410624107
%let rc=%sysfunc(filename(fref));
24108+
%symdel &var;
2410724109
%end;
2410824110
%else %do;
2410924111
0
@@ -24461,6 +24463,11 @@ run;
2446124463
,mac=MV_CREATEFILE
2446224464
,msg=%str(File &path/&name already exists and force=&force)
2446324465
)
24466+
%mp_abort(
24467+
iftrue=(&syscc ne 0),
24468+
mac=MV_CREATEFILE182
24469+
msg=syscc=&syscc after mfv_getpathuri
24470+
)
2446424471

2446524472
%if %mf_isblank(&fileuri)=0 and &force=YES %then %do;
2446624473
proc http method="DELETE" url="&base_uri&fileuri" &oauth_bearer;
@@ -24530,8 +24537,8 @@ data &outds;
2453024537
end;
2453124538
run;
2453224539

24533-
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
24534-
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
24540+
%put &sysmacroname: %trim(&base_uri)%mfv_getpathuri(&path/&name);
24541+
%put /SASJobExecution?_file=&path/&name;%put;
2453524542

2453624543
%if &mdebug=0 %then %do;
2453724544
/* clear refs */
@@ -24664,7 +24671,7 @@ options noquotelenmax;
2466424671
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
2466524672
/* relates to: https://github.com/sasjs/core/issues/400 */
2466624673
%put 401 thrown in &sysmacroname;
24667-
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
24674+
%put sleeping: %sysfunc(sleep(12,1)) secs - will try again;
2466824675
proc http method='GET' out=&fname1 &oauth_bearer
2466924676
url="&base_uri/folders/folders/@item?path=&newpath";
2467024677
%if &grant_type=authorization_code %then %do;
@@ -24728,7 +24735,7 @@ options noquotelenmax;
2472824735
'Content-Type'='application/vnd.sas.content.folder+json'
2472924736
'Accept'='application/vnd.sas.content.folder+json';
2473024737
run;
24731-
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
24738+
%if &SYS_PROCHTTP_STATUS_CODE ne 201 %then %do;
2473224739
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
2473324740
%end;
2473424741
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)

base/mp_replace.sas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ data _null_;
148148
run;
149149

150150
/* END */
151-
*%put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) seconds to run;
151+
/* %put &sysmacroname took %sysevalf(%sysfunc(datetime())-&dttm) secs to run; */
152152

153153
%mend mp_replace;

viya/mfv_existfolder.sas

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@
3333
msg=Cannot enter mfv_existfolder.sas with syscc=&syscc
3434
)
3535

36-
%local fref rc;
36+
%local fref rc var;
3737
%let fref=%mf_getuniquefileref();
3838

3939
%if %sysfunc(filename(fref,,filesrvc,folderPath="&path"))=0 %then %do;
4040
1
41+
%let var=_FILESRVC_&fref._URI;
4142
%let rc=%sysfunc(filename(fref));
43+
%symdel &var;
4244
%end;
4345
%else %do;
4446
0

viya/mv_createfile.sas

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ run;
177177
,mac=MV_CREATEFILE
178178
,msg=%str(File &path/&name already exists and force=&force)
179179
)
180+
%mp_abort(
181+
iftrue=(&syscc ne 0),
182+
mac=MV_CREATEFILE182
183+
msg=syscc=&syscc after mfv_getpathuri
184+
)
180185

181186
%if %mf_isblank(&fileuri)=0 and &force=YES %then %do;
182187
proc http method="DELETE" url="&base_uri&fileuri" &oauth_bearer;
@@ -246,8 +251,8 @@ data &outds;
246251
end;
247252
run;
248253

249-
%put &sysmacroname: &name created at %mfv_getpathuri(&path/&name);%put;
250-
%put &base_uri/SASJobExecution?_file=&path/&name;%put;
254+
%put &sysmacroname: %trim(&base_uri)%mfv_getpathuri(&path/&name);
255+
%put /SASJobExecution?_file=&path/&name;%put;
251256

252257
%if &mdebug=0 %then %do;
253258
/* clear refs */

viya/mv_createfolder.sas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ options noquotelenmax;
117117
%if &SYS_PROCHTTP_STATUS_CODE=401 %then %do;
118118
/* relates to: https://github.com/sasjs/core/issues/400 */
119119
%put 401 thrown in &sysmacroname;
120-
%put sleeping: %sysfunc(sleep(10,1)) - will try once more;
120+
%put sleeping: %sysfunc(sleep(12,1)) secs - will try again;
121121
proc http method='GET' out=&fname1 &oauth_bearer
122122
url="&base_uri/folders/folders/@item?path=&newpath";
123123
%if &grant_type=authorization_code %then %do;
@@ -181,7 +181,7 @@ options noquotelenmax;
181181
'Content-Type'='application/vnd.sas.content.folder+json'
182182
'Accept'='application/vnd.sas.content.folder+json';
183183
run;
184-
%if &SYS_PROCHTTP_STATUS_CODE ne 200 %then %do;
184+
%if &SYS_PROCHTTP_STATUS_CODE ne 201 %then %do;
185185
%put &=SYS_PROCHTTP_STATUS_CODE &=SYS_PROCHTTP_STATUS_PHRASE;
186186
%end;
187187
%mp_abort(iftrue=(&SYS_PROCHTTP_STATUS_CODE ne 201)

0 commit comments

Comments
 (0)