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.

Fully-free RPG requires IBM i Release 7.3, Release 7.2 TR3, or Release 7.1 TR11. RDi Release 9.5 supports **FREE.

Learn more about free format and other ILE RPG functions in the “ILE RPG in Easy Bytes” series,” one of several online self-study courses available at my.enskill.com.

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.