|
On Tuesday 17 December 2002 6:41 pm, Dan wrote: > Actually, it's a little more complicated than that. This is a > 2800-line Cobol program which uses "PERFORM par1 THROUGH par9-exit". > I'm not an expert on Cobol, but I believe Cobol will "perform" every > paragraph beginning from par1 and (through) par9-exit. It's more > difficult than isolating an RPG subroutine call. > > But your advice will be useful in the future, as I had not considered > that idea before. Hi Dan I was going to suggest one of my routines which links trace data to a program's source. I now see you want it for Cobol, and my routine is geared up for RPG, but should work for Cobol too (it works for CL). The technique is a bit more sophisticated that using a DSPTRCDTA(*PRINT), as you don't have to parse the printfile afterwards. This is due to a nice feature of ADDTRC is that you can specify a trace program. This will be called everytime the trace condition is met, with (ISTR) four parameters (program, library, machine instruction & source sequence). With this you can STRDBG with MAXTRC(1) TRCFULL(*WRAP), and ADDTRC with no conditions which will let your TRCPGM process each executed line. My routine just writes to or updates a file with the line info, so it can produce a code listing which also shows the number of times each line has been executed. It would be fairly easy to tweak this to show the code lines in executed order instead. In fact I have an earlier routine (from '94) that does this, but only for RPG400, and it uses the parse DSPTRCDTA(*PRINT) technique, so is a bit slower. At least that's how I remember it, as I'm not sure I've used it since we moved off our old B45! Code is at http://www.dbg400.net/extras.html#runpgmtrc with the already mentioned proviso that this only works for OPM code - not ILE. Regards, Martin -- martin@dbg400.net (plain text emails only) http://www.dbg400.net /"\ DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \ / Source free test environment tools and others (file/spool/misc) X Debian GNU/Linux | ASCII Ribbon Campaign against HTML mail & news / \
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.