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.
December 9, 2019 Ted Holt
You are busy. The people you serve need you to do more than one human being can do. You don’t have time to look for comments or updates to the articles we run in this august publication or any other. For this reason, I was pleased to publish some of your feedback in last week’s issue. This week I am pleased to share a bit more.
In response to Guru: MERGE, Chicken, and Eggs, John asked a good question and made a good point:
How is using this merge technique under commitment control any different than just doing the …Read more
December 2, 2019 Ted Holt
The year has flown by. Before we know it, it will be 2020. The century is flying by, too. We’ve almost consumed a fifth of it. That seems like a good excuse to see what we might glean from some of your feedback. It’s been a while. More to come next week!
Several readers wrote regarding the need to remove hard-coded values from programs. Jim brought up the problem of compile-time tables and arrays.
I find cases where data is hard coded (state names, product categories are a few examples) for tables or arrays in dozens of programs.
I wish …Read more
November 11, 2019 Ted Holt
This article has three purposes. If you use check constraints in your database, the purpose is to help you make better use of check constraints. If you don’t use check constraints, the purpose is to encourage you to use them and to point you in the right direction. If you already know all this stuff, the purpose is to goad you to email me and teach me something I don’t know.
The purpose of check constraints is to keep invalid data out of the database. That may seem unnecessary. Isn’t that what the applications are supposed to do? Yes, but …Read more
October 28, 2019 Ted Holt
Have you been to a conference lately? If not, you may be shortchanging yourself. I attend several conferences every year and I get immense benefit from them. I learn a lot, I get a break from the day-to-day, and best of all, I build relationships with other people.
I recently attended the RPG & DB2 Summit in Minneapolis, where I met a bright young developer named Kevan Robinson. He was kind enough to share his version of a tip that I shared with him and other attendees. It’s a technique that I learned ages ago from Craig Mullins, a mainframe …Read more
October 21, 2019 Ted Holt
I cannot say enough good things about common table expressions. Words like wonderful and marvelous don’t begin to describe them. However, CTEs do add a bit of complexity to an SQL query, and when the result set doesn’t contain the correct results, any common table expression can be the culprit. Fortunately, debugging queries with common table expressions is not difficult.
To illustrate what I mean, let’s assume we have a query that retrieves shipment information for one day. It involves a few tables:
- a one-row table containing a shipment date
- a table of shipment header information
- a customer master table
September 30, 2019 Ted Holt
Which came first: the chicken or the egg? I don’t have time to ponder such trivialities. However, I am glad to know that SQL has a way to help me with chicken-and-egg database updates, i.e., when two statements need to run but each politely needs for the other to go first.
Suppose you support an IBM i system that keeps up with inventory. It has an item master table (physical file) that stores general information such as a description, the standard cost, and the list price of an item.
create table ItemMaster (ItemNumber char(6), Revision dec(3), Description char(20), Cost dec(5,2),… Read more
September 16, 2019 Ted Holt
IT has changed a lot since I entered the field several decades ago, but some things have not changed. I would read in those early days that COBOL was dead, and I read the same thing now. Yet COBOL is 60 years old and still going strong. Back then I heard RPG criticized as “Real Poor Garbage”. These days I hear it scorned as “legacy”, which I assume is supposed to mean the same thing. Yet today’s RPG is better than any of its predecessors for business programming.
RPG supposedly does not have the features of modern languages. Maybe not, …Read more
September 9, 2019 Ted Holt
Do you, like Bob Seger, sometimes feel that you are nothing more than a number? Me too. That’s because to many people, that’s exactly what we are. And if there’s one thing that computers are good at, it’s assigning numbers — to orders, to accounts, to invoices, to transactions, and of course, to people. Since we have to make the computer assign numbers, we may as well learn the modern way to do it.
In my earliest days of programming, I would store the last assigned of a series of numbers in a data file. (The S/34 and S/36 …Read more
August 26, 2019 Ted Holt
Fifteen years ago, reader W.G. asked me about the possibility of treating a data area as a one-row table (a physical file with one record) in an SQL query. The question intrigued me because in my System/36 days, I had often wished that I could access the local data area (LDA) as a one-record data file in a query.
Today, thanks to Scott Forstie and his team at IBM, I update my response to W.G. with more information. It’s not that the technique I presented in 2004 is outdated — it’s as relevant as ever — but that the fine …Read more
July 8, 2019 Ted Holt
We are building a new system and want to use modern programming and database techniques. I have had quite a time trying to get nulls to act right. It gets confusing fast because RPG handles them differently than the way embedded SQL does. When using SQL for I/O, how do we handle the two null formats?
There are several ways to go about the “problem” of nulls. Let me give you one simple method, but keep in mind that it’s not the only way.
First, let’s create a table and put some data into it.
create… Read more