Stata 15 help for trace

[P] trace -- Debug Stata programs


Whether to trace execution of programs

set trace { on | off }

Show # levels in tracing nested programs

set tracedepth #

Whether to show the lines after macro expansion

set traceexpand { on | off } [, permanently ]

Whether to display horizontal separator lines

set tracesep { on | off } [, permanently ]

Whether to indent lines according to nesting level

set traceindent { on | off } [, permanently ]

Whether to display nesting level

set tracenumber { on | off } [, permanently ]

Highlight pattern in trace output

set tracehilite "pattern" [, word ]


set trace on traces the execution of programs for debugging. set trace off turns off tracing after it has been set on.

set tracedepth specifies how many levels to descend in tracing nested programs. The default is 32000, which is equivalent to infinity.

set traceexpand indicates whether the lines before and after macro expansion are to be shown. The default is on.

set tracesep indicates whether to display a horizontal separator line that displays the name of the subroutine whenever a subroutine is entered or exited. The default is on. {pstd} set traceindent indicates whether displayed lines of code should be indented according to the nesting level. The default is on. {pstd} set tracenumber indicates whether the nesting level should be displayed at the beginning of the line. Lines in the main program are preceded with 01; lines in subroutines called by the main program, with 02; etc. The default is off. {pstd} set tracehilite causes the specified pattern to be highlighted in the trace output.

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index