Old Code And High Maintenance
January 20, 2014 Dan Burger
There are old RPG applications that just run and run. Minimal maintenance is required and the people who depend on these apps couldn’t be happier. But, you may have heard, this bliss is not universal. More often, application maintenance gets sloppy as the fingerprints of many coders, some perhaps with dubious credentials, takes a toll. Add a growing demand that applications do more and rely on data from multiple systems. New demands and old apps make for an odd couple.
Talk with an RPG programmer who deals with old code in a high maintenance circumstance and one that requires old applications do new tricks. That’s exactly what I did last week. Ken Killian, an RPG programmer for USXpress works in that environment. His skills with two tools–IBM‘s Rational Developer for i and the Linoma RPG Toolbox–are helping one of the largest trucking companies in the United States move forward. Two benefits–writing applications faster and maintaining source code more effectively–are the payoff.
This isn’t venturing into the unknown and untested. Killian has been at this for nearly 10 years. He has worked with IBM midrange computers since 1990. Most of the RPG code that is used at USXpress displays in a green screen. Some of it has a Microsoft .NET GUI on the front end so it displays in a more convenient format on the mobile devices that drivers rely on in their mobile offices. IBM i data is replicated to a SQL Server as part of the solution. That will raise some eyebrows among the IBM i faithful, but the trucking company with roughly 90 percent of its fleet using Windows-embedded devices finds the arrangement convenient.
“I’ve been employed here for nine years and have used the Toolbox for nine years,” Killian said. “Just recently I’ve been using it to convert fixed-format RPG to free-form with a plug-in for Rational Developer for i. This is easier than using the Toolbox with SEU. It saves steps. The auto indent of code is one of the many assets. It’s the number one thing I use the Toolbox to accomplish.”
Killian learned to code in fixed-format and because that’s what he was used to the conversion to free-format was not easy. If anyone tells you any change in routine is going to be easy, you have good reason to doubt it. But not trying something new because it is uncomfortable leads nowhere.
“Before I came to this company, I was used to doing fixed-format RPG. I wanted to do free-format, but I had been programmed to do fixed-format for years,” Killian said. “When I asked to do free-format in that job, I was slapped down with the excuse: ‘We don’t do free-format here.’ So I gave up asking. Eventually, though, my boss decided we should be moving forward and made free-format part of my learning objectives.”
The first step toward learning free-form RPG was to continue writing in fixed-format. Then he would use the Linoma RPG Toolbox to convert his fixed-format to free-format. Examining the code, he could see what was changing, which led him to start writing in free-format.
“I believe these types of things have to come down from management,” Killian said. “They have to push to make changes like this happen. It’s not like people don’t want to do it. There’s a high workload in many shops and there’s very little ‘play time’ to learn new things. Management needs to make room for learning new things. And people need to put in some afterhours time, too.”
The four-person development team Killian works on includes three .NET developers and a single RPG developer. New applications that incorporate RPG are a priority for converting fixed-format code to free-format. One of the lessons he learned was how to avoid getting burned when converting old RPG code to free form. His advice is not to get over aggressive without testing and debugging; there will be errors.
“In my section, I have been working with the same code for nine years and have converted it all to free-form. I am constantly executing this code. If it blows up in the middle of the night, it is a lot easier to read and maintain on the rare occasions when that happens,” he said. “The biggest complaint when converting code is that you didn’t convert everything. There will be things that can’t be converted without doing the conversion manually.”
Management is always going to ask about the payoff for taking on the conversion. Ease of maintenance that results in less time devoted to maintenance is the main thing. RPG free-format even makes sense to a Microsoft programmer, Killian says.
“I use RDi 99 percent of the time,” he says. “If I am only testing a three- to five-line bit of code, I’ll use SEU. But even if I write a little 20-line bit of test code to verify a routine, I hate checking for errors in SEU. When I started using RDi, I was only using it 10 percent of the time and it was driving me nuts, but you get used to it.”
He’s trying to convince other RPG developers to use RDi and I am showing off the short cuts. The size of the RPG development staff varies between 12 and 14, but only three are using RDi full time and it’s been available in the department for seven years. The RPG Toolbox version 5, which just became available, has a plug in for RDi allowing both to be used from the same interface.
The biggest difference between RPG Toolbox 5 and the earlier versions is that the predecessors only allowed conversions of the C specs, while version 5, which corresponds to the release of IBM i 7.1 Technology Refresh 7, converts the traditional H, F, D, and P specifications to also be recompiled in free-form syntax.