SASUnit Examples  Version 1.5.0
_gettestsubfolder.sas
Go to the documentation of this file.
1 
27 %macro _getTestSubfolder (i_assertType=
28  ,i_root =%sysfunc(pathname(testout))
29  ,i_scnid =
30  ,i_casid =
31  ,i_tstid =
32  ,r_path =
33  );
34 
35  %local l_scnid_string l_subfoldername;
36 
37  %if %nrbquote (&i_assertType.) = %str() %then %do;
38  %put &g_error.(SASUNIT): Please specify a value for i_assertType.;
39  %RETURN;
40  %end;
41  %if %nrbquote (&i_root.) = %str() %then %do;
42  %put &g_error.(SASUNIT): Please specify a value for i_root.;
43  %RETURN;
44  %end;
45  %if not %_existdir (&i_root.) %then %do;
46  %put &g_error.(SASUNIT): Please specify a valid directory for i_root.;
47  %RETURN;
48  %end;
49  %if %nrbquote (&i_scnid.) = %str() %then %do;
50  %put &g_error.(SASUNIT): Please specify a value for i_scnid.;
51  %RETURN;
52  %end;
53  %if %nrbquote (&i_casid.) = %str() %then %do;
54  %put &g_error.(SASUNIT): Please specify a value for i_casid.;
55  %RETURN;
56  %end;
57  %if %nrbquote (&i_tstid.) = %str() %then %do;
58  %put &g_error.(SASUNIT): Please specify a value for i_tstid.;
59  %RETURN;
60  %end;
61  %if %nrbquote (&r_path.) = %str() %then %do;
62  %put &g_error.(SASUNIT): Please specify a value for r_path.;
63  %RETURN;
64  %end;
65  %if not %symexist(&r_path.) %then %do;
66  %put &g_error.(SASUNIT): Macrovariable for return of subfolder path was not declared by a %nrstr(%%)local-statement.;
67  %RETURN;
68  %end;
69 
70  %let l_scnid_string =_%sysfunc(putn (&i_scnid,z3.))_%sysfunc(putn (&i_casid.,z3.))_%sysfunc (putn (&i_tstid.,z3.));
71  %let l_subfoldername=&l_scnid_string._%lowcase(&i_assertType.);
72  %let &r_path.=%_abspath (i_root=&i_root., i_path=&l_subfoldername.);
73 %mend;