Ted Holt
Ted Holt is the senior technical editor at The Four Hundred and editor of the former Four Hundred Guru newsletter at Guild Companies. Holt is Senior Software Developer with Profound Logic, a maker of application development tools for the IBM i platform, and contributes to the development of new and existing products with a team that includes fellow IBM i luminaries Scott Klement and Brian May. In addition to developing products, Holt supports Profound Logic with customer training and technical documentation.
-
Guru: Assertions, Take 2
February 12, 2024 Ted Holt
It’s been almost 20 years since Cletus the Codeslinger introduced assertions to the IBM midrange world, and in that time, I have included many assertions in my RPG programs. During that 20 years, RPG has changed a bit and Cletus has quit writing articles (but not source code), so I’ve taken it upon myself to update the code he gave us.
First, however, it might be a good idea to briefly review the topic of assertions for readers who don’t know what they are. An assertion is a program statement or command that cancels a program if a fatal condition …
Read more -
Guru: Using Mixed Lists To Add “Data Structures” To CL Commands
January 15, 2024 Ted Holt
I can’t remember the last time I worked on an RPG program that had no data structures, but it was probably on a System/34. Everybody uses data structures, and with good reason – they are as handy as a pocket. When writing CL commands, it is possible to include parameters that are formatted as data structures. IBM calls them mixed lists. In the following paragraphs, I show how this is accomplished.
You may not realize it, but you have used IBM-supplied commands that have mixed-list parameters. For example, the Copy File (CPYF) command has several such parameters: FROMKEY, TOKEY, INCCHAR, …
Read more -
Guru: TryIT – You’ll Like It
October 2, 2023 Ted Holt
I have watched children play Whac-a-mole, but I’ve never played it myself, perhaps because the game unpleasantly reminds me of programs that I have had to work on. I fix one bug, only to see another bug rear its ugly little head. Life’s too short to endure such nonsense. Besides, it is embarrassing for someone to tell me that the program I supposedly just fixed is still broken.
Suppose you’re working on a 4,000-line RPG program and you comment out lines 650-660. What you don’t realize at the time is that a variable used in line 2755 has to …
Read more -
Guru: Aliases — Underused and Unappreciated
October 3, 2022 Ted Holt
One of the first things I learned about programming in the RPG II language was that field and variable names had to be six characters or less and they did not have to be pronounceable. I accepted this without question, as I was new to computers and figured that everything that had to do with computers was arcane and other-worldly. It wasn’t until I began work toward my computer science degree and was privileged to learn Pascal that I came to appreciate the value of longer identifier names, and of clarity of source code in general.
You don’t have to …
Read more -
Guru: Beware of SQL Precompiler Variables
September 26, 2022 Ted Holt
In a famous Henny Youngman joke, a patient says, “Doctor, it hurts when I do this,” to which the doctor replies, “Then don’t do that.” Corny jokes aside, I have spent decades trying to identify programming practices that hurt when I do them, and having identified them, cease to do them. A case in point is the misuse of the variables that the SQL precompiler defines in my RPG programs, variables such as SQLCODE, SQLSTATE, and SQLER3.
“So what,” I hear you ask, “is the problem with these variables? ” Well, they’re global, and global variables are evil. Global …
Read more -
Guru: The SND-MSG Op Code And Message Subfiles
September 12, 2022 Ted Holt
If you’re one of the many IBM i programmers who still writes green-screen applications, think about how your programs communicate with the users. How do you tell a user that a value that he’s just entered is invalid, or that he needs to press a command key to proceed? I’ve seen several methods, but a common one — and my favorite — is to communicate through a message subfile.
The nice thing about message subfiles is that I can report two or more messages at one time. I like the computer to find as many errors as possible and let …
Read more -
Guru: The CALL I’ve Been Waiting For
June 20, 2022 Ted Holt
Christmas came to my house early this year. May 3, to be exact. Boy! Was Santa Claus good to me! IBM gave me two presents! The first was a CL enhancement that I had desired for years. The second was an improvement that, to my delight, almost obsoletes a utility I wrote years ago. Both have to do with the CL CALL command.
CALL is arguably the most used and most important command in CL, yet for all these years it has remained untouched. I’m glad that IBM has seen fit to devote time and resources to the enhancement of …
Read more -
Guru: Global Variables in Modules
December 13, 2021 Ted Holt
When I first learned to program computers (RPG II, COBOL 74), the only kind of variables I knew of were global variables. Any statement within a program was able to use any variable. It was not until I started my computer science degree that I found out about local variables, which are known to only part of a program. Since that time, it has been my practice to use local variables as much as possible and global variables only when necessary.
Ideally an RPG program, service program, module, or subprocedure would have no global variables at all, but I don’t …
Read more -
The Four Hundred Guru Retires
December 13, 2021 Ted Holt
This is the last issue of The Four Hundred for which I am serving as technical editor.
I have been editing the technical content of and writing articles for this august publication for 20 years. For most of that time, this has been a side job that I’ve done outside of normal working hours (i.e., nights and weekends). I’m ready for a change. Technical editing and writing are not easy and they take a lot of time, time that I had rather spend doing other things.
In the days ahead I plan to spend:
- Less time sitting and more time
-
Guru: Abstract Data Types and RPG
November 8, 2021 Ted Holt
An abstract data type (ADT) is a type of data and a set of operations defined over that type of data. Using ADTs allows a programmer to work with data in terms of functionality rather than physical representation. The ADT is the basis of object-oriented programming. Does that mean that abstract data types don’t apply to procedural languages like RPG? Not at all. Quite the contrary.
Before I show you how you can use abstract data types in RPG-based applications, let me further illustrate abstract data types with another, non-OO object — the user profile. The user profile is a …
Read more