Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mv_createfolder.test.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Testing mv_createfolder macro
4
5 <h4> SAS Macros </h4>
6 @li mf_uid.sas
7 @li mp_assert.sas
8 @li mp_assertscope.sas
9 @li mv_createfolder.sas
10 @li mv_getfoldermembers.sas
11
12**/
13
14
15%let folder=%mf_uid();
16
17/* create a folder */
18%mp_assertscope(SNAPSHOT)
19%mv_createfolder(path=&mcTestAppLoc/temp/&folder/&folder)
20%mp_assertscope(COMPARE, ignorelist=MC0_JADP1LEN MC0_JADP2LEN MC0_JADPNUM
21 MC0_JADVLEN MC2_JADP1LEN MC2_JADP2LEN MC2_JADPNUM MC2_JADVLEN
22)
23
24%mv_getfoldermembers(root=&mcTestAppLoc/temp/&folder, outds=work.folders)
25
26%let test=0;
27data _null_;
28 set work.folders;
29 putlog (_all_)(=);
30 if name="&folder" then call symputx('test',1);
31run;
32
33%mp_assert(
34 iftrue=(&test=1),
35 desc=Check if temp folder can be successfully created
36)
37
38/* create a folder without output dataset as part of the original macro */
39%mv_createfolder(path=&mcTestAppLoc/temp/&folder/f2
40 ,outds=folders2,mdebug=&sasjs_mdebug
41)
42
43%let test=0;
44data _null_;
45 set work.folders2;
46 putlog (_all_)(=);
47 if not missing(self_uri) then call symputx('test2',1);
48run;
49
50%mp_assert(
51 iftrue=(&test2=1),
52 desc=Check if outds param works
53)
54
55/* create a folder with full stops */
56%let newfolder=%mf_uid().2.1;
57%mv_createfolder(path=&mcTestAppLoc/temp/&newfolder
58 ,outds=work.folders3
59 ,mdebug=&sasjs_mdebug
60)
61
62%mv_getfoldermembers(root=&mcTestAppLoc/temp, outds=work.folders3)
63
64%let test3=0;
65data _null_;
66 set work.folders3;
67 putlog (_all_)(=);
68 if name="&newfolder" then call symputx('test3',1);
69run;
70
71%mp_assert(
72 iftrue=(&test3=1),
73 desc=Check if folder with full stops can be successfully created
74)