33 %MACRO assertReport (i_expected =
35 ,i_desc = Compare documents
41 %IF &g_inTestcase EQ 1 %THEN %DO;
44 %ELSE %IF &g_inTestcase NE 2 %THEN %DO;
45 %PUT &g_error.(SASUNIT): assert must be called after initTestcase;
49 %LOCAL l_expected l_exp_ext l_rep_ext l_result l_casid l_tstid l_path l_errmsg;
51 %*** check parameters ***;
52 %LET l_rep_ext = %_getExtension(&i_actual);
54 %IF (
"&i_actual." EQ
"") %THEN %DO;
55 %LET l_errmsg = parameter i_actual is missing!;
60 %IF not (%sysfunc (fileexist(&i_actual.))) %THEN %DO;
61 %LET l_errmsg = File i_actual (&i_actual.) does not exist!;
66 %IF ("&i_expected." EQ "") %THEN %DO;
67 %LET l_errmsg = parameter i_expected is missing!;
70 %LET l_expected = %_abspath(&g_refdata,&i_expected);
71 %IF (%sysfunc (fileexist(&l_expected.))) %THEN %DO;
72 %LET l_exp_ext = %_getExtension(&l_expected);
78 %LET l_errmsg=Report was not created anew!;
81 %_dir(i_path=&i_actual, o_out=&d_dir)
84 if nobs ne 1 then stop;
85 if changed < dhms (today(), hour (input ("&systime",time5.)), minute (input ("&systime",time5.)), 0) then do;
88 call symput ('l_result', '1');
95 %IF NOT &i_manual AND &l_result=1 %THEN %LET l_result=0;
98 %_getScenarioTestId (i_scnid=&g_scnid, r_casid=l_casid, r_tstid=l_tstid);
100 %*** create subfolder ***;
101 %_createTestSubfolder (i_assertType =assertreport
109 %IF &l_rep_ext. NE %THEN %DO;
110 %_copyFile(&i_actual, &l_path./_man_act&l_rep_ext);
114 %IF &l_exp_ext. NE %THEN %DO;
115 %_copyFile(&l_expected, &l_path./_man_exp&l_exp_ext);
119 %_asserts(i_type = assertReport
120 ,i_expected = &l_exp_ext.
121 ,i_actual = &l_rep_ext.
123 ,i_result = &l_result.
126 ,i_errmsg = &l_errmsg.