Thursday, September 15, 2016

Advantages of using Free-format RPGLE

Advantages of Using Free-Format RPGLE

IBM has always been focusing on making the RPG easy for Non-RPG Programmers. One such Important move is introducing the Free-Format into RPG for C-Spec. 

Introducing Eclipse based RDi is another biggest move. This encourages young developers in learning RPG like any other web based languages. RDi has an addition to convert your Fixed Format code to Free-Format. 

Almost after a Decade of Introducing Free-Format, IBM took major Step to Convert RPG into Full-Free format.

As a Core RPG Developer, I can say this as 'Really Huge' change to the way how RPG was being coded and how the RPG has become now. This has changed its way from RPG II, RPG III and to Full-Free Format.

We will have a quick look at the Major advantages of Using Free-Format RPGLE in this article.

  • Readability
  • Efficient use of Space
  • New Features Specific to Free Format
  • Easy to Understand/Maintain


  • No need to stick to specific columns and thinking about the limitations of Factor or Extended Factor for writing any calculations.
  • Maintaining Proper Indentation makes easy for Analyzing the code.
  • Declaring Variables with Proper Meaning. E.g.: 'IsPurchaseOrderFulfilled' makes more Sense than 'IsPOfulfld'.  This helps understanding the Purpose of Variable and Logic.

Efficient Use of Space:

  • Biggest Advantage of Full-Free format RPGLE is making efficient use of Space instead of Restricting to work from 6th Position to 80th Position. Code can be written Starting from 1st Position.
  • Free Format Declarations allows to Declaring the large variable names in a single line by avoiding ellipsis (...) in D-Spec.
  • Business Logic will appear clean in Free Format and can save the number of lines coded compared to Fixed Format.

New Features to Free Format:

  • Defining Keys directly in Chain/Setll instead of maintaining the KLIST. This helps eliminating multiple KLIST entries and Code looks cleaner for Modification/Analysis.
  • EXCEPT keyword can be avoided with Free-Format Specific %Fields(). This eliminates the O-Spec and Fields can be mentioned directly with UPDATE Keyword.

Easy to Understand/Maintain:

  • Free-Format File declarations has changed the way of File Declarations in F-Specs. You no longer need to remember the Position & Possible Values. This can be as simple as your Variables Declaration.
  • No need to follow the sequence. Variables can be declared in middle of File Declarations. This helps declaring the Stand alone fields used for file processing to be defined immediately after File Declaration.
Not to Miss, It helps young developer to understand RPG quickly and learn.

No comments:

Post a Comment

Different Ways of Sorting Data in a List - Python

Sorting Data in a List List is a collection of data (of different data types), much like an array. Like any data structure or data set, dat...