RPG IV and RPG ILE book

Posted on 2012-12-28
Last Modified: 2014-12-23

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.

Question by:bsingh77
LVL 27

Accepted Solution

tliotta earned 250 total points
ID: 38734132
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.


LVL 18

Assisted Solution

daveslash earned 250 total points
ID: 38737552
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.

LVL 14

Expert Comment

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After-hours service is a fact of life for most MSPs. While not the most pleasant aspect of the job, there are ways to make after-hours servicing a more profitable and organized enterprise.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question