Question
· Aug 3, 2017

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

Discussion (5)0
Log in or sign up to continue

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.