Guru: What’s Your RDi Preference?
January 25, 2021 Susan Gantner
To say that RDi is highly customizable is putting it mildly. There are hundreds of preferences to set as well as many other types of customizations that can be done. I’m often asked about my favorite preference settings and other customizations. This tip includes a few of the ways that my own workspace differs from the default “out of the box” RDi settings.
In this tip I’ll concentrate on some of my favorite preference settings. In a later tip, I’ll continue the discussion on additional customizations I make in my RDi workspace using other methods besides the preferences dialogs.
I’ll start by talking about how to find the preferences themselves. The most obvious way is to use the Preference menu, accessed via the Window menu in Windows or from the RDi menu on a Mac. That will get you to all the preferences and it can be pretty daunting to try to figure out how to navigate through all the various nested levels. The filter text box in the top left corner can be a big help in narrowing your options by keywords if you know the right keywords to use. The filtering works much better since a recent release added much more extensive indexing.
There are other ways to get into the preferences dialog that can help streamline your search. One is to choose “Preferences” from a view menu in the RDi workbench. It doesn’t exist on all views but where it does, it can help get you to the right place more quickly. My favorite example of this is in conjunction with the Outline view. With an RPGLE source member open, click on the view menu icon, which looks like an upside-down pyramid near the top right corner of the Outline, and choose the Preferences option. This takes you to the Preferences dialog box but now you’ll be already positioned at the ILE RPG preferences. From there you can expand the list to show the other preference pages nested inside. So if you’re looking for RPG preferences specifically, this is a quick way to find them. There is also a Preferences option on the view menu in Remote Systems as well as a few other parts of the workbench.
One more method that can sometimes be helpful for finding preferences — as well as other features in RDi, such as views, perspectives, commands, etc. — is using the Quick Access search box on the far right end of the RDi toolbar. I’ve talked to RDi users who say Quick Access is their favorite way to find preferences. Personally, I’ve had more luck using one of the other methods to find preference options that I want to change.
Now that we know how to locate the preference pages we need, what ones do I like to change?
- Compile in batch (Command Execution page)
I always turn this one off. I find that makes it far easier to track down issues that occasionally occur during a compile, such as binding problems. With this preference turned off, I have much more information available to me in the Commands Log view in RDi for diagnosing and fixing situations such as “Definition not found for symbol” messages. With a batch compile, Commands Log just suggests that I display the compile job log. With a “non—batch” compile, even if I can’t resolve the problem from info in the Commands Log, it’s easier to find the job log to look at — it’s the one listed in the Jobs subsystem under “My host server jobs”. The page for this preference can be particularly tough to find so I’ll give you the full path to locate it from the full Preferences Dialog: Remote Systems > IBM i > Command Execution.
- Update production files (IBM i Debug page)
I make sure this one is turned on. In nearly all environments where I’ve worked, that’s an option that is required to debug programs — whether with green screen or RDi — so I like specify it so I don’t need to remember to do it when setting up a debug session. It’s particularly important when using Service Entry Points (SEPs) for debugging which is my favorite method. To find this one, I simply key “debug” either in the filter box in the preferences dialog or in the Quick Access filter. In either case, you’ll then need to locate “IBM i Debug” in the list of options that appear.
- Resequence lines at save (Remote Systems LPEX Editor page)
This is one that Ted Holt reminded me to include since it’s a favorite of his as well. It does makes sense to me to let RDi resequence for you after you have made changes to a member. A quick way to find this one is via the view menu in Remote Systems: Choose Preferences > Remote Systems LPEX Editor.
- Style for Automatic Closure of Control Block (ILE RPG > Key Behavior page)
One of the most common questions I get from students in my RDi classes is about how to change the case of the ENDXX statements the editor inserts for them. It’s a simple preference option. Choose your favorite style from the pull-down — mine is EndXx. I get to this page from the view menu in Outline (with an RPGLE member open). If you’re still using a very old (pre-V9.6) version of RDi, you won’t see a Key Behavior page but the option will be on the initial ILE RPG preference page. For any of you who are still on a pre-V9.6 version, you are missing out on many cool features. I suggest it’s a good time to upgrade! I’ve written a 10-part (so far) series of tips on the things you’re missing!
- User defined tab stops for fixed form code (ILE RPG > Key Behavior page)
If you’re unfortunate enough to do much work with the old fixed-form code, especially fixed-form logic, I definitely recommend customizing your tab stops and using the Tab key for navigation. For the most part, I simply remove the tab stops that I rarely, if ever, intend to use when coding new lines in order to streamline my use of the tab key to get where I need to be faster. Below you can see an example of my customized C spec. I have removed tabs (each tab is shown as ^) set by default for level breaks, conditioning indicators and Factor 1. Now from the C (which is inserted for me due to the “Repeat previous spec type” option on the same page) I hit Tab once and I’m at the OpCode column, one more Tab to Factor 2 and then on to Result when I need it. I never define data in logic, so I removed those tabs too. I left the tab stops in for the resulting indicators even though I never plan to code any of them in new code. But when they are already in use, I find it handy to be able to quickly navigate using tabs to a single indicator number to glance at the format line and confirm which indicator it is.
- Various formatting choices (ILE RPG > Formatter and ILE RPG > Free-form SQL Formatting pages)
Everyone has their own preferences and/or shop standards for how to format free-form RPG and embedded SQL. My intent here is to point out to you that you have control over things, such as how many spaces to indent and how to indent SELECT blocks. I like to indent WHEN and OTHER but I assume many don’t since it isn’t the default. These choices not only impact indentation while you’re writing new code, they are also used when using the automatic formatting option for existing code in the editor, using either Source > Format from the editor context menu or using the shortcut: Ctrl+Shift+F in Windows or command+shift+F in MacOS. Note that SQL formatting was enhanced in 184.108.40.206 and 220.127.116.11, so if you’re having trouble getting SQL formatted as you like it, upgrading RDi may give you more options.
There are a few way that I customize RDi that are not implemented via preferences. I’ll cover some of those kinds of customizations in my next tip.