Not just programs, though. Functions. Sorta like systrace on Linux and friends.

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Peter Van Dyke
Sent: Tuesday, December 10, 2024 7:27 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: IBM compiler/LE WIBNI

If you have z/OS Debugger, a fairly simple script can get the debugger to write 
to the log file a trace of programs that have been called and labels (eg. COBOL 
paragraph names) of statements executed.

Here's an example of JCL to run a batch job and have z/OS Debugger write a 
trace of programs called and COBOL paragraphs invoked to the INSPLOG DD:

//RUN     EXEC PGM=SAM1
//CEEOPTS  DD  *
TEST(,EQACMD,,:*)
//EQACMD   DD *
 AT GLOBAL ENTRY BEGIN;
   LIST CALLS;
   GO;
 END;
 AT GLOBAL LABEL BEGIN;
   LIST LINES %LINE;
   GO;
 END;
 GO;
//INSPLOG DD SYSOUT=*

Here's an excerpt from the output written to the INSPLOG DD:

* At ENTRY in COBOL program SAM2 ::> SAM2.
* From LINE 312.1 in COBOL program SAM1 ::> SAM1.
*       75       000-MAIN.
*
*       84       100-CALC-BALANCE-STATISTICS.
*
*      306       210-PROCESS-CUSTFILE-RECORD.
*
*      401       730-READ-CUSTOMER-FILE.
*
* At ENTRY in COBOL program SAM3 ::> SAM3.
* From LINE 324.1 in COBOL program SAM1 ::> SAM1.
*       69       000-MAIN.
*
*       78       100-CALC-PRODUCT-STATISTICS.
*
*      306       210-PROCESS-CUSTFILE-RECORD.
*
*      401       730-READ-CUSTOMER-FILE.
*

Regards,
Peter Van Dyke



On Tue, 10 Dec 2024 at 08:07, Don Leahy <don.le...@leacom.ca> wrote:

> With COBOL 6.4 at the base level, you can use ddname IGZPROUT at the 
> run step of your JCL to generate a report of all dynamically called 
> programs that are compiled with Enterprise COBOL 5 or later releases. 
> With the COBOL runtime PTF for APAR PH61133 installed, the report 
> contains COBOL 5 or later programs that are called dynamically, 
> statically, and via DLL linkage
>
>
> On Mon, Dec 9, 2024 at 11:18 Schmitt, Michael 
> <michael.schm...@dxc.com>
> wrote:
>
> > What do you expect to get when the compiler optimizer inlines the call?
> >
> >
> > Also, there's a simple way to get displays of all the section 
> > performs from a COBOL program. Not a trace table but close enough.
> >
> > -----Original Message-----
> > From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On 
> > Behalf Of Phil Smith III
> > Sent: Monday, December 9, 2024 10:14 AM
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > Subject: IBM compiler/LE WIBNI
> >
> > When working with large systems, it would sure be nice if there were 
> > a
> way
> > to compile (or, even better, just run) with an option that generates 
> > a trace table of function calls. If I were writing a large system 
> > from scratch in, say, C, I would consider making every call a macro, 
> > which
> could
> > then test a flag, or enable the tracing at compile-time.
> >
> > I'm not really thinking IBM is going to say "What a great idea! 
> > Let's
> drop
> > everything and do this" (though I'll buy them a beer if they do), 
> > more hoping someone says "Hey, dummy, LE already offers that via the 
> > XYZZY option."
> >
> > --------------------------------------------------------------------
> > -- For IBM-MAIN subscribe / signoff / archive access instructions, 
> > send email to lists...@listserv.ua.edu with the message: INFO 
> > IBM-MAIN
> >
> > --------------------------------------------------------------------
> > -- For IBM-MAIN subscribe / signoff / archive access instructions, 
> > send email to lists...@listserv.ua.edu with the message: INFO 
> > IBM-MAIN
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send 
> email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to