By Jef Sutherland
Our iSeries shop is like many others. We have a combination of RPG III and RPG IV code, and as we maintain our applications, we convert from RPG III to RPG IV.
In the past, we've always used IBM's CVTRPGSRC (Convert RPG Source) command as the first step of the conversion process and then modified the generated source to bring it in line with our standards. But we've now decided that we'd like to convert everything to free-format RPG. Because IBM doesn't supply a command to convert from fixed-format to free-format RPG, I decided to manually convert a small program in order to get a feel for the effort a manual conversion would require. One hour and very few converted source lines later, I decided that I needed help!
A manual conversion of our applications was obviously out of the question, so I decided to evaluate RPG Toolbox from Linoma Software. The product not only converts fixed-format to free-format RPG, it also provides several productivity tools for iSeries developers. Here, I review installation, documentation, features, and support for Linoma's RPG Toolbox.
You can download a 30-day trial version of RPG Toolbox from the Linoma Web site at http://www.linomasoftware.com. When I downloaded it, the install went without a hitch.
When you download the software, you have the option to either download a Windows auto-installer version that does everything for you (I like that!) or download the software as a save file and then go through the steps to get the save file to your iSeries and restore the software yourself. The software resides on your iSeries server in library RPGTOOLBOX library (it doesn't interfere with IBM's CVTRPGSRC command).
Make sure you also download the two PDF files that accompany RPG Toolbox. One of these files is the RPG Toolbox manual; the other is an "SEU Cheat Sheet" that I've found very handy for using the various SEU tools.
The documentation for RPG Toolbox is well prepared and organized. I found what I wanted, when I wanted it. Plus, you have to love any documentation that contains the words, "Happy computing and LONG LIVE RPG!"
After completing the installation, I first printed the SEU cheat sheet. I became so intrigued by the new SEU enhancements that I focused on them before the conversion tools. After all, the SEUPLUS feature of RPG Toolbox supplies over 70 SEU line commands! To use the new SEU commands, access any SEU session and press F13 for options. Page down and change the User Exit Program option to the SEUPLUS program (Figure 1).
I didn't have time to examine every SEUPLUS option, but I can share a couple of my favorites. Consider the D-specs shown in Figure 2.
These D-specs show that I've broken my own standards by not putting the variable declarations in alphabetic order. Call me picky, but it's just easier to find your variables and check out what's around them when they're sorted alphabetically. You know how it is, though. You get in a hurry, you have to fix a bug, or you copy code from another source member, and you don't take time to clean it up. Now, you can type the new SEU command SORT on the first line of code, type SORT on the last line of code, press Enter, and SEUPLUS sorts the lines of code, as shown in Figure 3.
SEUPLUS will also precompile source so it has access to all of the variable types and lengths. After the precompilation finishes, type VV on a source line with the variable of interest, position your cursor to the variable, and press Enter. The variable's type and size appear on the message line. This is a great feature when you're working with someone else's code and you're unfamiliar with the variables it contains.
The RPGWIZ (RPG Wizard by Linoma) command runs Linoma's source conversion program. If you use Linoma's installation steps, you can also use PDM option RF to start the process. The RGPWIZ command has three pages of options (they're self-explanatory) and for most of your needs, the default values will suffice. Your original source code member is not changed. New source code is placed in another source file or source member.
For conversion to free-format RPG, RPGWIZ leaves in fixed-format those op-codes unsupported in free-format and inserts the /Free and /End-Free statements at the appropriate places.
A few of the options that I really like are:
I've had no major problems with the source code conversion tool. RPG Toolbox does what it says it will do.
The product was easy to install and use, so I didn't need much support. I did, however, call Linoma's toll-free number to ask some questions and offer some suggestions, and I actually spoke to a person! You can't beat that in today's voice-message era.
IBM went about 90 percent of the way with their implementation of free-format RPG. Several op-codes have not been implemented, however (see "Moving Forward with RPG Free," article ID 12020, for details). When your free-format code has many breaks due to unsupported op-codes such as Move and TestX, the code appears dumpy. So what's a developer to do? In some cases, you could develop procedures to support the missing operations and manually replace the fixed-format code with your own procedure calls. With a little tweaking, Linoma's tool can help further.
I'd love to see Linoma's RPGWIZ command provide an option to convert unsupported op-codes with procedures calls when possible. Linoma could provide both the "stub" for the procedure calls and the source for the procedures. Shops could then enhance these basic procedures to fit their own needs. With such an enhancement, RPGWIZ could probably convert 99 percent of RPG code to free-format! The developers at Linoma have indicated that they're working on providing this new capability soon.
Linoma's RPG Toolbox is a valuable and easy-to-use tool. I'd been using an exit program for color-coding source lines, but RPG Toolbox does that and so much more. I recommend it highly for RPG III-to-RPG IV or fixed-format-to-free-format conversions.
Jef Sutherland is an iSeries NEWS technical editor and the vice president of IS for Kampgrounds of America, Inc., in Billings, Montana. He is a coauthor (with Bryan Meyers) of the book VisualAge for RPG by Example (29th St. Press, 1998). You can e-mail Jef at jsutherland@iSeriesNetwork.com.
RPG on the iSeries. Throughout the incarnations of the first RPG based midrange machine to today's iSeries, RPG for many has been the language of choice. Even now with RPGIV and Free Format RPG, it remains as one of those languages that surpasses all others, in terms of functionality and clarity.
And yet the development tool with which we write our code remains pretty much the same beast that it was 20 years ago. I am talking about IBM's SEU.
Maybe we have ourselves to blame. Few people actually take the time to explore the wonders of SEU commands, and many actually spend time writing RPGIV programs that mirror the same RPGIII programs that they are used to. And why does this continue? Basically, because it can! Another factor is that the work environment does not always allow for experimentation, which means that personal development can sometimes become stagnant.
Alas, fear not my little code monkey friends...Thunderbird2 (the big green one with all the good bits in its belly) is leaving Tracey Island…
International Rescue arrives in the form of Linoma Software who has packaged together a full suite of utilities into a product called Linoma's RPG Toolbox. This product is the bigger brother of an application originally called CVTILERPG. This function initially allowed the user to pipe in RPG source code, crank the handle, and the result would be a work of modern art, with new opcodes and fancy upper/lower case combinations. This was a significant enhancement over the IBM supplied command (CVTRPGSRC), but, unlike its counterpart did not stay static.
Today, this RPG modernization feature is now known as the command RPGWIZ, and forms a major part of the Toolbox.
Down through the years, since the IBM supplied CVTRPGSRC command was first launched, the compiler has gone through significant changes. New opcodes, built in functions and even free format, to name but a few. To someone still using RPG400, the possibilities are know but the path to conversion may seem a little daunting.
The Toolbox's RPGWIZ command gets down to the root of the problem by supplying a simple command that will take in RPG code and magically transform it into shiny new code that has:
In fact, everything that the manuals tell you you should do, to produce modern RPG, is contained within a single conversion routine. RPGWIZ is completely configurable, so you can choose the level of code modernization you desire. For instance, if you're not yet ready for the free format style of RPG, you can configure RPGWIZ to keep your code in fixed format while taking advantage of much of the new RPG IV syntax available for your OS/400 release.
I had great fun with this product for the simple reason that it works in cleaning up even the most badly formed RPGIV imaginable. Although I do not write any RPG400 anymore, I sometimes fall in the trap of writing RPGIV from the viewpoint of the RPG400 programmer.
Running my code through RPGWIZ shows me the error of my ways and exorcises my bad habits whilst producing stylish, modern code.
The ability to convert old code to new, safely and using all the latest functions, is not to be sniffed at, but Linoma's RPG ToolBox contains even more features.
A module named SEU Plus gives SEU functionality which boarders on the outer edge of imaginable limits.
As standard, SEU is packaged with various line commands that give the programmer a certain amount of functionality that for editing source with the same degree as a very early word processor. Essentially, SEU allows the coder to copy, insert, delete, move, overlay and even hide, single or multiple lines of code. The programmer can mix this with a few templates and prompts that aid the editing of code. And every RPG programmer will use a mixture of these repeatedly during the working day.
This works well, but IBM's SEU has not been significantly updated or enhanced for as long as I can remember.
Linoma's SEU Plus gives the programmer further options and shortcuts by providing over 70 additional line commands. With these at your fingertips, there will be no excuse for not producing stylised, easy to read code.
Some examples of the uses of SEU Plus are:
So what does this mean and how do we benefit?
This is best described with an example. Let us imagine that you normally colour lines of comments in white so that they will easily stand out. In a particular example, you decide the comments you are adding need to leap out at the reader, and want to colour them in red. No problem, just type CD in the sequence number and press enter. The selected line is coloured RED. To colour a block of code, specify CCD on the starting and ending sequence numbers, and you have a block of RED comments.
But SEU Plus is not just about changing the colour. SEU Plus can be used to do all the pretty stuff, but also removes lots of repetitive functions. For instance, specifying the start and end of a section of code to be "commented out" is achieved in a snap.
But it is the more modern functions that this product provides that gives it the gold star.
Because SEU Plus provides hooks into RPGWIZ, sections of code can be rejuvenated by line. This means that individual sections of code can be converted to free format or sub-procedures as easily as copying a section of code.
It also has the ability to expand or compress a section of code. As an example, when I code a prototyped call in RPGIV, my personal style is to put all the parameters over the least number of lines. A coder friend of mine prefers to spread his code with one parameter per line. Using SEU Plus, I can compress his statements into the fewest lines possible to make it more readable to me, whilst he can expand my lines to make it better for him. Of course, this doesn't alter actual functionality of the code, but allows us both to toggle easily between our preferred styles.
And we are still scratching the surface.
SEU Plus provides snippets of predefined source code which can quickly be found and used from within SEU. By using these pre-tested and proven source code, the development cycle can be greatly shortened with less coding and testing time. Using Snippets can also help ensure programming standards are being followed.
Over 140 pre-defined snippets are included with the Toolbox, including:
You can also easily create your own custom snippets of source code using the Toolbox-supplied Snippets as template examples.
Access to the snippet collection can be achieved in a number of ways, by using defined line commands or by pressing a defined command key. Commonly used snippets can also be retrieved auto-magically by creating your own SEU Line Commands. For instance, using line command I* will include three comment lines into your source code, as this command is predefined within the Toolbox.
When selecting a snippet to include, most of them will intelligently prompt for values to fill into the snippet. For instance, the RPG CHAIN operation Snippet will prompt for the key list name, file name and other related values. Linoma's Toolbox will then merge those values with the snippet before inserting into your current source member.
Although there are many features to list, one other significant addition is the memory function. Toolbox allows you to submit store source lines into "memory", which can be reviewed, retrieved and added to other source members. This function works in the same way as a PC style clipboard, and remains persistent throughout your interactive job. This does not require split browsing or searching for members and significantly decreases the amount of time to insert code into other members.
Linoma's RPG Toolbox is easy to install and just creates a single product library to run. Once installed you have a couple of choices. Access to the SEU Plus functions can be added at an individual level by modifying SEU session defaults or by adding a global exit point to make it available for everyone.
Documentation for Linoma's Toolbox is first class, and gives highly detailed information about each of the functions involved, and the fold-up and keep Cheat Sheet (quick reference card) is essential to keep handy to remind yourself that you now have a easier way to get things done.
It is easy to fall foul to the 80/20 rule (twenty percent of functions used eighty percent of the time), but just 20% of Linoma's Toolbox is worth 100% of unaided SEU!
By Don Rima
We know that at some point in history someone invented a wheel. Later, someone modified this wheel by adding an axle. After that, the chassis came into play. This was soon followed by a directional-control mechanism, which we would today call the steering wheel. I'm fairly certain that the chap who created the wheel would have loved to get his hands on my 1986 Olds because it not only possesses the basic functions he needed in the original product, it has some added features—shocks, seats and, when you roll down the windows, air conditioning.
With that in mind, have you ever examined a new item and said something like, "I wish I had that awhile ago!"? Many of us who've had the chance to play with multiple platforms and systems have uttered words similar to those and developed a list of functions we used on former systems that we wish were available now.
For example, having worked with a number of source editors in the last few years, I've always wondered why the source entry utility (SEU) was missing certain functions, such as:
Thankfully, I've found something that helps fill SEU's gaps. Enter the RPG Toolbox from Linoma Software.
This was fairly smooth and simple, but you need an attached PC to install this to the iSeries. There's no LODRUN capability on this CD. Yes, I know it's convenient to download over the Web, but a LODRUN option is necessary and the additional code required isn't statistically significant. While the ability to use FTP is nice, there are times when LODRUN is the most efficient option.
Have Linoma Software run you through the 10-minute demo. It's well worth the time, and you'll be more productive, more quickly. Plus, staff members seem to enjoy explaining the product's features so much that you may have to tell them you need to hang up and go play with RPG Toolbox for a while.
There's very little learning curve here. Basically, you must understand the new commands that provide the additional features and functions. Veteran SEU users should find most of the button-pushing to be old-hat—stuff they could probably do in their sleep or during a Chicago Bulls game.
Very nicely done. The commands and options are well explained, and Linoma provides great examples of the before-and-after source code segments so you can get an idea of what to expect and what the command is doing.
No problem. RPG Toolbox works like a champ for me.
One small note that I'm mentioning for completeness: I received a system-generated error because I selected a block of source that was too large for one of the routines I used. I selected a 4,000-line block, which is small by many standards, but I got a data-space error. This error, which I'm told is an API issue, has been reported to Linoma.
This product has a number of uses. For example, say you're using the latest iSeries model and, now that free-format RPG is available, you want to make your code a bit more readable. Or perhaps the old op codes don't float your boat and you want a fast way to convert things to a more current look and feel. With RPG Toolbox, you could run them through a translation function to change the syntax to more current methods. Let's start with removing all those indicators on the left and changing them into more readable coding methods using IFs, etc. Some of the old methods also would be better implemented by using built-in functions (BIFs) and so forth. In short, let's modernize your old RPG, even though it's been run through the conversion utility.
Got a bunch of internally defined data structures whose start and end positions are a bit hard to determine and wish you could convert them to the easier-to-read D spec format? This product does that.
Perhaps you would also like a quick way of converting your subroutines to procedures? No problem; that also works well.
Those who are using the free-format functions of V5R1 will find the indentation tool handy. It's nice to have a tool do the indentation for readability versus counting how many times you hit the space bar to keep things in line.
Then there's the color-coding of source code in SEU so that you can markup your code for internal documentation. There are also case conversions for code uniformity.
One thing SEU has long lacked is the capability to copy to multiple targets. Say I want to copy the same code segment to multiple places. Now, I must do a copy code (CC) block for each copy I want to make. Imagine being able to select the lines of code once and copy to the target as many times as desired.
Speaking of code segments, many shops have sections of standardized code that are used to fulfill certain recurring functions. With RPG Toolbox, these are called "snippets," and you can import a snippet on the fly. More than 140 snippets are included, and you can create your own. That's easier than the old open>mark>copy process we're using now.
Need to do some sorting? Perhaps you've inherited a bunch of field definitions in D specs, and, over time, they've gotten out of alphabetical order. RPG Toolbox allows you to sort them, making it easier to find what you're looking for without scanning through source code.
Speaking of finding things, ever run into a variable while coding and wonder how it's defined? Well, you can do a quick preprocess on a source member. Then, at any time while you're coding, you can put your cursor on a field and the system tells you the field's length and type. It would be nice if it provided a field description and line or file definition as well, but you have to have something to wish for.
When I was doing the walk-through on this product, I actually had to tell the tech support guy, "Hey, I've seen and heard enough, now let me go play awhile." Linoma's tech support folks are not only familiar with their product, they're gung-ho about it.
RPG Toolbox helps fill in the programming development manager (PDM) and SEU gaps some of us have been complaining about for awhile. It's clean and easy to use, and the additional development environment features should help make your code more efficient—in addition to making it easier to read and follow. It runs as an add-on to SEU, so think of it as an SEU-plus.
I think it's well worth the time to get the CD and run through Linoma's demo and manual.
|Ease of use||3.9||0.15||0.585|
Points given are on a scale of 0 to 4, with 4 being the highest. Each category is assigned its own weighting from the total of 100 percent.
KICK THE TIRES: Absolutely. This baby is worth a test ride!
Don Rima has 16 years of experience with IBM midrange systems, in positions ranging from programmer to MIS. For the past eight years, he has owned a consulting group. Don has held several offices in the Washington Area Midrange user's group.