Problem solve Get help with specific problems with your technologies, process and projects.

Display program information with two simple commands

How many of your objects were affected by a modification? Here's an easy way to find out.

As programmers, we are constantly modifying programs, isolating "product" source files, or just trying to estimate the number of objects affected by a modification. There are two commands that can assist you in these tasks.

The first command is the "DSPPGM" (Display Program) command. You may display on screen or print this information. This will display the library, file and member used to create the program. It will also display the source change date and time, which may be different from the changed date and time found on the "WRKOBJ" (Work Object) command. The DSPPGM command is extremely useful when comparing programs to their source files.

The second command used in displaying program information is "DSPPGMREF" (Display Program References). This command provides a list of objects that are used by a program. You have three options when reviewing this information. You may display on screen, select a printed copy, or create a file. It is the file that gives this command its flexibility.

You can produce an output file of all programs in a library, then use that file to query the references. Since the file lists a single record for each reference, a program may easily be built to view them. If you are using file overrides, this command may not be as accurate as you may like.

When used, these two commands can help you isolate source codes, identify source-changed dates and assist in identifying objects that are affected by modifications.

About the author: John Kohan is a senior programmer analyst at CT Codeworks.


  • Programmer tips and tricks
    Need a little help with that program you're working on? If you find yourself stuck and looking for a little advice, you'll find plenty here. We've gathered some helpful tips and tricks to make your job a little easier.
  • .PeYsaYEpcqR^6@.ee84636/1157>Get source member info from an ILE program object
    "DougCMH" wants to know how to retrieve the source member information from a program object created with CRTBNDxxx. He knows that the information is available because he can see it when he runs the DSPPGM command. He wonders how he can get at it within a program. One suggestion was made. Do you have any others?
  • Search400's Best Developer Web Links: tips, tutorials and more.
  • Ask your programmer questions -- or help out your peers by answering them -- in our live discussion forums.
  • Ask the Experts yourself: Our programmer gurus are waiting to answer your technical questions.

Dig Deeper on iSeries ILE programming