@sasjs/core 4.58.2 → 4.59.0

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.
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.58.2"
35
+ "version": "4.59.0"
36
36
  }
@@ -0,0 +1,53 @@
1
+ /**
2
+ @file
3
+ @brief Returns the path of a folder from the URI
4
+ @details Makes use of the SYSMSG() ER8OR response, which resolves the uri,
5
+ seemingly without entering an er8or state.
6
+
7
+ Usage:
8
+
9
+ %mv_createfolder(path=/public/demo)
10
+ %let uri=%mfv_getpathuri(/public/demo);
11
+ %put %mfv_getfolderpath(&uri);
12
+
13
+ Notice above the new path has an uppercase P - the correct path.
14
+
15
+ @param [in] uri The uri of the folder -eg /folders/folders/xxxx)
16
+
17
+ <h4> SAS Macros </h4>
18
+ @li mf_getuniquefileref.sas
19
+
20
+ <h4> Related Macros </h4>
21
+ @li mfv_getpathuri.sas
22
+
23
+ @version 4
24
+ @author [Allan Bowe](https://www.linkedin.com/in/allanbowe/)
25
+ **/
26
+ %macro mfv_getfolderpath(uri
27
+ )/*/STORE SOURCE*/;
28
+
29
+ %local fref rc path msg var /* var used to avoid delete timing issue */;
30
+ %let fref=%mf_getuniquefileref();
31
+ %if %quote(%substr(%str(&uri),1,17)) ne %quote(/folders/folders/)
32
+ %then %do;
33
+ %put &sysmacroname: Invalid URI: &uri;
34
+ %end;
35
+ %else %if %sysfunc(filename(fref,,filesrvc,folderuri="&uri" ))=0
36
+ %then %do;
37
+ %let var=_FILESRVC_&fref._URI;
38
+ %local fid ;
39
+ %let fid= %sysfunc(fopen(&fref,I));
40
+ %let msg=%quote(%sysfunc(sysmsg()));
41
+
42
+ %unquote(%scan(&msg,2,%str(,.)))
43
+
44
+ %let rc=%sysfunc(fclose(&fid));
45
+ %let rc=%sysfunc(filename(fref));
46
+ %symdel &var;
47
+ %end;
48
+ %else %do;
49
+ %put &sysmacroname: Not Found: &uri;
50
+ %let syscc=0;
51
+ %end;
52
+
53
+ %mend mfv_getfolderpath ;