The Honeymoon Is Over

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

How many times have you tried to find the source file, library, and member used to compile a given program, and you're left with blanks? The problem is that the ILE compilers are two-phase compilers. The old RPG III compiler was essentially a single-phase compiler. So the compiled program was created directly from the source code. It's relatively easy to insert the name of the source file, library, and member used to create an RPG III program.

But RPG IV programs have a two-phase ILE compiler. So DSPPGM or DSPOBJD do not show you the source file, library, and member name used to create the program. Why? Because a source member was not used to create the program.

With ILE compilers, source code is used to create a *MODULE object. Then the binder, the CRTPGM command, takes one or more *MODULE objects and "binds" it into a *PGM object. Consequently, the *PGM is created not from source code, but from one or more *MODULE objects.

It is relatively easy, using the DSPPGM command, to see the *MODULE object names that were used to create the *PGM object. On page 3 of the DSPPGM command's output is the list of module names used to create the program. Even if only one module was used, it is listed. From this module list, you may select various options, including option 5 (Display). This option runs an internal routine that is effectively a Display Module (DSPMOD) command. But it does so for the module in the program itself. From the DSPMOD command output, you can see the source file, library, and module names that were used to create the *MODULE object. In a single-module program, that member name is the source member used to "create the program."

A few years ago, I wrote an article on the use of the QBNLPGMI and QBNLSPGM APIs. These APIs enumerate (i.e., list) the modules used in a program or service program, respectively. In effect, they do the same thing as page 3 of the DSPPGM or DSPSRVPGM command, but they output to a variable or user space.

So the old habit of using DSPOBJD to view the source member name used to create a program is now effectively obsolete. Use DSPPGM, DSPSRVPGM, and those two APIs to get the information you need.

Bob Cozzi is a programmer/consultant, writer/author, and software developer of the RPG xTools, a popular add-on subprocedure library for RPG IV. His book The Modern RPG Language has been the most widely used RPG programming book for nearly two decades. He, along with others, speaks at and runs the highly-popular RPG World conference for RPG programmers.

BOB COZZI

Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.


MC Press books written by Robert Cozzi available now on the MC Press Bookstore.

RPG TnT RPG TnT
Get this jam-packed resource of quick, easy-to-implement RPG tips!
List Price $65.00

Now On Sale

The Modern RPG IV Language The Modern RPG IV Language
Cozzi on everything RPG! What more could you want?
List Price $99.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: