SASUnit Examples  Version 1.3.0
_scenario.sas
Go to the documentation of this file.
1 
21 %MACRO _scenario(io_target =
22  );
23 
24 %LOCAL l_macname;
25 
26 %LET l_macname=&sysmacroname;
27 
28 OPTIONS MAUTOSOURCE MPRINT LINESIZE=MAX;
29 
30 /* initialize error handling */
31 %_initErrorHandler;
32 
33 /* check for target directory*/
34 %IF %_handleError(&l_macname
35  ,InvalidTargetDir
36  ,"&io_target" EQ "" OR NOT %_existDir(&io_target)
37  ,target directory &io_target does not exist
38  )
39  %THEN %GOTO errexit;
40 
41 /* create libref for test database*/
42 LIBNAME target "&io_target";
43 %IF %_handleError(&l_macname
44  ,ErrorNoTargetDirLib
45  ,%quote(&syslibrc.) NE 0
46  ,test database cannot be opened
47  )
48  %THEN %GOTO errexit;
49 
50 /* set global macro symbols and librefs / filerefs */
51 /* includes creation of autocall paths */
52 %_loadEnvironment()
53 %IF &g_error_code NE %THEN %GOTO errexit;
54 
55 /* flag for test cases */
56 %GLOBAL g_inTestcase;
57 %LET g_inTestcase=0;
58 %_oscmds;
59 
60 %GOTO exit;
61 %errexit:
62  %PUT ========================== Error! Test scenario will be aborted! ================================;
63 LIBNAME target;
64 %exit:
65 %MEND _scenario;