Monday, July 6, 2009

(FAQ) How To Know Which AS/400 RPG Programs Are Using Specific Objects

It is very important for us to know which programs are using specific objects. For example you have updated a file, added/deleted some fields or changed field lengths. We need to know which programs need to be recompiled. We can use DSPPGMREF (Display Program Reference) command to create a file that maps all objects to all programs.

Command:
DSPPGMREF PGM(*ALL) OUTPUT(*OUTFILE) OBJTYPE(*ALL) OUTFILE(MYLIB/MYFILE)

Now you have created a file MYFILE in library MYLIB that contains list of programs with objects referenced to them.

To know which program uses MYPF file we can use SQL to retrieve it.

Command:
STRSQL

SELECT * FORM MYLIB/MYFILE
WHERE WHFNAM = 'MYPF'

Note:
WHFNAM is the object referencing to the program.


No comments:

Post a Comment