The IBM i Control Language (CL) provides such a rich set of commands that even after almost 30 years, I can still discover something really useful. DSPPGMREF is a case in point:
The Display Program References (DSPPGMREF) command provides a list of the system objects referred to by the specified programs.
Usefully, I can select all programs in a library and direct the output to a database file:
DSPPGMREF PGM(LSCLIB/*ALL) OUTPUT(*OUTFILE) OUTFILE(LSCLIB/CROSSREF)
This gives me a table showing every object referenced by every program in library LSCLIB which means that identifying the potential impact of (for example) a change to a table is only a simple query away.
The program or programs to search can be *ALL, as above, or a single program name or a generic name. And if I use this:
DSPPGMREF PGM(*ALLUSR/*ALL) OUTPUT(*OUTFILE) OUTFILE(LSCLIB/CROSSREF)
I’ve captured everything.
I am having problems with DSPPGMREF to an *OUTFILE. For CLP programs Field names from CLP (&xxxxxxxxx) are getting into the output instead of some kind of text to indicate what is going on. Worse yet I defined a file with given locations around where the string with & was found (via DSPPFM’s search capability. This is first part of a huge project where order number is about to Roll Over. Even worse first project for a new customer and sooner or later they are going to give the brown eye for how much time I an spending on the initial research
Can you help?