Fully **Free RPG

ILE RPG now supports “fully-free” RPG, which allows RPG code anywhere on a source line, from column 1 to the end of the line.

The first line of any source file that contains fully-free code must contain the special **FREE directive in column 1 of the first source line. **FREE cannot be coded anywhere but the first line. After that line, the entire source member must be free-format.

If the program requires fixed-format code, it must be in a copybook. If a copybook uses fully-free code, it must have its own **FREE directive. You can copy a fully-free copybook into “classic” source, and you can copy a classic copybook into fully-free source.

There is no limit on the length of a source line, other than the record length of a source physical file. The /COPY directive will also allow any length for the copybook, and copybooks may be IFS files with a long path.

/FREE and /END-FREE directives are not allowed in fully-free code.

RDi Release 9.5 supports **FREE.

Programming in ILE RPG (5th ed.) uses classic free-format examples, but they also apply to fully-free format RPG by simply adding the **FREE directive to the beginning of the program.

Fully-free RPG support requires Release 7.1 TR11 or Release 7.2 TR3.

RPG IV Style for the 21st Century

I’ve often postulated that few computer languages are changing as fast as RPG. Although it originated more than 50 years ago, RPG has evolved from a punch card heritage to a fully featured language that drives many modern business applications, in only a little more than a decade.

But has your programming style kept pace with RPG’s evolution? It was only a few short years ago when I first wrote an RPG IV style guide and, despite my attempts to update it since then, my old, comfortable approaches to style, standards, and best practices get more outdated with every new release.

Continue reading “RPG IV Style for the 21st Century”