Free Format RPG
Here is a sample code to add 2 number in Free Format RPG 0001.00 D Total S 10 0 INZ 0002.00 C *ENTRY PLIST 0003.00 C PARM Number1 5 0 0004.00 C PARM Number2 5 0 0005.00 /FREE 0006.00 Total = Number1 + Number2 ; // Get total for both input values 0007.00 DSPLY Total '*EXT' ; // Display value of Total 0008.00 *InLR = *ON; // End of program [...]
Free Format RPG was a major step towards the modernization of RPG language. This change in RPG syntax gave RPG programmers flexibility to write code which is easy to type, read and maintain. Technically Fix Format RPG and Free Format RPG are equally powerful and each one of them has its own pros and minor cons with respect to each other.