77 DEBUG-MODE PIC X(3) VALUE 'NO '.
IF (parameter value for specific call) THEN
MOVE 'YES' TO DEBUG MODE
END-IF.
repeat as needed:
IF DEBUG-MODE = 'YES' THEN
DISPLAY 'debugging information'
END-IF
On Thu, Sep 18, 2025 at 2:06 PM Farley, Peter <
[email protected]> wrote:
> Thanks Tom, I was already aware of that and am using the WITH DEBUGGING
> MODE only in the program at issue. My problem is that the driving code
> (which I am forced to use by the structure of the application)
> unfortunately calls the subroutine from multiple places, but the error I am
> tracking down only occurs from a call at one of those several call
> locations. What I hoped to do is to turn OFF the effect of WITH DEBUGGING
> MODE until the driving code gets to the one call location of interest, then
> turn the WITH DEBUGGING MODE ON again for just that one call location and
> turn it OFF again after that one call location completes the call.
>
> I am guessing this isn't possible, so I will just have to ignore the chaff
> and look only for the wheat.
>
> Peter
>
> From: IBM Mainframe Discussion List <[email protected]> On Behalf
> Of Tom Ross
> Sent: Thursday, September 18, 2025 1:37 PM
> To: [email protected]
> Subject: Can COBOL DEBUG for LE be turned off and on dynamically? >
>
> >I have a very complex COBOL program where I am investigating a
> calculation =
> >error, but the code test bed winds up invoking it for quite q few more
> time=
> >s than I am interested in seeing variable values during the calculation
> pro=
> >cess.
>
> >What I would like to do is to turn on LE COBOL DEBUG at the start of the
> ba=
> >tch driving program then turn it off dynamically until one specific place
> w=
> >here the program at issue is called, turn it ON before the call and then
> tu=
> >rn is off again on return from that call.
>
> Debugging lines that start with D are activiated by a COBOL clause: WITH
> DEBUGGING MODE, on the PROGRAM-ID statement. You could have that clause in
> only the program you are interested in. The whole application would have
> to to be run with the LE DEBUG option, but only programs that have WITH
> DEBUGGING MODE will activate the debugging lines.
>
> Cheers,
> Tom Ross (AKA Captain COBOL :-) >> COBOL is the Language of the
> Future! <<
> --
>
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by
> e-mail and delete the message and any attachments from your system.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN