Of course, another option that requires a change is to pass a debugging
switch into the called program. You could pass a No/Blank value in for
all the calls you don't want to trace, then pass in a Y/1/whatever to
indicate you want to debug it. Then you just test the code for If
debugging-switch-is-on, display whatever you want...
Thank you and best regards,
Billy Ashton
------ Original Message ------
From "Farley, Peter" <[email protected]>
To [email protected]
Date 9/18/2025 3:06:25 PM
Subject Re: Can COBOL DEBUG for LE be turned off and on dynamically? >
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
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN