Sunday, April 20, 2008

Using java to debug COBOL (with or without "reflection")

A reader tells me that it is possible to build a debugging interface for COBOL in java. He mentions building a java class that maintains a TCP/IP connection to a debugging client.

He says that the “ADDRESS OF” special register for COBOL does not adequately simulate the concept of “reflection” in java, the ability to provide the value of associated with a variable name in a string. It seems that in a normal CICS environment, the ADDRESS OF mechanism with XPEDITER would give the programmer the ability to track anything. The reader says he wants to get offsets from BLL and BLW from the TGT area, but that depends on being able to track back to Register 13, which he says cannot be done in COBOL. The environment is OMVS/USS

SUN has a writeup on java “reflection” here.
Sun writes “For example, there is no way in a Pascal, C, or C++ program to obtain information about the functions defined within that program” and that would seem to be true of COBOL except for what can be derived by manipulating ADDRESS OF. I seem to recall that this was an issue with some “direct connect” applications.

If someone knows about using java to look at the internal addresses associated with COBOL work areas on various platforms, please feel free to comment.

No comments: