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]> On Behalf Of
Farley, Peter
Sent: Sunday, December 31, 2023 5:50 PM
To: [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]> On Behalf Of
Farley, Peter
Sent: Sunday, December 31, 2023 6:46 PM
To: [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.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to