From 33a487b2b4c6be7afef0d8ab0a89c3e581ae1a6c Mon Sep 17 00:00:00 2001 From: allan Date: Mon, 30 Jun 2025 16:05:57 +0100 Subject: [PATCH 1/2] fix: addresses #400 --- viya/mfv_existfolder.sas | 5 +++++ viya/mfv_getpathuri.sas | 4 ++++ viya/mv_createfile.sas | 10 ++++++++++ viya/mv_createfolder.sas | 10 ++++++++++ 4 files changed, 29 insertions(+) diff --git a/viya/mfv_existfolder.sas b/viya/mfv_existfolder.sas index 7733fe6..d92884b 100644 --- a/viya/mfv_existfolder.sas +++ b/viya/mfv_existfolder.sas @@ -45,4 +45,9 @@ %let syscc=0; %end; + %mf_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave mfv_existfolder.sas with syscc=&syscc + ) + %mend mfv_existfolder; \ No newline at end of file diff --git a/viya/mfv_getpathuri.sas b/viya/mfv_getpathuri.sas index 1d41ecf..4bec998 100644 --- a/viya/mfv_getpathuri.sas +++ b/viya/mfv_getpathuri.sas @@ -49,4 +49,8 @@ %let syscc=0; %end; + %mf_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc + ) %mend mfv_getpathuri; \ No newline at end of file diff --git a/viya/mv_createfile.sas b/viya/mv_createfile.sas index 2abff7b..b7ff7c7 100644 --- a/viya/mv_createfile.sas +++ b/viya/mv_createfile.sas @@ -95,6 +95,11 @@ %end; %else %let dbg=*; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot enter &sysmacroname with syscc=&syscc +) + %local oauth_bearer; %if &grant_type=detect %then %do; %if %symexist(&access_token_var) %then %let grant_type=authorization_code; @@ -251,4 +256,9 @@ run; libname &libref2 clear; %end; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc +) + %mend mv_createfile; \ No newline at end of file diff --git a/viya/mv_createfolder.sas b/viya/mv_createfolder.sas index 868bcb0..fdbaba1 100644 --- a/viya/mv_createfolder.sas +++ b/viya/mv_createfolder.sas @@ -46,6 +46,11 @@ %end; %else %let dbg=*; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot enter &sysmacroname with syscc=&syscc +) + %if %mfv_existfolder(&path)=1 %then %do; %&dbg.put &sysmacroname: &path already exists; data &outds; @@ -55,6 +60,7 @@ run; %return; %end; +%mp_abort(iftrue=(&syscc ne 0),msg=syscc=&syscc when folder checking) %local oauth_bearer; %if &grant_type=detect %then %do; @@ -194,4 +200,8 @@ options noquotelenmax; filename &fname1 clear; libname &libref1 clear; %end; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc +) %mend mv_createfolder; \ No newline at end of file From 71c31046f4df022e3c6ca85814dc0cb4204fc605 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 30 Jun 2025 15:06:32 +0000 Subject: [PATCH 2/2] chore: updating all.sas --- all.sas | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/all.sas b/all.sas index 9c7d691..434b9e2 100644 --- a/all.sas +++ b/all.sas @@ -24110,6 +24110,11 @@ run; %let syscc=0; %end; + %mf_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave mfv_existfolder.sas with syscc=&syscc + ) + %mend mfv_existfolder;/** @file mfv_existsashdat.sas @brief Checks whether a CAS sashdat dataset exists in persistent storage. @@ -24273,6 +24278,10 @@ run; %let syscc=0; %end; + %mf_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc + ) %mend mfv_getpathuri;/** @file @brief Creates a file in SAS Drive using the API method @@ -24370,6 +24379,11 @@ run; %end; %else %let dbg=*; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot enter &sysmacroname with syscc=&syscc +) + %local oauth_bearer; %if &grant_type=detect %then %do; %if %symexist(&access_token_var) %then %let grant_type=authorization_code; @@ -24526,6 +24540,11 @@ run; libname &libref2 clear; %end; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc +) + %mend mv_createfile;/** @file mv_createfolder.sas @brief Creates a viya folder if that folder does not already exist @@ -24574,6 +24593,11 @@ run; %end; %else %let dbg=*; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot enter &sysmacroname with syscc=&syscc +) + %if %mfv_existfolder(&path)=1 %then %do; %&dbg.put &sysmacroname: &path already exists; data &outds; @@ -24583,6 +24607,7 @@ run; run; %return; %end; +%mp_abort(iftrue=(&syscc ne 0),msg=syscc=&syscc when folder checking) %local oauth_bearer; %if &grant_type=detect %then %do; @@ -24722,6 +24747,10 @@ options noquotelenmax; filename &fname1 clear; libname &libref1 clear; %end; +%mp_abort( + iftrue=(&syscc ne 0), + msg=Cannot leave &sysmacroname with syscc=&syscc +) %mend mv_createfolder;/** @file @brief Creates a Viya Job