How to know from all where a program (*PGM) is called?

195 pts.
Tags:
AS/400
PGM
PGM1 calls PGM2 can be known by DSPPGMREF. PGM2 is called by PGM1 (and others, if any), any command for it?


Software/Hardware used:
IBM AS400
1

Answer Wiki

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

I don’t recall a reverse reference command. You can always try and dump the original results to a file then query the results.

DSPPGMREF PGM(MYPGM) OUTPUT(*OUTFILE) OUTFILE(QTEMP/PGMREFS)

Discuss This Question: 3  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.
  • bvining
    The short answer -- no. As suggested by ToddN2000 you could get a partial answer by using DspPgmRef of all *PGMs and then looking to see who they call but this is not necessarily complete. For instance the following program calls both PGMA and PGMB, but only PGMA will show up in the output of DspPgmRef with PGMB being replaced by the value *Variable.

    h dftactgrp(*no)                              
    d Called          s             10a           
    c                   call      'PGMA'          
    c                   eval      Called = 'PGMB' 
    c                   call      Called          
    c                   eval      *inlr = *on     
    c                   return                    

      Object  . . . . . . . . . . . . . . . . . . :     PGMA      
        Library . . . . . . . . . . . . . . . . . :       *LIBL   
        Object type . . . . . . . . . . . . . . . :       *PGM    
      Object  . . . . . . . . . . . . . . . . . . :     *VARIABLE 
        Library . . . . . . . . . . . . . . . . . :               
        Object type . . . . . . . . . . . . . . . :       *PGM    

    And of course command line calls, calls using a host server such as QZRCSRVS, etc to a given program wouldn't show up anywhere (conveniently found anyway).
    7,070 pointsBadges:
    report
  • azohawk
    I have used "Find String" (PDM option 25) in source members, but that is not 100% reliable as PGM1 might be called from PGMA in a different library or the source for PGMA may not exist on the system. (I think there is a way to do this with RDI, but I'm not sure what it is.)

    You might also look at some 3rd party products to see if they have something that will give this info to you. The first two I would look at would be Hawkeye's Pathfinder and TAA Tools.

    But, yes, as earlier posts have indicated, there is no easy and foolproof way to do it yourself.

    4,055 pointsBadges:
    report
  • ToddN2000
    If the called program is defined using standard methods you will get better results. If the program name is passed as a parameter like in bvinings example of PGMB you will not pick these up. Also if using Azohawks method you can still even miss a few unless you have coding standards in place the say if passing a program name as a parameter you have a standard definition name being used. If the parameter name in consistent you will have issues. examples Called = 'PGMB'  or Callpgm = 'PGMB'  or pgmparm = 'PGMB'  or any other variation would have to be scanned for.
    135,525 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.

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

Following

Share this item with your network: