Programming Languages on Power

Power Programming Languages

IBM Power, including the AIX, IBM i, and Linux operating systems, support a wide range of programming languages, catering to both traditional enterprise applications and modern development needs.


#Power

 View Only
Expand all | Collapse all

Resources to learn IBM i RPG fixed format

  • 1.  Resources to learn IBM i RPG fixed format

    Posted Fri January 19, 2024 04:43 PM

    Dear all,

    I'm a beginner in the IBM i world and currently I'm learning RPG programming language.

    Fully free format is not a problem because Internet have plenty of tutorials and there are a lot of educational textbooks that I use to gain knowledge.

    Difficulties start when I have to write fixed-format specifications. I surfed a lot on the web, even in the official documentation of IBM, but I wasn't able to find any resources to learn legacy RPG syntax and logic (that is, fixed form syntax).

    In particular I need to learn:

    • how to declare variables;
    • variable types;
    • columnar format (where to write the right thing in the designated column);
    • syntax for calculations...
      • ...and so on.

    I'm looking for a textbook, or an online course, even a GitHub repository with commented code, or a website with a knowledge base focused on RPG fixed format. Could you suggest me some?



    ------------------------------
    Ishtar Terra
    "...a newcomer into the IBM world."
    ------------------------------

    #RPG


  • 2.  RE: Resources to learn IBM i RPG fixed format

    Posted Fri January 19, 2024 06:41 PM
    You don't say how far back you want to go.

    RPG/400 which (sadly) is still quite widely used is a fixed format language. Personally, I wouldn't bother with it.

    RPG IV (aka ILE RPG) has had various incarnations but from the perspective of the items you mention started off a basically a fixed format language.  After the initial releases, free-format calculations were added but file and data definition remained in fixed format. As you note, the current version is completely free format.

    I would suggest that you learn the latest fully free-format version of RPG IV first. If you know other programming languages you will find this a less frustrating starting point. This book (https://www.amazon.ca/Programming-ILE-RPG-Jim-Buck-ebook/dp/B0165WNBRU/ref=sr_1_1) is the one most commonly used in schools. 

    Once you understand the modern RPG you'll find it relatively easy to step back in time to the earlier versions. Look for an earlier edition of the same book - for example, this is the link for the 4th edition (https://www.amazon.ca/Programming-RPG-IV-Jim-Buck-ebook/dp/B01AR4ZF30/ref=sr_1_4)  but ideally you should look for a second-hand copy of the 2nd or 3rd edition since they were written for fixed format.


    Jon Paris





  • 3.  RE: Resources to learn IBM i RPG fixed format

    Posted Sat March 16, 2024 05:58 AM

    Thank you kindly



    ------------------------------
    Ishtar Terra
    ------------------------------



  • 4.  RE: Resources to learn IBM i RPG fixed format

    Posted Mon January 22, 2024 02:51 PM

    The RPG Reference still describes the fixed-format specifications (called "traditional" specifications in the manual), and there are many examples of fixed-format code throughout.  Just be aware that copy/paste from the .pdf does not retain the proper columns for the code.  You can use SEU prompting for fixed-format code (I usually highly discourage the use of SEU, but if you are intentionally writing/learning outdated fixed-format code I don't feel quite so bad offering it as an option).  The RPG Programmer's Guide has details on the RPG cycle programming if you need to go that far back.

    Scott Klement always has some of the best RPG code you'll ever see, so I would look at his examples (i.e. https://github.com/ScottKlement/httpapi/tree/main/src/rpglesrc), and he has some recommendations for learning as well (https://www.scottklement.com/rpg/howtolearn.html).



    ------------------------------
    Patrick Behr
    ------------------------------



  • 5.  RE: Resources to learn IBM i RPG fixed format

    Posted Tue January 23, 2024 09:45 AM

    common has a thing for new users

    Home - N2i (common.org)



    ------------------------------
    Bryan Dietz
    ------------------------------



  • 6.  RE: Resources to learn IBM i RPG fixed format

    Posted Wed January 31, 2024 08:30 AM

    I wanted to echo Patrick's advice here. If you're learning old RPG, then the old tool, SEU, is probably best. Prompt each line and use F1 for help on each entry. Definitely, read about the RPG cycle. SEU will help you with the syntax, but you won't understand the flow without knowing the RPG cycle.



    ------------------------------
    Patrick Conner
    ------------------------------



  • 7.  RE: Resources to learn IBM i RPG fixed format

    Posted Tue January 30, 2024 03:33 PM

    Hi!

    There is still a lot of information about RPG fixed format .... but,  I don't recommend learning it, unless it's to modify an old program! and in that case, I always recommend converting it to the new format.

    It is true that some of the old syntax cannot be converted line by line... for example, primary-secondary input files, "move" type operations... etc.

    We must look to the future and never to the past. RPG is more alive than ever and you have to apply everything new!

    I recommend some videos from my YouTube channel

    www.youtube.com/@ChristianLarsenRPG

    Greetings!



    ------------------------------
    Christian Larsen
    IBMi RPG Analyst/Developer
    Mayoral Moda Infantil
    Málaga
    ------------------------------



  • 8.  RE: Resources to learn IBM i RPG fixed format

    Posted Fri March 15, 2024 10:56 AM

    This is the book everybody has and the one most people (including those who've written other RPGIV books) have learned on:

    https://www.amazon.com/Modern-RPG-IV-Language/dp/1583470646/ref=sr_1_1?crid=3T7FKBH7OF91D&dib=eyJ2IjoiMSJ9.YUb2QY9AzWIgtkA7FWNgTJAoo9f6oLkUE3eNFRoIT6DHY9XGoSfHbqQGYtLvamP2jvEdZ1ThilJM7boEjOw5rhAn0yjRBREcLGJDs2BTvPprPDpwC3jr_8JSLja0oWhV.mkdiaVmCV5SkkA7SRSusQmjJCUySq6_235KQPmbtYKc&dib_tag=se&keywords=the+modern+rpg+iv+language&qid=1710514480&sprefix=The+Modern+RPG+IV+%2Caps%2C102&sr=8-1



    ------------------------------
    Robert Cozzi
    ------------------------------



  • 9.  RE: Resources to learn IBM i RPG fixed format

    Posted Sat March 16, 2024 05:57 AM

    That seems interesting. Thank you.



    ------------------------------
    Ishtar Terra
    ------------------------------



  • 10.  RE: Resources to learn IBM i RPG fixed format

    Posted Wed June 25, 2025 10:41 AM

    I highly recommend the book Programming in ILE RPG by Bryen Meyers and Jim Buck. I know the title is ILE RPG, however each chapter that has examples of modern ILE RPG, also includes a section at the end of that same program in fixed format. This is particularly helpful if you are learning because you can see the current best way to write using ILE, but also see that same code working in fixed format. This particularly helped me learn fixed format in my career. I always aim to write new code in free format but I have had to work on old existing code where I needed to learn fixed format and this book helped me do that.



    ------------------------------
    megan olson
    ------------------------------