Tuesday, August 11, 2015

Free your thinking, free your code

rpg free format or all free

I have been surprised, and a bit disappointed, to find many examples of RPG code in various social media groups still written in columns. This seems to perpetuate the stereotype of the "AS400" and "RPG programmers" held by many others who do not work with the IBM i, that we are working with an out of date language on an out of date platform.

The reality is different. IBM has spent many hundreds of millions of dollars on the IBM i operating system and PowerSystem servers to make this a modern platform and market leader, which can do so much more than the AS400 could. Part of these enhancements has been the introduction of free format RPG.

The first step came in May 2001 with, which allowed us to replace the fixed format Calculation specifications, C-spec, with free format code. All we had to do was to insert /FREE and we could start using it. With subsequent releases the free format language has been given new features and functions that you cannot perform in the fixed format. In my opinion this is the clearly a message from IBM that it was time to move from fixed to free format.

October 2013 brought us IBM i 7.1 TR7 which included totally free format RPG. Only the Input specification, I-specs, and Output specs, O-specs, were not freed, which reinforces my opinion that you need to use printer files rather than Output specifications for your reports.

Yesterday there was some buzz on the Twitterverse in response to an article, on another website, about the general lack of awareness of free form RPG, you can read the article here.

It is time for all us to step up and become familiar with this improvement to RPG. I have written a lot of posts featuring free format, or as I like to call it all free, RPG since I first got my hands on it. To help you learn how to use it I started with a series of introductory posts:

Since then all posts that have featured RPG have been written for all free. You can find all of the RPG posts here. These will allow you learn how to use the new free format definitions.

You owe it to yourself and your career to become familiar with all free. If you are working on a server with a lower release than IBM i 7.1 TR7 you can still use the free format calculations, and pester your superiors to upgrade. If you do become familiar with this you are going to become more desirable to employers in the future. If you see no reason to move to free format then your career will go the way of those RPGIII developers who have refused to learn RPGLE/RPGIV.


  1. Actually you don't need the full 7.1 TR 7 - it was implemented with a PTF; I forget which one. I am doing all-free RPG on 7.1 TR5.

    1. I believe the PTF was SI51095. It could well have been superseded by another as we are now up to TR10.

  2. do you know any site which have all posts in free rpg??

    1. This site has lots of examples. Check the RPG labelled posts.

      Alas, there are not many other websites giving examples in all free. I have seen a few give one or two, and then revert back to fixed format.

    2. Hi Thanks for grouping up all rpg free things at one place...and could you please provide a good understanding of sqlrpgle from ground level with your posts?? Exactly in which scenario we use sqlrpgle in place of rpgle??

    3. IBM is no longer enhancing DDS the obvious answer would be for all input/output to files and tables. In reality most of us work with applications that are built with DDS files which mean, in my opinion, there is some discretion. I would start with simple stuff and work your way up to more complex programs, etc.

      As for giving examples from “ground level”, perhaps what is better is to use the Contact form on the right and submit some questions. I will consider whether to make subjects for new posts.

  3. I work with a group of five developers on 7.1 TR8. I post a link to your site for your topics which I find of interest. If you do not know about a feature, you will not test it or use it. Two of my fellow developers only code with RPGIII and indicators, and indicators and indicators. Three of us use all free and RDI and as many newer techniques. So guess who complains about only being assigned legacy enhancements and not new projects?


To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.