1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-11 06:24:35 +00:00

fix: addressed issue when creating recursive folers in mv_createfolder.sas

This commit is contained in:
Allan Bowe
2021-05-25 15:33:02 +03:00
parent 7ea9e0f8e9
commit 62db83dcf6
4 changed files with 42 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
tasks:
- init: npm i -g @sasjs/cli
- init: nvm install --latest-npm && npm i -g @sasjs/cli
image:
file: .gitpod.dockerfile

View File

@@ -0,0 +1,32 @@
/**
@file
@brief Testing mv_createfolder macro
<h4> SAS Macros </h4>
@li mf_uid.sas
@li mp_assert.sas
@li mv_createfolder.sas
@li mv_deleteviyafolder.sas
@li mv_getfoldermembers.sas
**/
%let folder=%mf_uid();
/* create a folder */
%mv_createfolder(path=&mcTestAppLoc/temp/&folder/&folder)
%mv_getfoldermembers(root=&mcTestAppLoc/temp/&folder, outds=work.folders)
%let test=0;
data _null_;
set work.folders;
putlog (_all_)(=);
if name="&folder" then call symputx('test',1);
run;
%mp_assert(
iftrue=(&test=1),
desc=Check if temp folder can be successfully created
)

View File

@@ -96,7 +96,7 @@ options noquotelenmax;
data _null_;
set &libref1..links;
if rel='createChild' then
call symputx('href',quote("&base_uri"!!trim(href)),'l');
call symputx('href',quote(cats("&base_uri",href)),'l');
run;
%end;
%else %if &SYS_PROCHTTP_STATUS_CODE=404 %then %do;
@@ -141,7 +141,7 @@ options noquotelenmax;
data _null_;
set &libref2..links;
if rel='createChild' then
call symputx('href',quote(trim(href)),'l');
call symputx('href',quote(cats("&base_uri",href)),'l');
run;
libname &libref2 clear;
@@ -150,4 +150,4 @@ options noquotelenmax;
filename &fname1 clear;
libname &libref1 clear;
%end;
%mend;
%mend mv_createfolder;

View File

@@ -8,7 +8,11 @@
@param root= The path for which to return the list of folders
@param outds= The output dataset to create (default is work.mv_getfolders)
@param outds= The output dataset to create (default is work.mv_getfolders). Format:
|ordinal_root|ordinal_items|creationTimeStamp| modifiedTimeStamp|createdBy|modifiedBy|id| uri|added| type|name|description|
|---|---|---|---|---|---|---|---|---|---|---|---|
|1|1|2021-05-25T11:15:04.204Z|2021-05-25T11:15:04.204Z|allbow|allbow|4f1e3945-9655-462b-90f2-c31534b3ca47|/folders/folders/ed701ff3-77e8-468d-a4f5-8c43dec0fd9e|2021-05-25T11:15:04.212Z|child|my_folder_name|My folder Description|
@param access_token_var= The global macro variable to contain the access token
@param grant_type= valid values are "password" or "authorization_code" (unquoted).
The default is authorization_code.
@@ -116,4 +120,4 @@ options noquotelenmax;
filename &fname1 clear;
libname &libref1 clear;
%mend;
%mend mv_getfoldermembers;