IBM Rational Developer for IBM i
Trying to format your RPGLE source code and seeing “Formatting Failed: No Model Available”?
One of the nicest features of using RDI, compared to the old world of green screen SEU coding, is the ability to automatically format and tidy your program code.
Using the FORMAT CODE option in Rational Developer for IBM i (let’s just call it RDi from now on 🙂 ) our source code will get nicely tidied, with SQL syntax being indented and common words case being applied, IF/ELSE/END loops will be indented, comments will be aligned and the whole program will generally be tidied and given a good old blast of housecleaning:
- Source code is cleaner to read
- Easier to see any logic flow problems while you are writing code
- Nice to apply common layouts when writing multiple programs
- Much easier to debug
- and it makes Jesus/Mohammed/Thor happy 😉
Example before RDi FORMAT
Example after RDi FORMAT
ERROR MESSAGE — Formatting Failed: No Model Available
Quite simply – you are probably seeing this error because your outline view is turned off.
RDi needs the program outline to be able to format the code properly. The OUTLINE means it has scanned through the code and understands the syntax, confirms the syntax is correct (obviously bad syntax will mean bad reformatting right?)
You can turn it on manually by pressing the REFRESH button in your OUTLINE VIEW or, my recommendation is to turn on AUTOMATIC REFRESH in the settings.
Window > Preferences > Remote Systems > Remote Systems LPEX Editor > IBM i Parser > ILE RPG (or type ILE RPG into the shortcut in the preferences window)
Look near the bottom and you will see ‘Update the Outline View when text is changed in the editor’.
Now you can see the outline view has not refreshed so click REFRESH for it to build. On some systems, this might take anything from a few seconds to many seconds to build, especially if you are working with a huge program, or a slow connection to your IBM i System.
The refresh status is always shown down on the bottom right of your screen (that little green bar):
When it has finished refreshing you will see the MOST EXCELLENT outline view telling you all kinds of things about your program:
Now press REFRESH (CTRL – SHIFT – F) and *boom* it works!
If it doesn’t work – restart RDi and it will.
PS – This didnt work one time
Another reason is that Java (or whatever version you run) has got it’s knickers in a twist
So I did a JAVA UPDATE, rebooted and then it worked again.