Steve and Paul, I tried using the “SOURCE-COMPUTER” paragraph and WITH DEBUGGING clause in the subroutine in an earlier iteration of this testing, but at that time I saw that the compiler did not allow that – I gave a severe error if more than one CONFIGURATION SECTION occurred in the same compiler input file.
However, I just re-added the CONFIGURATION SECTION and WITH DEBUGGING clause to the subroutine as posted earlier and it Just Works (tm). Probably PEBCAK. Mea culpa for wasting bandwidth. Peter From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Steve Thompson Sent: Sunday, December 31, 2023 8:10 PM To: [email protected] Subject: Re: Questions about COBOL debugging lines in subroutines Each program/subprogram, that you need to debug, you must specify in its source "WITH DEBUGGING MODE" That "Activates a compile-time switch for debugging lines written in the source text. "A debugging line is a statement that is compiled only when the compile-time switch is activated." So If you only need to debug a subprogram, then you only compile and link it with the debug logic generated/activated. HTH Steve Thompson On 12/31/2023 7:22 PM, Paul Feller wrote: > Peter, I'll start by saying I've never used this option. It does sound > interesting. From what I have read would you not also need the "WITH > DEBUGGING MODE" setup in the called program. > > > Paul > > -----Original Message----- > From: IBM Mainframe Discussion List > <[email protected]<mailto:[email protected]>> On Behalf Of > Farley, Peter > Sent: Sunday, December 31, 2023 5:50 PM > To: [email protected]<mailto:[email protected]> > Subject: Re: Questions about COBOL debugging lines in subroutines > > P.S. - COBOL compiler is Enterprise COBOL V6.4. > > From: IBM Mainframe Discussion List > <[email protected]<mailto:[email protected]>> On Behalf Of > Farley, Peter > Sent: Sunday, December 31, 2023 6:46 PM > To: [email protected]<mailto:[email protected]> > Subject: Questions about COBOL debugging lines in subroutines > > > I have a little mystery concerning debugging lines ("D" in column 7) in > COBOL subroutines compiled in the same input file as the main program. > Sample output and code are pasted below. > > The execution JCL for this sample program includes a CEEOPTS DD with the LE > "DEBUG" option set so debugging lines SHOULD display on SYSOUT. In my > little test, only the debugging line in the main program displays on SYSOUT. > > Q1: Can anyone tell me why the debugging line in the subroutine does not > execute at run time? > > Q2: Is there any way I can adjust the code or the compile process to cause > the subroutine debugging line to execute at run time? > > Peter > > Sample SYSOUT output: > > DBGSAMPL I=+000000003,J=+000000004,K=+000000002 > > Sample COBOL code compiled as a single SYSIN file to the compiler, using > options 'AR(EX),DS(S),NOSEQ': > > IDENTIFICATION DIVISION. > PROGRAM-ID. DBGSAMPL. > ENVIRONMENT DIVISION. > CONFIGURATION SECTION. > SOURCE-COMPUTER. > Z-SYSTEM > WITH DEBUGGING MODE > . > DATA DIVISION. > LOCAL-STORAGE SECTION. > 01 I PIC S9(9) BINARY VALUE 1. > 01 J PIC S9(9) BINARY VALUE 2. > 01 K PIC S9(9) BINARY VALUE 3. > PROCEDURE DIVISION. > MAIN-PARAGRAPH. > CALL "SUBSAMP1" USING I, J, K > D DISPLAY "DBGSAMPL I=" I ",J=" J ",K=" K > GOBACK > . > END PROGRAM DBGSAMPL. > > IDENTIFICATION DIVISION. > PROGRAM-ID. SUBSAMP1. > ENVIRONMENT DIVISION. > DATA DIVISION. > LINKAGE SECTION. > 01 I1 PIC S9(9) BINARY VALUE 1. > 01 J1 PIC S9(9) BINARY VALUE 2. > 01 K1 PIC S9(9) BINARY VALUE 3. > PROCEDURE DIVISION USING I1, J1, K1. > MAIN-PARAGRAPH. > MOVE K1 TO I1 > MOVE J1 TO K1 > MOVE 4 TO J1 > D DISPLAY "SUBSAMP1 I=" I1 ",J=" J1 ",K=" K1 > GOBACK > . > END PROGRAM SUBSAMP1. -- 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
