Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mmx_createmetafolder.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Creates a metadata folder
4 @details Creates a metadata folder using the batch tools
5
6 Usage:
7
8 %mmx_createmetafolder(loc=/some/meta/folder,user=sasdemo,pass=mars345)
9
10 <h4> SAS Macros </h4>
11 @li mf_loc.sas
12 @li mp_abort.sas
13
14 @param [in] loc= the metadata folder to delete
15 @param [in] user= username
16 @param [in] pass= password
17
18 @version 9.4
19 @author Allan Bowe
20
21**/
22
23%macro mmx_createmetafolder(loc=,user=,pass=);
24
25%local host port path connx_string msg;
26%let host=%sysfunc(getoption(metaserver));
27%let port=%sysfunc(getoption(metaport));
28%let path=%mf_loc(POF)/tools;
29
30%let connx_string= -host &host -port &port -user '&user' -password '&pass';
31/* remove directory */
32data _null_;
33 infile " &path/sas-make-folder &connx_string ""&loc"" -makeFullPath 2>&1"
34 pipe lrecl=10000;
35 input;
36 putlog _infile_;
37run;
38
39data _null_; /* check tree exists */
40 length type uri $256;
41 rc=metadata_pathobj("","&loc","Folder",type,uri);
42 call symputx('foldertype',type,'l');
43run;
44%let msg=Location (&loc) was not created!!;
45%mp_abort(iftrue= (&foldertype ne Tree)
46 ,mac=&_program..sas
47 ,msg=%superq(msg)
48)
49
50%mend mmx_createmetafolder;