Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 11 in /home/nicklit/www/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php on line 473

Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 11 in /home/nicklit/www/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php on line 473
IBM i RPGLE FREE is finally fully free form » Nick Litten [IBM i AS400 iSeries] Software Developer
Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 11 in /home/nicklit/www/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php on line 473

Warning: preg_match_all(): Compilation failed: quantifier does not follow a repeatable item at offset 11 in /home/nicklit/www/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-post-variables.php on line 473
.st0{fill:#FFFFFF;}

IBM i RPGLE FREE is finally fully free form 

 February 28, 2017

By  NickLitten

Modern ILE RPG now (finally) supports “fully-free” RPG Source code

This means, we can write RPG code from column 1 to the end of the line — just like other languages. No more jumping to character 10 to get passed the old reserved (H,F,D,I,C,O) specification column.

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

If you need any fixed-form statements, I specs, you can put them in a /COPY file… or just write the code better 😉

....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....0....+....
In the following example, the code begins in column 1. The second DSPLY operation extends beyond column 90.
**FREE
ctl-opt main(greeting);
dcl-proc greeting; 
 dsply 'Hello';
 dsply world!';
end-proc;

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 your source code line. Obviously there is a limit on the record length for a source physical file, but there is no limit on the length of a line in an IFS file. IFS is the future and I predict we will be using IFS files for our source in code in the very near future. 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 RPG fully-free source 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.

Neat RDi formatting with **FREE

Take your existing RPG code and add **FREE to line one

IBM i RPGLE FREE is finally fully free form 1

Then simply click FORMAT on the SOURCE menu (or press CTRRL|SHIFT|F)

IBM i RPGLE FREE is finally fully free form 2

and *BOOM* cleanly formatted source code:

RPG **FREE

#NICE work IBM !

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

I’m always looking for awesome input, feedback and critique!

>