How do you get the 'Array Value' in the ZBREAK trace option?

I am running a ZBREAK trace on a legacy FDBMS application that uses arrays but rather than displaying the array value contents, I am seeing logs similar to the following.

Trace: ZBREAK SET LINE=Array Val at BIOPWR+6^BIOPWR

My ZBREAK trace settings are as follows: 

ZBREAK /TRACE:ON:"/somedir/trace1.log"
ZBREAK *LINE:"T"

The 'LINE' array has a single integer subscript and some string data. The subscript is sometimes calculated using arbitrary calculations such as S LINE(I-33)="BLAH BLAH BLAH". This makes the code very difficult to read and debug. Is there an easy way to replace the 'Array Val' in the trace log with the actual value of the array? I'm looking for something similar to the following output.

Trace: ZBREAK SET LINE(1)="LINE1 TEXT" at BIOPWR+6^BIOPWR
Trace: ZBREAK SET LINE(2)="LINE2 TEXT" at BIOPWR+6^BIOPWR
Trace: ZBREAK SET LINE(3)="LINE3 TEXT" at BIOPWR+6^BIOPWR

 

 

 

  • 0
  • 0
  • 179
  • 2
  • 3

Answers

One possible answer is the following:

ZBREAK *LINE:"T"::"ZWRITE LINE(I)"

This will write the value to the TRACE device, which is a log file in my case. Not sure how to handle arbitrary subscript calculations like ZWRITE LINE(I+3) but this is close to what I'm looking for. Any other suggestions/comments are welcome.

I don't know of a way to alter the trace output of ZBREAK. But have you considered using Serenji to help with this debugging task? Its ability to break when an expression's value changes may be helpful.

Since you said it's arbitrary, where did you get that +3? Is that a constant or variable value?
Maybe if you update your line to:

ZBREAK *LINE:"T"::"ZWRITE LINE(I+C)"

 

Where C should be your other arbitrary data (but provided as variable as well).

The I+3 is a hard-coded expression. At first it appears arbitrary or random. I have just taken +3 as an example. We have real-world examples of expressions like 

When some condition is met 
LINE(I-8)="some value"

When another condition is met
LINE(I-17)="some value"

The hard-coded offset does not come from a variable. A lack of comments in the code makes it very difficult to understand and debug.

The hard-coded offset does not come from a variable. A lack of comments in the code makes it very difficult to understand and debug.

No wonder...  Maybe you could use Studio or Atelier debugger to verify their values. Unless you need that log file of course.

Maybe you could also use break instead, just before the routine ends. And zwrite the context variables manually within the terminal.

I still don't know exactly what you want to achieve neither what are your limitations, I only know that you want to see the content from LINE, so I might be speaking something unnecessary.