Convert it to RPG FREE FORMAT -- RPG Evolution 2017 style
That's right -- this is step five of four.
Much like RPG evolution, the modern day free-form RPG code is way more advanced than earlier neanderthal column based RPG.
The original code blog was way back in 2009, but RPG has quietly been improving all the time since then. IBM release new opcodes, built in functions, source snippets all the time. Most recently, we had a quite big update which gets rid of H, F and D specs and allows us RPG Nerd to code in almost entirely freeformat.
// system name: fix slp06
// program desc: fix the records on slp06 showing RPG EVOLUTION
// program no: ef001
// date: 2017.07.12
// author: nick@nicklitten.com
//-------------------------------------------------------------------
ctl-opt datfmt(*iso) timfmt(*iso) option(*nodebugio) debug;
dcl-f EFP01L01 keyed infsr(*pssr);
dcl-f ACSUMMAR keyed usage(*update) infsr(*pssr);
// Externally defined file defn's for *LDA and *PSDS
dcl-ds lda extname('LDA') dtaara(*lda) end-ds;
dcl-ds pstat ext PSDS extname('PSDS') end-ds;
in lda;
reade l#cono acsummar;
// is generated by accumulating OEP65 invoices
chain cusn06 efp01l01;
bodv06 = amount;
else;
bodv06 = 0;
endif;
enddo;
// --- Program Termination ---
out lda;
*inlr = *on;
//standard error handling routine.
/include qgpl/qrpglesrc,pssr
This is the same old 2009 program in RPG Free Format -- aka RPG4 -- AKA RPGLE /Free.
I really enjoy coding in the latest /freestyle format of RPG. It makes coding easy, very readable and much easier to maintain. No more lining up screens of code, easy formatting and creation of code snippets (using code editing tools like RDi) and the look and feel of RPG has finally caught up with other modern languages.
As I said in the earlier blogs " Easier code to read means easier to maintain means saving time means saving money!"