RPG IV and RPG ILE book

bsingh77 used Ask the Experts™

I'm a RPG/400 programmer (AS/400) and want to update my skills to include RPG IV and ILE.
Please could you advise me on the best book available on converting my existing RPG/400 knowledge to RPG IV and ILE.  A book that would clearly explain the concepts and enable me to quickly become a productive RPG IV and ILE programmer.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I don't know if there is any such thing as will enable you "to quickly become a productive RPG IV and ILE programmer".

First steps would simply be in becoming more familiar with RPG IV. You can do that by running existing RPG/400 source through CVTRPGSRC, then comparing the new source members with the originals. That begins to let you see the general formatting differences. For most source members, the resulting source should compile as a program that works the same as the original as long as you run it in 'compatibility mode' (i.e., in the default activation group).

All that really does is a reformat of the source. In some detail areas, you might need to make minor changes to the converted source. Basically, just fix any errors noted in a compiler listing.

One thing it does not do is replace old op-codes with new ones that you should use in RPG IV. Essentially every op-code in RPG III still works in RPG IV, so it's not actually necessary to change them. But you really don't want to be putting op-codes such as MOVE, Z-ADD, SETON and maybe others into any new RPG IV programs and you really should be learning how the new D-specs can enable so many new ways of doing things simply by data definitions. And you don't ever want to condition any statements with an indicator. In fact, you should assume that you won't use any numbered indicators in your C-specs at all. (You can if you really want to; things will simply be a lot cleaner and easier if you don't.)

With some converted source to review, you should scan through the RPG IV Language Reference manual index to see what new op-codes are available. There's no need to look at any old op-codes. Just look to see new ones to recognize what they are.

The ones you really want to learn are those few that are listed in the Extended-Factor 2 Operation Codes topic. Except for the file I/O op-codes, the few listed in that topic should be the majority of all op-codes you'll ever use in new RPG IV coding.

The most important will be the new CALLP op-code. That one is essentially what changes everything into ILE. However, you should mostly ignore it until you're comfortable with RPG IV. If you get RPG IV out of your way, you can then focus on ILE. Trying to learn the new language structure at the same time you're trying to learn the new run-time environment will just make both of them harder.

One big reason that you won't need most of the other old op-codes is that the 'extended factor 2' op-codes can make a lot of use of the new Built-in Functions. Look at the list of functions, and you'll see ones like %CHECK(), %LOOKUP() and %SUBST(). You use those in expressions in the extended factor 2, and they can eliminate the need for many (usually all) of the old numbered indicators. They help make the C-specs much shorter and clearer.

After learning to recognize the names of new op-codes and of new functions, learn the structure of the ILE RPG Programmer's Guide. You can read parts that interest you or simply use it as a reference when you get stuck. But it has good information about how to program with ILE RPG.

Along with the Programmer's Guide, you will want to read the ILE Concepts manual. That will be your reference for ILE itself. Along with it, you can use the ILE Application Development Example manual.

Those are all mostly 'reference' manuals. For actually learning how to use ILE RPG, the best 'book' might be Who Knew You Could Do That with RPG IV? A Sorcerer's Guide to System Access and More. That IBM Redbook has been the standard for learning advanced programming with ILE RPG since OS/400 version 3. It's been updated to keep up with language changes. When you download the book, make sure that you review the options under the title of the download page. The 'Additional materials' link lets you download all of the source code that's developed in the text of the book.

If that series of items doesn't give you more than you can handle for a few months, post back here.


Dave FordSoftware Developer / Database Administrator
I wholeheartedly agree with Tom that the aforementioned "Sorcerer's Guide" redbook is your best bet (and free, too!).

If you need more and you're willing to pay money, check out the following link:


It gives you the ability to purchase several good RPG IV books such as:

- "The Modern RPG IV Language" by Bob Cozzi
- "Free-Format RPG IV: How to Bring Your RPG Programs Into the 21st Century" By Jim Martin
- "Subfiles in RPG IV : Rules, Examples, Techniques, and Other Cool Stuff" By Kevin Vandever

Given that I tend to be really cheap, I'd start with the free redbook.

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial