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