Showing posts with label ILE RPG. Show all posts
Showing posts with label ILE RPG. Show all posts

Tuesday, October 23, 2012

IBM i Programming Manuals V7R1

International Business Machines Corporation has a lot of information to index and so it's not surprising that folks get lost trying to get basic documentation. Here's my guide to a starting set of manuals for ILE RPG programming. This page is tailored to IBM i 7.1 (also known as V7R1M0); I will develop pages for other versions of the operating system as time permits.

Note that these links will display or download the manuals in PDF format. (Depending on your browser, you may have to right click and select "Save As..." to save the manual.) I suggest that you do so and use them from your computer hard drive. In some cases, IBM includes the manuals in HTML format and I leave it as an exercise to the reader to find those.

All of these manuals are written in American English. Supposedly, there are versions written in other languages but I couldn't find them quickly. Let me know if this is a problem for you and I will see what I can do.

ILE RPG Reference 7.1 [PDF] This is a reference manual; it describes the language but really doesn't tell you how to use it.

ILE RPG Programmer's Guide 7.1 [PDF] This manual explains how to do things with ILE RPG.

Of course, you will need to work with files. For database files, there are four manuals:

Database SQL Reference 7.1 [PDF]

Database SQL Programming 7.1 [PDF]

Database Programming 7.1 [PDF]

DDS for Physical and Logical Files 6.1 [PDF]

You can use either SQL or DDS to define your files and their characteristics. They are somewhat interchangeable.

For display files, use DDS for Display Files 6.1 [PDF].

For printer files, use DDS for Printer Files 6.1 [PDF].

Next, you're going to need to code Command Language (CL) programs for your ILE RPG programs. The manual for that is CL Overview and Concepts 7.1 [PDF].

Finally, there's the Integrated Language Environment part of ILE RPG. (ILE reminded me of the linkage editors we had in the 1970s so I jokingly refer to it as "Integrated Linkage Editor.") You can write useful programs without knowing a thing about ILE. But, when you're ready, you'll want to look at ILE Concepts 7.1 [PDF].

While researching this blog entry, I did find a master list of version 7.1 manuals. Go to the IBM Infocenter at this link and click on "PDF files and manuals".

Enjoy!




Sunday, October 21, 2012

Getting a better knowledge of ILE RPG

I'm willing to answer questions occasionally. The question today is "How can I develop my programming skills and get a better knowledge of RPG IV?"


First, get and read "The Modern RPG IV Language" by Robert Cozzi, Jr. (the link takes you Barnes & Noble; the Nook version is less expensive). A confession: I haven't read this book but I like what I've heard about it.

Second, download the "WDS RPG Language Reference" (SC09-2508) and "WDS RPG Programmer's Guide" (SC09-2507) from IBM (select the appropriate version based on the version of IBM i you're using). I'm going to post a guide to IBM manuals soon but, until then, start with the IBM i and System i Information Center and you should be able to find them. (Note that the current country is at the top and you can change it if you wish.) The Language Reference is the authoritative manual for everything you want to know about RPG IV (also know as ILE RPG) but it doesn't try to tell you how to do something. The Programmer's Guide is more of guide of how to do things. Update Oct. 23, 2012: I have written a blog entry on the programming manuals you need for version 7.1.

Third, you should use an interactive (non-green-screen) editor for your programming. The choices are too complicated to go into here. In addition, I recommend that all new programs be written in free format.

Fourth, understand that writing code is not all there is to programming. You must understand file operations against the database and how locking works (both of records and objects). And you will need to be able to figure out how best to write the code for each specific project.

Finally, there are some things you should not learn about. The RPG Cycle is one of these. Originally, back in 1965, you needed to know the cycle. Today, not at all. If you have to maintain a program using the cycle, track down a old timer like me with a good memory and I will help you (at the standard billing rate, of course).

Another thing is rather important to me. In college, I was taught structured programming (also known as GOTO-less programming), as advocated by Edsger Dijkstra, and have not written an RPG program with a single GOTO in it since 1976. But IBM, not caring what one of the greatest computer scientists advocated, added additional non-structured operation codes to RPG. The basic concept of structured programming is that every section of code should have one but only one entry point and one but only one exit point. If you write an RPG program for me, you will not use these operation codes:

CABxx   (Compare and branch)
GOTO    (Go to)
ITER    (Iterate)
LEAVE   (Leave a do/for group)
LEAVESR (Leave a subroutine — Allowed only if just before an End Subroutine)
RETURN  (Return — Allowed but only once per program or procedure and used carefully with *INLR or *INRT)
TAG     (Tag)

After reading the book, manuals and this information, you should be able to develop your programming skills. After writing 100 programs, you might get fairly good at this!