Follow

Use Runtime Tracing

Introduction

Elastic COBOL Runtime Tracing is an internal runtime facility that provides tracing information with contextual data.

Tracing covers COBOL paragraphs/sections, calls, performs, gotos, and file i/o & SQL i/o operations.

Options

Tracing is enabled with compiler directives. Tracing information can be controlled at runtime using environment variables.

Compiler directives (can be combined):

  • -run:trace -- activates trace for PARAGRAPH/SECTION, CALL, GOTO, PERFORM and FILE I/O & SQL I/O operations
  • -run:tracepara -- activates trace for PARAGRAPH & SECTION only
  • -run:tracecall -- activates trace for CALL only
  • -run:tracegoto -- activates trace for GOTO only
  • -run:traceperf -- activates trace for PERFORM only
  • -run:traceio -- activates trace for FILE I/O operations only
  • -run:tracesql -- activates trace for SQL I/O operations only

Runtime settings (can be set in cblconfig and/or environment):

  • RUN_TRACE=0|1 -- turns 'trace' on/off
  • RUN_TRACEPARA=0|1 -- turns 'tracepara' on/off
  • RUN_TRACECALL=0|1 -- turns 'tracecall' on/off
  • RUN_TRACEGOTO=0|1 -- turns 'tracegoto' on/off
  • RUN_TRACEPERF=0|1 -- turns 'traceperf' on/off
  • RUN_TRACEIO=0|1 -- turns 'traceio' on/off
  • RUN_TRACESQL=0|1 -- turns 'tracesql' on/off

Use Examples

$ ecobol -run:trace a.cbl b.cbl c.cbl
Elastic COBOL V14.6.13 Copyright (C) 2010-2014 Heirloom Computing
LOC: 51 (11 variables in 8 records)
Warnings: 0
Errors: 0
Result: Compilation SUCCESSFUL
Building: Class files
$ java a
PROG=[a] PARA=[A-PARA OF A-SECTION] SOURCE=[a.cbl]
CALL=[b:literal] USING=[(null)]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
CALL=[c:literal] USING=[lnk.b_item]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
CALL=[b:wrk.b_name] USING=[wrk.a_item,wrk.b_item] GIVING=[wrk.x_item]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
CALL=[c:literal] USING=[lnk.b_item]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
CALL=[c:literal] USING=["fred","bill","jane"]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
CALL=[b:wrk.c_name] USING=["123","456","78.9"]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
CALL=[c:literal] USING=[lnk.b_item]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
CALL=[c:wrk.c_name] USING=[wrk.x_item,"STRING"]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[a] PARA=[A-EXIT OF A-SECTION] SOURCE=[a.cbl]
CALL=[M$ALLOC:literal] USING=["1048576",wrk.p_item]
$ export RUN_TRACE=0
$ java a
[no output]
$ unset RUN_TRACE
$ export RUN_TRACEPARA=0
$ java a
CALL=[b:literal] USING=[(null)]
CALL=[c:literal] USING=[lnk.b_item]
CALL=[b:wrk.b_name] USING=[wrk.a_item,wrk.b_item] GIVING=[wrk.x_item]
CALL=[c:literal] USING=[lnk.b_item]
CALL=[c:literal] USING=["fred","bill","jane"]
CALL=[b:wrk.c_name] USING=["123","456","78.9"]
CALL=[c:literal] USING=[lnk.b_item]
CALL=[c:wrk.c_name] USING=[wrk.x_item,"STRING"]
CALL=[M$ALLOC:literal] USING=["1048576",wrk.p_item]
$ unset RUN_TRACEPARA
$ export RUN_TRACECALL=0
$ java a
PROG=[a] PARA=[A-PARA OF A-SECTION] SOURCE=[a.cbl]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[b] PARA=[B-PARA OF B-SECTION] SOURCE=[b.cbl]
PROG=[b] PARA=[B1-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[b] PARA=[B2-PARA OF B-EXTENDED] SOURCE=[b.cbl]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[c] PARA=[C-PARA OF C-SECTION] SOURCE=[c.cbl]
PROG=[a] PARA=[A-EXIT OF A-SECTION] SOURCE=[a.cbl]
$ export RUN_TRACE=0
$ export RUN_TRACECALL=1
$ java a
[no output -- RUN_TRACE overrides all other settings]
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk