MCOVERAGE system option
controls the generation of
coverage analysis data, which is information needed to ensure proper testing of SAS Solutions
products before their release.
The format of the coverage
analysis data is a space delimited flat text file that contains three
types of records. Each record begins with a numeric record type. The
line numbers in the data are relative line numbers based on the %MACRO
keyword used to define the macro. You must use the MCOVERAGELOC= system
option to specify the location of the coverage analysis data file.
See MCOVERAGELOC= System Option.
Note: Because nested macro definitions
are stored as model text with line breaks collapsed, it is recommended
that nested macro definitions not be used in macro definitions that
will later be analyzed for execution coverage.
Below are explanations
for each of the three record types.
Record type 1 indicates
the beginning of the execution of a macro. Record type 1 appears once
for each invocation of a macro.
Record type 2 indicates
the lines of a macro that have executed. A single line of a macro
might cause more than one record to be generated.
Record type 3 indicates
which lines of the macro cannot be executed because no code was generated
from them. These lines might be either commentary lines or lines that
cause no macro code to be generated.
The following is a sample
program log:
Sample Program Log:
NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.3 (TS1B0)
Licensed to SAS Institute Inc., Site 1.
NOTE: This session is executing on the XP_PRO platform.
NOTE: SAS initialization used:
real time 0.45 seconds
cpu time 0.20 seconds
1 options source source2;
2
3 options mcoverage mcoverageloc='./foo.dat';
4
5 /* 1 */ %macro
6 /* 2 */ foo (
7 /* 3 */ arg,
8 /* 4 */
9 /* 5 */
10 /* 6 */ arg2
11 /* 7 */
12 /* 8 */
13 /* 9 */ =
14 /* 10 */
15 /* 11 */ This is the default value of arg2)
16 /* 12 */ ;
17 /* 13 */ /* This is a number of lines of comments */
18 /* 14 */ /* which presumably will help the maintainer */
19 /* 15 */ /* of this macro to know what to do to keep */
20 /* 16 */ /* this silly piece of code current */
21 /* 17 */ %if &arg %then %do;
22 /* 18 */ data _null_;
23 /* 19 */ x=1;
24 /* 20 */ %end;
25 /* 21 */ %* this is a macro comment statement
26 /* 22 */ that also can be used to document features
27 /* 23 */ and other stuff about the macro;
28 /* 24 */ %else
29 /* 25 */ %do;
30 /* 26 */ DATA _NULL_;
31 /* 27 */ y=1;
32 /* 28 */ %end;
33 /* 29 */ run;
34 /* 30 */
35 /* 31 */
36 /* 32 */
37 /* 33 */
38 /* 34 */
39 /* 35 */ %mend
40 /* 36 */
41 /* 37 */
42 /* 38 */
43 /* 39 */
44 /* 40 */
45 /* 41 */
46 /* 42 */
47 /* 43 */ foo This is text which should generate a warning! ;
WARNING: Extraneous information on %MEND statement ignored for macro
definition FOO.