On 22 Feb 2013 14:44, James H. H. Lampert wrote:
On 2/22/13 2:37 PM, Buck Calabro wrote:
On 2/22/2013 5:24 PM, James H. H. Lampert wrote:
Does anybody know of a way to dump the variables of an OPM
program (similar to the "RPG-formatted dump" option of an escape
message) without having to force it into an exception state?
OPM RPG put the debug option in the H spec and use the DUMP
keyword. OPM CL, use the DMPCLPGM command.
Problem is, it's an MI program. A huge one. While I can certainly
insert an instruction that will blow up, I was hoping there was
something I could do without recompiling the thing.
I am not aware of a /formatted dump/ for MI OPM other than DMPJOB
PGM(MIpgmName) JOBARA(*NONE) [although to call that /formatted/ may be a
stretch]. But there is STRDBG. After starting debug, the values of the
variables can be viewed with DSPPGMVAR, plus there are the Debugger APIs
that should enable retrieving the values of variables [which could then
be output and formatted as desired; i.e. create a formatted-dump feature].
Both STRDBG and DSPPGMVAR in conjunction with a listing could be used
to obtain the value for all of the variables from the listing. I
typically would write a REXX\CL script or CLP to perform one large or
successive DSPPGMVAR for groups of variables that interested me. I have
never had a reason to view all variables. The Debugger APIs may be able
to provide a list of variables for the program, but IIRC that is only
available for ILE programs; i.e. a listing in conjunction might be
required when using the Debugger APIs just as with DSPPGMVAR.