× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Frank Coleman wrote a utility to produce such a list by reading the source
code.

He does pop up on this list occasionally - you may see if he still has the
code, I think it will do what you want at a static source level.

If programs are chosen by dynamic library list changes as Buck suggests
then nothing will provide that list.

Cheers

Don





From: "Buck Calabro" <kc2hiz@xxxxxxxxx>
To: "RPG programming on IBM i" <rpg400-l@xxxxxxxxxxxxxxxxxx>
Date: 19/06/2023 08:39 PM
Subject: Re: Sql query to find whole call stack of programs
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>



tim wrote:

i tried this 'SELECT * FROM
TABLE(QSYS2.STACK_INFO('123456/JOBNAME/JOBUSER')) based on the job( by
mentioning its corresponding job details) which ended in the system few
days back but this command ended in error with message id 'CPF503E'. "An
error occurred while invoking the associated program or service program
.........in library QSYS with error code 1- "the external program or
service program returned SQLSTATE 42704. The text message returned from
the
program is : job (my job details) NOT FOUND".

Right. That's because the call stack only exists during the time that
the programs are actually being executed. Once the job ends, there is
no call stack to look at.

The operating system itself does not know that PGMA calls PGMB, and
I'm not sure there's any way for it to know that. Imagine the
situation where you have PGMB in three separate libraries. Each
version of PGMB does something slightly different - perhaps it
calculates taxes based on region. The library list is changed
dynamically at runtime. How could the operating system know from a
compiled PGMA /which specific/ PGMB got called during job 123456?

I agree with Daniel that if there's no analysis tooling at your
workplace, you will either need to analyse the job by hand (starting
at the top CALL in the job log) or write your own tooling.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.