21 %MACRO _loadEnvironment(i_withlibrefs = 1
24 %LOCAL l_macname; %LET l_macname=&sysmacroname;
26 %GLOBAL g_sasunitroot g_target g_project g_root g_sasunit g_sasunit_os g_autoexec g_sascfg g_sasuser
27 g_sasautos g_sasautos0 g_sasautos1 g_sasautos2 g_sasautos3 g_sasautos4
28 g_sasautos5 g_sasautos6 g_sasautos7 g_sasautos8 g_sasautos9
29 g_testdata g_refdata g_doc g_error g_warning g_note
30 g_work g_testout g_log g_logfile g_printfile
31 g_testcoverage g_verbose g_crossref g_crossrefsasunit g_rep_encoding
36 %LET g_target = %sysfunc(pathname(target));
38 %*** Both macvars are dependent on scenario and testcase, values can only be assigned later ***;
42 %IF %_handleError(&l_macname.
44 ,%_nobs(target.tsu) NE 1
45 ,invalid test database: target.tsu
49 %IF %_handleError(&l_macname.
51 ,NOT %sysfunc(exist(target.cas))
52 ,invalid test database: target.cas
56 %IF %_handleError(&l_macname.
58 ,NOT %sysfunc(exist(target.scn))
59 ,invalid test database: target.scn
63 %IF %_handleError(&l_macname.
65 ,NOT %sysfunc(exist(target.tst))
66 ,invalid test database: target.tst
72 call symput (
'g_project' , tsu_project);
73 call symput (
'g_root' , tsu_root);
74 call symput (
'g_sasunitroot' , tsu_sasunitroot);
75 call symput (
'g_sasunit' , tsu_sasunit);
76 call symput (
'g_sasunit_os' , tsu_sasunit_os);
77 call symput (
'g_sasautos' , tsu_sasautos);
78 call symput (
'g_sasautos0' , tsu_sasautos);
80 call symput (
"g_sasautos&i" , tsu_sasautos&i);
82 call symput (
'g_autoexec' , tsu_autoexec);
83 call symput (
'g_sascfg' , tsu_sascfg);
84 call symput (
'g_sasuser' , tsu_sasuser);
85 call symput (
'g_testdata' , tsu_testdata);
86 call symput (
'g_refdata' , tsu_refdata);
87 call symput (
'g_doc' , tsu_doc);
88 call symput (
'g_testcoverage' , put (tsu_testcoverage, z1.));
89 call symput (
'g_verbose' , put (tsu_verbose, z1.));
90 call symput (
'g_crossref' , put (tsu_crossref, z1.));
91 call symput (
'g_crossrefsasunit', put (tsu_crossrefsasunit, z1.));
94 %LET g_project = &g_project;
95 %LET g_root = &g_root;
96 %LET g_sasunitroot = %_abspath(&g_root,&g_sasunitroot);
97 %LET g_sasunit = %_abspath(&g_root,&g_sasunit);
98 %LET g_sasunit_os = %_abspath(&g_root,&g_sasunit_os);
99 %LET g_sasautos = %_abspath(&g_root,&g_sasautos);
101 %LET g_sasautos&i = %_abspath(&g_root,&&g_sasautos&i);
103 %LET g_autoexec = %_abspath(&g_root,&g_autoexec);
104 %LET g_sascfg = %_abspath(&g_root,&g_sascfg);
105 %LET g_sasuser = %_abspath(&g_root,&g_sasuser);
106 %LET g_testdata = %_abspath(&g_root,&g_testdata);
107 %LET g_refdata = %_abspath(&g_root,&g_refdata);
108 %LET g_doc = %_abspath(&g_root,&g_doc);
109 %LET g_testcoverage = &g_testcoverage.;
110 %LET g_rep_encoding = UTF8;
112 %LET g_work = %sysfunc(pathname(work));
113 %LET g_testout = &g_target/tst;
114 %LET g_log = &g_target/log;
116 %_detectSymbols(r_error_symbol=g_error, r_warning_symbol=g_warning, r_note_symbol=g_note);
118 %IF &i_withlibrefs %THEN %DO;
119 LIBNAME testout
"&g_testout";
120 FILENAME testout
"&g_testout";
121 %IF %length(&g_testdata) %THEN %DO;
122 LIBNAME testdata
"&g_testdata";
123 FILENAME testdata
"&g_testdata";
124 %LET g_testdata = %sysfunc(pathname(testdata));
126 %IF %length(&g_refdata) %THEN %DO;
127 LIBNAME refdata
"&g_refdata";
128 FILENAME refdata
"&g_refdata";
129 %LET g_refdata = %sysfunc(pathname(refdata));
131 %IF %length(&g_doc) %THEN %DO;
132 FILENAME doc
"&g_doc";
136 OPTIONS MAUTOSOURCE SASAUTOS=(SASAUTOS
"&g_sasunit" "&g_sasunit_os"
138 %IF
"&&g_sasautos&i" NE
"" %THEN
"&&g_sasautos&i";
149 %MEND _loadEnvironment;