Rational Developer for IBM i 9.6 Fixpack 7 is now available! The 126.96.36.199 fixpack contains some nice little enhancements and fixes!
One feature really caught my eye- The New extract procedure refactoring feature, used to convert business rules into reusable procedures in RPG sounds a bit saucy.
How does ‘Refactor Extract Procedure‘ work?
We select a block of code in a source member and:
right-click -> Refactor -> Extract Procedure
This grabs the code, creates a procedure, letting us change the procedure name to whatever we want. A great tool to convert those old blocks of code (or subroutines) into sub-procedures.
This is something I’ve wanted for a long time.
Special Offer for all NICKLITTEN Punters
20% Off with Coupon: NICKLITTEN
In Partnership with SNUG CBD - American readers get 20% off
CBD helps with relaxation, focus and great for pain relief. I highly recommend the SNUG CBD Tincture to help keep you in the zone when programming!
Fix list for Rational Developer for IBM i 9.6 Fixpack 7
The Fix List document lists the enhancements, APARs, and RFEs addressed by the RDi 9.6 Fixpack 7 are in FixCentral at https://www.ibm.com/support/pages/node/603339#9607
|New extract procedure refactoring feature can be used to convert business rules into reusable procedures in RPG.|
Select a block of code in a source member and right-click -> Refactor -> Extract Procedure. Change the procedure name to what you want and follow the wizard. Press Ctrl-Z to undo the procedure creation.
|New library list view to easily modify a library list from any RDi perspective. |
To get the new Library List tab click Window -> Show View -> Other -> IBM i -> Library List. Manipulate your current job library list using the buttons.
|Preference search filter has been enhanced to provide more accurate results for RDi preferences|
|RPG language update:- Editor support for the new OVERLOAD keyword. – Editor support for OPTIONS(*EXACT) for prototyped parameters. – Editor support for the new DATA-GEN opcode.|
|Enable editor navigation for marked occurrences of variables.|
|SQL formatter improvements.|
|Improved Copy To dialog reduces the chances of a user copying to an unintended location.|
|RFE 77798||Show variables larger than 4,095 characters in the RDi debugger.|
|RFE 102060||Service Entry Points now allow conditional entries for breakpoints.|
|RFE 116542||Persist display hover text for procedure parameters.|
|RFE 120965||Double-click of source elements to include * symbol when appropriate.|
|RFE 121191||Sort by name control in outline should not affect sorting of key fields.|
|SE69406||RDI 188.8.131.52 ILE RPG outline incorrectly shows VARCHAR(0:2) for sub-procedure for varchar return value defined with a constant.|
|SE71614||RDI 184.108.40.206 – Opening PNLGRP source in RDi leads to a StringIndexOutOfBoundsException|
|SE71721||RDI 220.127.116.11 – Option 2 (edit) in the object table should open members in edit mode even if the default mode is open as browse.|
|SE72030||RDI 18.104.22.168 – ILE RPG content assist fails due to IllegalArgumentException: Comparison method violates its general contract|
|SE72031||RDI 22.214.171.124 – New procedure wizard does not show keywords for a passed parameter that has been modified.|
|SE72032||RDI 126.96.36.199 – Setting SBMJOB additional parms in RSE connections may result in duplicated parms in compile commands and compilation failures.|
|SE72289||RDI 188.8.131.52 – Source may become corrupted when i Projects are configured to add or remove sequence numbers and dates|
|Correctly tokenize literals in fixed form source.|
|%ELEM(x) line references in the outline should be marked as modified.|
|Fixed Visualize Application Diagram only works for the last member opened from the source menu.|
|Fixed port range preferences input for RSE to correctly handle ports 1-65535.|
|The default communications port number now specifies the beginning of a port range rather than a specific static port. If a port is unavailable, RDi will increment to the next port in the range and try again to connect.|
|Update Java to eliminate legacy Java 6 requirement to run RDi on macOS|
|Access Client Solutions integrated with the product updated to 184.108.40.206. Note: Java 8 is required to be installed on the system.|
How can I install the latest fixpack?
Follow the same steps I waffled about in a previous blog – How to update RDI
After the upgrade finished, I launched RDi and saw a new screen. The INSTALL MIGRATION WIZARD:
This wizard imports and reinstalls previously installed plug-ins. It is triggered because we are launching eclipse for the first time or your IBM Rational Developer for i has been updated.
Press NEXT and it wobbled around for a few seconds:
Anyhoo, lets cancel this and dive into this new 220.127.116.11 version:
First Look: New Extract Procedure Refactoring feature
Let take some very smelly old RPG400 column based code (in this case the standard IBM i PROOF RPG code snippet) and convert something to a sub-procedure.
Why? Because there is nothing like giving this new “Extract Procedure Refactoring” function a good solid complicated bit of legacy code to test it with:
H DFTNAME(PROOF) FQSYSPRT O F 132 PRINTER D ARRAY S 8 DIM(3) D CTDATA PERRCD(1) D INSTALL C CONST('INSTALLATION') D DS DS D OK 1 8 INZ('VERIFIED') C EVAL OK = 'FAILED' C MOVE ARRAY(2) ARRAY(3) C RESET OK C SETON LR OQSYSPRT T LR 1 1 O INSTALL 21 O 24 'OF' O 28 'THE' O 36 'ILE RPG' O 45 'COMPILER' O + 1 'IS' O OK + 1 ** COMPILE TIME ARRAY
And just for giggles lets change the main code into a subprocedure called mainline.
Open this code in RDi:
Select the code block that we want to convert into a sub-procedure:
Then we just right click and select > REFACTOR > EXTRACT PROCEDURE
Very nicely, this little extract gives us various options to control how our new procedure is going to look:
For this first run, lets leave it at default and see what it does:
But isn’t that old fashioned RPG400 code ugly!
So, by sheer coincidence, an old mate of mine emailed me some code yesterday asking me to cast my critical modernisation eye over it and make some recommendations.
So, lets run that code through some code modernisation and then use this refactor process to convert all the subroutines to sub-procedures.
Yes, Yes, I know that this idea is overkill, nonsensical and totally unnecessary, but totally fun too 🙂Me. In Nerd mode.
Second Look: New Extract Procedure Refactoring feature with modern RPGLE
OK, this blog entry is getting so long and excitedly waffley its time to break this second RPGLE example into another blog entry: