SASUnit Examples  Version 1.2
initsasunit.sas
Go to the documentation of this file.
1 
44 /* change log
45  29.01.2013 KL changed link from _sasunit_doc.sas to Sourceforge SASUnit User's Guide
46  08.01.2013 KL Fixed warning concerning %substr arguments. This was caused by the last call in run_all.sas.
47  To remove the entry for i_autoexec, a real blank must be passed. So there is now a different
48  method used for check on empty parameter which now must include a real blank as empty.
49 */
50 
51 
52 %MACRO initSASUnit(
53  i_root =
54  ,io_target =
55  ,i_overwrite = 0
56  ,i_project =
57  ,i_sasunit =
58  ,i_sasautos =
59  ,i_sasautos1 =
60  ,i_sasautos2 =
61  ,i_sasautos3 =
62  ,i_sasautos4 =
63  ,i_sasautos5 =
64  ,i_sasautos6 =
65  ,i_sasautos7 =
66  ,i_sasautos8 =
67  ,i_sasautos9 =
68  ,i_autoexec =
69  ,i_sascfg =
70  ,i_sasuser =
71  ,i_testdata =
72  ,i_refdata =
73  ,i_doc =
74 );
75 %LOCAL l_macname; %LET l_macname=&sysmacroname;
76 %LOCAL l_first_temp;
77 
78 /*-- Resolve relative root path like .../. to an absolute root path ----------*/
79 libname _tmp "&i_root.";
80 %let i_root=%sysfunc (pathname(_tmp));
81 libname _tmp clear;
82 
83 /*-- initialize error --------------------------------------------------------*/
84 %_sasunit_initErrorHandler;
85 
86 /*-- check for operation system ----------------------------------------------*/
87 %IF %_sasunit_handleError( &l_macname
88  , WrongOS
89  , (&sysscp. NE WIN) AND (&sysscp. NE LINUX)
90  , Invalid operating system - only WIN and LINUX)
91 %THEN %GOTO errexit;
92 
93 /*-- set macro symbols for os commands ---------------------------------------*/
94 %_sasunit_oscmds;
95 
96 /*-- check SAS version -------------------------------------------------------*/
97 %IF %_sasunit_handleError( &l_macname
98  , WrongVer
99  , (&sysver. NE 9.1) AND (&sysver. NE 9.2) AND (&sysver. NE 9.3)
100  , Invalid SAS version - only SAS 9.1 to 9.3)
101 %THEN %GOTO errexit;
102 
103 /*-- check for target directory ----------------------------------------------*/
104 %LOCAL l_target_abs;
105 %LET l_target_abs=%_sasunit_abspath(&i_root,&io_target);
106 %IF %_sasunit_handleError(&l_macname, InvalidTargetDir,
107  "&l_target_abs" EQ "" OR NOT %_sasunit_existDir(&l_target_abs),
108  Error in parameter io_target: target directory does not exist)
109  %THEN %GOTO errexit;
110 
111 LIBNAME target "&l_target_abs";
112 %IF %_sasunit_handleError(&l_macname, ErrorTargetLib,
113  %quote(&syslibrc) NE 0,
114  Error in parameter io_target: target directory &l_target_abs. cannot be assigned as a SAS library)
115  %THEN %GOTO errexit;
116 data target._test;
117 run;
118 %IF %_sasunit_handleError(&l_macname, ErrorTargetLibNotWritable,
119  %quote(&syserr) NE 0,
120  Error in parameter io_target: target directory not writeable)
121  %THEN %GOTO errexit;
122 PROC SQL;
123  DROP TABLE target._test;
124 QUIT;
125 
126 /*-- does the test database exist already? -----------------------------------*/
127 %LOCAL l_newdb;
128 %IF "&i_overwrite" NE "1" %then %LET i_overwrite=0;
129 %IF &i_overwrite %THEN %LET l_newdb=1;
130 %ELSE %LET l_newdb=%eval(NOT %sysfunc(exist(target.tsu)));
131 
132 /*-- create test database if necessary ---------------------------------------*/
133 %IF &l_newdb %THEN %DO;
134 PROC SQL NOPRINT;
135  CREATE TABLE target.tsu ( /* test suite */
136  tsu_project CHAR(255) /* see i_project */
137  ,tsu_root CHAR(255) /* see i_root */
138  ,tsu_target CHAR(255) /* see io_target */
139  ,tsu_sasunit CHAR(255) /* see i_sasunit */
140  ,tsu_sasautos CHAR(255) /* see i_sasautos */
141 %DO i=1 %TO 9;
142  ,tsu_sasautos&i CHAR(255) /* see i_sasautos<n> */
143 %END;
144  ,tsu_autoexec CHAR(255) /* see i_autoexec */
145  ,tsu_sascfg CHAR(255) /* see i_sascfg */
146  ,tsu_sasuser CHAR(255) /* see i_sasuser */
147  ,tsu_testdata CHAR(255) /* see i_testdata */
148  ,tsu_refdata CHAR(255) /* see i_refdata */
149  ,tsu_doc CHAR(255) /* see i_doc */
150  ,tsu_lastinit INT FORMAT=datetime21.2 /* date and time of last initialization */
151  ,tsu_lastrep INT FORMAT=datetime21.2 /* date and time of last report generation*/
152  );
153  INSERT INTO target.tsu VALUES (
154  "","","","","","","","","","","","","","","","","","","","",0,0
155  );
156 
157  CREATE TABLE target.scn ( /* test scenario */
158  scn_id INT FORMAT=z3. /* number of scenario */
159  ,scn_path CHAR(255) /* path to program file */
160  ,scn_desc CHAR(255) /* description of program (brief tag in comment header) */
161  ,scn_start INT FORMAT=datetime21.2 /* starting date and time of the last run */
162  ,scn_end INT FORMAT=datetime21.2 /* ending date and time of the last run */
163  ,scn_rc INT /* return code of SAS session of last run */
164  ,scn_errorcount INT /* number of detected errors in the scenario log */
165  ,scn_warningcount INT /* number of detected warnings in the scenario log */
166  ,scn_res INT /* overall test result of last run: 0 .. OK, 1 .. not OK, 2 .. manual */
167  );
168  CREATE TABLE target.cas ( /* test case */
169  cas_scnid INT FORMAT=z3. /* reference to test scenario */
170  ,cas_id INT FORMAT=z3. /* sequential number of test case within test scenario */
171  ,cas_auton INT /* number of autocall path where program under test has been found or ., if not found */
172  ,cas_pgm CHAR(255) /* file name of program under test: only name if found in autocall paths, or fully qualified path otherwise */
173  ,cas_desc CHAR(255) /* description of test case */
174  ,cas_spec CHAR(255) /* optional: specification document, fully qualified path or only filename to be found in folder &g_doc */
175  ,cas_start INT FORMAT=datetime21.2 /* starting date and time of the last run */
176  ,cas_end INT FORMAT=datetime21.2 /* ending date and time of the last run */
177  ,cas_res INT /* overall test result of last run: 0 .. OK, 1 .. not OK, 2 .. manual */
178  );
179  CREATE TABLE target.tst ( /* Test */
180  tst_scnid INT FORMAT=z3. /* reference to test scenario */
181  ,tst_casid INT FORMAT=z3. /* reference to test case */
182  ,tst_id INT FORMAT=z3. /* sequential number of test within test case */
183  ,tst_type CHAR(32) /* type of test (name of assert macro) */
184  ,tst_desc CHAR(255) /* description of test */
185  ,tst_exp CHAR(255) /* expected result */
186  ,tst_act CHAR(255) /* actual result */
187  ,tst_res INT /* test result of the last run: 0 .. OK, 1 .. not OK, 2 .. manual */
188  );
189 QUIT;
190 %IF %_sasunit_handleError(&l_macname, ErrorCreateDB,
191  &syserr NE 0,
192  Error on creation of test database)
193  %THEN %GOTO errexit;
194 
195 
196 /*-- regenerate empty folders ------------------------------------------------*/
197 DATA _null_;
198  FILE "%sysfunc(pathname(work))/x.cmd" encoding=pcoem850;/* wg. Umlauten in Pfaden */
199  PUT "&g_removedir ""&l_target_abs/log""&g_endcommand";
200  PUT "&g_removedir ""&l_target_abs/tst""&g_endcommand";
201  PUT "&g_removedir ""&l_target_abs/rep""&g_endcommand";
202  PUT "&g_makedir ""&l_target_abs/log""&g_endcommand";
203  PUT "&g_makedir ""&l_target_abs/tst""&g_endcommand";
204  PUT "&g_makedir ""&l_target_abs/rep""&g_endcommand";
205 RUN;
206 %if &sysscp. = LINUX %then %do;
207  %_sasunit_xcmd(chmod u+x "%sysfunc(pathname(work))/x.cmd")
208 %end;
209 %_sasunit_xcmd("%sysfunc(pathname(work))/x.cmd")
210 %LOCAL l_rc;
211 %LET l_rc=_sasunit_delfile(%sysfunc(pathname(work))/x.cmd);
212 
213 %END; /* %if &l_newdb */
214 
215 /*-- check folders -----------------------------------------------------------*/
216 %IF %_sasunit_handleError(&l_macname, NoLogDir,
217  NOT %_sasunit_existdir(&l_target_abs/log),
218  folder &l_target_abs/log does not exist)
219  %THEN %GOTO errexit;
220 %IF %_sasunit_handleError(&l_macname, NoTstDir,
221  NOT %_sasunit_existdir(&l_target_abs/tst),
222  folder &l_target_abs/tst does not exist)
223  %THEN %GOTO errexit;
224 %IF %_sasunit_handleError(&l_macname, NoRepDir,
225  NOT %_sasunit_existdir(&l_target_abs/rep),
226  folder &l_target_abs/rep does not exist)
227  %THEN %GOTO errexit;
228 PROC SQL NOPRINT;
229  UPDATE target.tsu SET tsu_target = "&io_target";
230 QUIT;
231 
232 /*-- project name ------------------------------------------------------------*/
233 %LOCAL l_project;
234 PROC SQL NOPRINT;
235  SELECT tsu_project INTO :l_project FROM target.tsu;
236 QUIT;
237 %LET l_project=&l_project;
238 %IF "&i_project" NE "" %THEN %LET l_project=&i_project;
239 %IF %_sasunit_handleError(&l_macname, MissingProjectName,
240  "&l_project" EQ "",
241  Parameter i_project must be specified)
242  %THEN %GOTO errexit;
243 PROC SQL NOPRINT;
244  UPDATE target.tsu SET tsu_project = "&l_project";
245 QUIT;
246 
247 /*-- root folder -------------------------------------------------------------*/
248 %LOCAL l_root;
249 PROC SQL NOPRINT;
250  SELECT tsu_root INTO :l_root FROM target.tsu;
251 QUIT;
252 %LET l_root=&l_root;
253 %IF "&i_root" NE "" %THEN %LET l_root=&i_root;
254 %IF %_sasunit_handleError(&l_macname, InvalidRoot,
255  "&l_root" NE "" AND NOT %_sasunit_existdir(&l_root),
256  %str(Error in parameter i_root: folder must exist when specified))
257  %THEN %GOTO errexit;
258 PROC SQL NOPRINT;
259  UPDATE target.tsu SET tsu_root = "&l_root";
260 QUIT;
261 
262 /*-- sasunit folder ----------------------------------------------------------*/
263 %LOCAL l_sasunit l_sasunit_abs;
264 PROC SQL NOPRINT;
265  SELECT tsu_sasunit INTO :l_sasunit FROM target.tsu;
266 QUIT;
267 %LET l_sasunit=&l_sasunit;
268 %IF "&i_sasunit" NE "" %THEN %LET l_sasunit=&i_sasunit;
269 %LET l_sasunit_abs=%_sasunit_abspath(&l_root,&l_sasunit);
270 %IF %_sasunit_handleError(&l_macname, InvalidSASUnitDir,
271  "&l_sasunit_abs" EQ "" OR NOT %sysfunc(fileexist(&l_sasunit_abs/_sasunit_scenario.sas)),
272  Error in parameter i_sasunit: SASUnit macro programs not found)
273  %THEN %GOTO errexit;
274 PROC SQL NOPRINT;
275  UPDATE target.tsu SET tsu_sasunit = "&l_sasunit";
276 QUIT;
277 
278 /*-- check if autoexec exists where specified --------------------------------*/
279 %LOCAL l_autoexec l_autoexec_abs;
280 PROC SQL NOPRINT;
281  SELECT tsu_autoexec INTO :l_autoexec FROM target.tsu;
282 QUIT;
283 %LET l_autoexec=&l_autoexec;
284 %*** because we need to specify a real blank (%str( )) as parameter, ***;
285 %*** we need to use a different method of assignment. ***;
286 %IF "&i_autoexec" NE "" %THEN %LET l_autoexec=%trim(&i_autoexec);
287 %LET l_autoexec_abs=%_sasunit_abspath(&l_root,&l_autoexec);
288 %IF %_sasunit_handleError(&l_macname, AutoexecNotFound,
289  "&l_autoexec" NE "" AND NOT %sysfunc(fileexist(&l_autoexec_abs%str( ))),
290  Error in parameter i_autoexec: file not found)
291  %THEN %GOTO errexit;
292 PROC SQL NOPRINT;
293  UPDATE target.tsu SET tsu_autoexec = "&l_autoexec";
294 QUIT;
295 
296 /*-- check if sascfg exists where specified ----------------------------------*/
297 %LOCAL l_sascfg l_sascfg_abs;
298 PROC SQL NOPRINT;
299  SELECT tsu_sascfg INTO :l_sascfg FROM target.tsu;
300 QUIT;
301 %LET l_sascfg=&l_sascfg;
302 %IF "&i_sascfg" NE "" %THEN %LET l_sascfg=&i_sascfg;
303 %LET l_sascfg_abs=%_sasunit_abspath(&l_root,&l_sascfg);
304 %IF %_sasunit_handleError(&l_macname, SASCfgNotFound,
305  "&l_sascfg" NE "" AND NOT %sysfunc(fileexist(&l_sascfg_abs%str( ))),
306  Error in parameter i_sascfg: file not found)
307  %THEN %GOTO errexit;
308 PROC SQL NOPRINT;
309  UPDATE target.tsu SET tsu_sascfg = "&l_sascfg";
310 QUIT;
311 
312 /*-- check sasuser folder ----------------------------------------------------*/
313 %LOCAL l_sasuser l_sasuser_abs;
314 PROC SQL NOPRINT;
315  SELECT tsu_sasuser INTO :l_sasuser FROM target.tsu;
316 QUIT;
317 %LET l_sasuser=&l_sasuser;
318 %IF "&i_sasuser" NE "" %THEN %LET l_sasuser=&i_sasuser;
319 %LET l_sasuser_abs=%_sasunit_abspath(&l_root,&l_sasuser);
320 %IF %_sasunit_handleError(&l_macname, InvalidSasuser,
321  "&l_sasuser_abs" NE "" AND NOT %_sasunit_existdir(&l_sasuser_abs),
322  Error in parameter i_sasuser: folder not found)
323  %THEN %GOTO errexit;
324 PROC SQL NOPRINT;
325  UPDATE target.tsu SET tsu_sasuser = "&l_sasuser";
326 QUIT;
327 
328 /*-- check test data folder --------------------------------------------------*/
329 %LOCAL l_testdata l_testdata_abs;
330 PROC SQL NOPRINT;
331  SELECT tsu_testdata INTO :l_testdata FROM target.tsu;
332 QUIT;
333 %LET l_testdata=&l_testdata;
334 %IF "&i_testdata" NE "" %THEN %LET l_testdata=&i_testdata;
335 %LET l_testdata_abs=%_sasunit_abspath(&l_root,&l_testdata);
336 %IF %_sasunit_handleError(&l_macname, InvalidTestdata,
337  "&l_testdata_abs" NE "" AND NOT %_sasunit_existdir(&l_testdata_abs),
338  Error in parameter i_testdata: folder not found)
339  %THEN %GOTO errexit;
340 PROC SQL NOPRINT;
341  UPDATE target.tsu SET tsu_testdata = "&l_testdata";
342 QUIT;
343 
344 /*-- check reference data folder ---------------------------------------------*/
345 %LOCAL l_refdata l_refdata_abs;
346 PROC SQL NOPRINT;
347  SELECT tsu_refdata INTO :l_refdata FROM target.tsu;
348 QUIT;
349 %LET l_refdata=&l_refdata;
350 %IF "&i_refdata" NE "" %THEN %LET l_refdata=&i_refdata;
351 %LET l_refdata_abs=%_sasunit_abspath(&l_root,&l_refdata);
352 %IF %_sasunit_handleError(&l_macname, InvalidRefdata,
353  "&l_refdata_abs" NE "" AND NOT %_sasunit_existdir(&l_refdata_abs),
354  Error in parameter i_refdata: folder not found)
355  %THEN %GOTO errexit;
356 PROC SQL NOPRINT;
357  UPDATE target.tsu SET tsu_refdata = "&l_refdata";
358 QUIT;
359 
360 /*-- check folder for specification documents --------------------------------*/
361 %LOCAL l_doc l_doc_abs;
362 PROC SQL NOPRINT;
363  SELECT tsu_doc INTO :l_doc FROM target.tsu;
364 QUIT;
365 %LET l_doc=&l_doc;
366 %IF "&i_doc" NE "" %THEN %LET l_doc=&i_doc;
367 %LET l_doc_abs=%_sasunit_abspath(&l_root,&l_doc);
368 %IF %_sasunit_handleError(&l_macname, InvalidDoc,
369  "&l_doc_abs" NE "" AND NOT %_sasunit_existdir(&l_doc_abs),
370  Error in parameter i_doc: folder not found)
371  %THEN %GOTO errexit;
372 PROC SQL NOPRINT;
373  UPDATE target.tsu SET tsu_doc = "&l_doc";
374 QUIT;
375 
376 /*-- check autocall paths ----------------------------------------------------*/
377 %LOCAL restore_sasautos l_sasautos l_sasautos_abs i;
378 %LET restore_sasautos=%sysfunc(getoption(sasautos));
379 
380 PROC SQL NOPRINT;
381  SELECT tsu_sasautos INTO :l_sasautos FROM target.tsu;
382 QUIT;
383 %LET l_sasautos=&l_sasautos;
384 %IF "&i_sasautos" NE "" %THEN %LET l_sasautos=&i_sasautos;
385 %LET l_sasautos_abs=%_sasunit_abspath(&l_root,&l_sasautos);
386 %IF %_sasunit_handleError(&l_macname, InvalidSASAutos,
387  "&l_sasautos_abs" NE "" AND NOT %_sasunit_existdir(&l_sasautos_abs),
388  Error in parameter i_sasautos: folder not found)
389  %THEN %GOTO errexit;
390 PROC SQL NOPRINT;
391  UPDATE target.tsu SET tsu_sasautos = "&l_sasautos";
392 QUIT;
393 
394 %DO i=1 %TO 9;
395 PROC SQL NOPRINT;
396  SELECT tsu_sasautos&i INTO :l_sasautos FROM target.tsu;
397 QUIT;
398 %LET l_sasautos=&l_sasautos;
399 %IF "&&i_sasautos&i" NE "" %THEN %LET l_sasautos=&&i_sasautos&i;
400 %LET l_sasautos_abs=%_sasunit_abspath(&l_root,&l_sasautos);
401 %IF %_sasunit_handleError(&l_macname, InvalidSASAutosN,
402  "&l_sasautos_abs" NE "" AND NOT %_sasunit_existdir(&l_sasautos_abs),
403  Error in parameter i_sasautos&i: folder not found)
404  %THEN %GOTO errexit;
405 PROC SQL NOPRINT;
406  UPDATE target.tsu SET tsu_sasautos&i = "&l_sasautos";
407 QUIT;
408 %END; /* i=1 %TO 9 */
409 
410 /*-- load relevant information from test database to global macro symbols ----*/
411 %_sasunit_loadEnvironment (
412  i_withLibrefs = 0
413 )
414 %IF "&g_error_code" NE "" %THEN %GOTO errexit;
415 
416 %if &sysscp. = WIN %then %do;
417  /*-- options for OS commands ----------------------------------------------*/
418  options noxwait xsync xmin;
419 %end;
420 
421 /*-- check spawning of a SAS process -----------------------------------------*/
422 /* a file will be created in the work library of the parent (this) process
423  to check whether spawning works */
424 %LOCAL l_work;
425 %LET l_work = %sysfunc(pathname(work));
426 PROC DATASETS NOLIST NOWARN LIB=work;
427  DELETE check;
428 QUIT;
429 
430 DATA _null_;
431  FILE "%sysfunc(pathname(work))/x.cmd";
432  PUT "&g_removedir ""%sysfunc(pathname(work))/sasuser""&g_endcommand";
433  PUT "&g_makedir ""%sysfunc(pathname(work))/sasuser""&g_endcommand";
434 %IF %length(&g_sasuser) %THEN %DO;
435  PUT "&g_copydir ""&g_sasuser"" ""%sysfunc(pathname(work))/sasuser""&g_endcommand";
436 %END;
437 RUN;
438 %if &sysscp. = LINUX %then %do;
439  %_sasunit_xcmd(chmod u+x "%sysfunc(pathname(work))/x.cmd")
440 %end;
441 %_sasunit_xcmd("%sysfunc(pathname(work))/x.cmd")
442 %LOCAL l_rc;
443 %LET l_rc=_sasunit_delfile(%sysfunc(pathname(work))/x.cmd);
444 
445 DATA _null_;
446  FILE "&l_work/run.sas";
447  PUT "LIBNAME awork ""&l_work"";";
448  PUT "DATA awork.check; RUN;";
449 RUN;
450 %LOCAL l_parms;
451 %IF "&g_autoexec" NE "" %THEN %DO;
452  %LET l_parms=&l_parms -autoexec ""&g_autoexec"";
453 %END;
454 %IF "&g_sascfg" NE "" %THEN %DO;
455  %IF &sysscp. = LINUX %THEN %DO;
456  %IF "&g_sascfg" NE "" %THEN %DO;
457  options SET=SASCFGPATH "&g_sascfg.";
458  %END;
459  %END;
460  %ELSE %DO;
461  %LET l_parms=&l_parms -config ""&g_sascfg"";
462  %END;
463 %END;
464 
465 
466 DATA _null_;
467  ATTRIB
468  _sCmdString LENGTH = $32000
469  ;
470  FILE
471  "%sysfunc(pathname(work))/xxx.cmd"
472  LRECL=32000
473  ;
474 %IF &sysscp. = LINUX %THEN %DO;
475  _sCmdString =
476  "" !! &g_sasstart.
477  !! " "
478  !! "&l_parms. "
479  !! "-sysin &l_work./run.sas "
480  !! "-initstmt ""%nrstr(%%_sasunit_scenario%(io_target=)&g_target%nrstr(%);)"" "
481  !! "-log &g_log./000.log "
482  !! "-print &g_log./000.lst "
483  !! "-noovp "
484  !! "-nosyntaxcheck "
485  !! "-mautosource "
486  !! "-mcompilenote all "
487  !! "-sasautos &g_sasunit "
488  !! "-sasuser %sysfunc(pathname(work))/sasuser "
489  !! "";
490 %END;
491 %ELSE %DO;
492  _sCmdString =
493  """" !! &g_sasstart !! """"
494  !! " "
495  !! "&l_parms. "
496  !! "-sysin ""&l_work./run.sas"" "
497  !! "-initstmt ""%nrstr(%%%_sasunit_scenario%(io_target=)&g_target%nrstr(%);)"" "
498  !! "-log ""&g_log./000.log"" "
499  !! "-print ""&g_log./000.lst"" "
500  !! "&g_splash "
501  !! "-noovp "
502  !! "-nosyntaxcheck "
503  !! "-mautosource "
504  !! "-mcompilenote all "
505  !! "-sasautos ""&g_sasunit"" "
506  !! "-sasuser ""%sysfunc(pathname(work))/sasuser"" "
507  !! "";
508 %END;
509  PUT _sCmdString
510  ;
511 RUN;
512 
513 %IF &sysscp. = LINUX %THEN %DO;
514  %_sasunit_xcmd(chmod u+x "%sysfunc(pathname(work))/xxx.cmd");
515  %_sasunit_xcmd(sed -i -e 's/\r//g' %sysfunc(pathname(work))/xxx.cmd);
516 %END;
517 
518 %_sasunit_xcmd("%sysfunc(pathname(work))/xxx.cmd")
519 %LET l_rc=_sasunit_delfile(%sysfunc(pathname(work))/xxx.cmd);
520 %LET l_sysrc = &sysrc;
521 
522 %IF %_sasunit_handleError(&l_macname, ErrorSASCall2,
523  NOT %sysfunc(exist(work.check)),
524  Error spawning SAS process in initialization)
525  %THEN %GOTO errexit;
526 
527 PROC DATASETS NOLIST NOWARN LIB=work;
528  DELETE check;
529 QUIT;
530 
531 %LET l_rc=%_sasunit_delFile(&l_work/run.sas);
532 
533 /*-- save time of initialization ---------------------------------------------*/
534 PROC SQL NOPRINT;
535  UPDATE target.tsu
536  SET tsu_lastinit = %sysfunc(datetime())
537  ;
538 QUIT;
539 
540 %PUT;
541 %PUT ============================ SASUnit has been initialized successfully ==========================;
542 %PUT;
543 
544 %GOTO exit;
545 %errexit:
546  %PUT;
547  %PUT &g_error: ===================== Error! Testsuite aborted! ===========================================;
548  %PUT;
549  LIBNAME target;
550 %exit:
551 %MEND initSASUnit;