How to get caller program list by Calle program

85 pts.
Tags:
AS/400 V6r1m0
AS400 iseries
Let assume that I have a program TESTR but i dont know how many program is calling to TESTR program. Is there any API or System file to get this. Thank You.

Software/Hardware used:
Software
ASKED: March 30, 2012  8:02 AM
UPDATED: April 3, 2012  11:00 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can do a DSPPGMREF of all your programs to an OUTFILE and then query that.
Most shops dave a software package that does this for you.
IMHO the best and most commonly used is HAWKEYE PATHFINDER
Well worth the investment

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    A DSPPGMREF will pick up many common program accesses, but it can miss many important ones. For example, any calls through a variable name will be reported simply as a generic program reference. Those will probably be rare in in-house apps. Any system API would run into the same problem, so there is no function that does it. Other than that, you might rename TESTR to a new name and create a new TESTR program. The new program would simply pass the parameter list through to a call to the renamed program. The new program would also retrieve the calling program from the call stack and record it somewhere. I'd probably add a keyed user index entry with the data. The key would be used to prevent a billion entries while being called in a loop or in recurring jobs. This might be combined with DSPPGMREF to catch unusual cases. Tom
    125,585 pointsBadges:
    report
  • Mdshadabalam
    Brown: Thanks for your answer. But I have been tried with DSPPGMREF but not getting. As per my understanding DSPPGMREF will give the list of called program. for example MainPgm is calling SP1, SP2 ,SP3 and so on. once you give DSPPGMREF command on MainPgm, it return the list of calling program like SP1, SP2 ,SP3. but requirement is vise versa. I need to know from where SP1, SP2 ,SP3 is calling. i should get the anser MainPgm.
    85 pointsBadges:
    report
  • Mdshadabalam
    Hi Tom, Thanks for your kind answer. Actually my requirement is, i have set of object list and get to know there parent program if any. for this i am planning to submit a job in batch. my approach will be i will make outfile for each member trough RUNQRY command then I will use SQL LIKE statement. if its return a record then i will consider as parent program. Hope my requirement is clear to you. could you please assis for any better idea.
    85 pointsBadges:
    report
  • TomLiotta
    ...it return the list of calling program like SP1, SP2 ,SP3. but requirement is vise versa. That's right. But the idea is that you put the output from DSPPGMREF into an outfile. Then you run DSPPGMREF over another program, and you add its output to the same outfile. You run DSPPGMREF over all of the programs in your library. When that is done, you have a file that lists every program that is called by all of the programs in your library. Then you can run a query to see where TESTR shows up in the file. In fact, you can run DSPPGMREF mylib/*ALL OUTFILE(QTEMP/MYPGMREF) to get all program references from library MYLIB all at once. Wherever TESTR is referenced by one of the programs in that library, a record will show up in QTEMP/MYPGMREF. One command is all it takes. Just be aware that it's not guaranteed to have every possible reference. There can be programs that don't call TESTR by name. Or TESTR might be called by a menu or it might be invoked by a command, or various other kinds references might exist. Tom
    125,585 pointsBadges:
    report
  • Mdshadabalam
    [...] 7. CharlieBrown and TomLiotta give details on how to get a caller program list. [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following