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.
-
Another Way To Skin A Generic Cat
June 27, 2012 Hey, Ted
I am writing in response to your recent article, Add Powerful Generic Processing to Your Applications, regarding generic processing. I have another, simpler technique that you should share with my fellow readers of Four Hundred Guru.
–D
D’s technique is to use the Remove Link (RMVLNK) command. Here’s the example he (she?) gave me:
RMVLNK OBJLNK('/qsys.lib/dug*.devd')
This command deletes device descriptions with names that begin with DUG. Notice that RMVLNK requires objects to be specified in the IFS naming convention.
You may use RMVLNK or its two aliases, DEL and ERASE, for objects other than libraries. For libraries,
-
OLAP Is Simple, Once You Understand It
May 9, 2012 Hey, Ted
I have a problem that I solved with a simple RPG program, but I know it can be done with SQL as well. I needed to generate a simple table of employee ID, name, and average of the last five weeks paychecks. Is this simple or complicated to do with SQL?
–Barry
You are correct that SQL can do the calculation, Barry. However, you’ll have to decide for yourself if it’s simple or complicated.
First, let’s get some data to work with. I’m going to simplify your question slightly by using a name only, without an ID, to identify an
-
How Do I Format Date Literals? Let Me Count The Ways
May 2, 2012 Hey, Ted
I have a strange SQL problem. I have an SQL DELETE command that works perfectly in interactive SQL. But when I use Run SQL Statement (RUNSQLSTM) to execute it, it does not find any rows to delete.
–Jabir
Strange, indeed. I gave Jabir some suggestions, but none of them helped. Jabir found his problem himself. In one of those environments (he didn’t say which), the date format was *MDY, while the date format of the other one was *DMY. SQL was interpreting a date value in two different ways. It’s fortunate that Jabir did not test with a date that
-
NOMAX? No Way!
April 25, 2012 Hey, Ted
I just read *NOMAX Does Not Mean Infinite Capacity and I politely beg to differ. I work at some shops with smaller and older systems with smaller disk capacity (70 GB, 140 GB). Some are already using more than 70 percent of available space. If I read the capacities correctly, a physical file can hold over four billion records. I did some calculations and I think I’d fill up a system before reaching capacity.
For DDS-described files, I usually set some maximum number of records, as 10,000 seems ridiculously low. Now that you have mentioned SQL described tables, which I
-
Specify SQL Table-creation Library at Runtime
April 25, 2012 Hey, Ted
I have an RPG programs that creates work tables in QTEMP. I’d like to be able to specify the library at runtime. I tried using a host variable for the library in a CREATE TABLE command, but that didn’t fly. I am using the system naming convention. Can you help?
–Ben
I wish CREATE TABLE would allow a host variable for the explicit qualifier, but it doesn’t. Here are a few ways that work.
1. Use dynamic SQL. Embed the library name in the SQL command.
D SqlCommand s 256a varying D WorkLib s 10a /free *inlr = *on; SqlCommand
-
Have Your Cake and Eat It, Too
April 18, 2012 Hey, Ted
I did not take your suggestion to write a subprocedure and embed it in a service program. It seemed like too much trouble to me. I wrote a program instead. It does the trick and it’s a lot less complicated than all those hoops you told me to jump through. I guess ILE isn’t all it’s cracked up to be.
–Chuck
Chuck presented me with a problem. I suggested he write a subprocedure to solve it. He didn’t like the idea of creating a module, writing binder language, creating a service program from the module, adding the service program to
-
Cut the Gordian Knot
April 4, 2012 Hey, Ted
I just love those BIFs that IBM added to RPG. I can’t understand why anybody would use old RPG op codes instead of the BIFs. But I’ve run into a brick wall with %SUBST. Help!
–Vince
Allow me to explain Vince’s situation. He was assigned to revise a program someone else had written. The program reads a list of the file names in a certain directory on their network, and has to do other processing depending on file name extension (the part of the name following the last period).
Here’s a program similar to the one that Vince had to
-
*NOMAX Does Not Mean Infinite Capacity
March 21, 2012 Hey, Ted
The practice in our shop has been to set the initial size of physical files to what seems to be a reasonable value. In many cases, we leave the size at the default value of 10,000 records with three increments of 1,000 records each. Sometimes we change one or more of these values, usually the first one. Someone has suggested that we stop the guesswork and create all files with SIZE(*NOMAX). However, someone else is afraid that a program will go into a loop and fill up the disk space with output operations. Who’s right?
–Flora
I agree with the
-
Interpreted CL Members
March 7, 2012 Hey, Ted
I am thinking of writing a program that will read a source member of CL commands, interpreting them and running them dynamically one at a time. I can think of several situations in which such a utility would be more suitable than compiled CL programs. Before I re-invent the wheel, I want to know if IBM i already has something like that.
–Tom
Yes, there’s something like that. You can do this sort of thing with input spooling. I’ve only used input spooling on occasion, so I’m not an expert, but I can show you how it works.
Create a
-
I Was Just Wondering. . .
December 14, 2011 Hey, Ted
Note: The code accompanying this article is available for download here.
I was wondering if you have come across any techniques using subprocedures to simulate associative arrays in RPG IV. I’ve just started experimenting with the idea. I’d like to create dynamic associative arrays using service programs and user indexes.
–Steve
As a matter of fact, I had thought about implementing associative arrays in RPG, Steve. I’ll share my thoughts on that topic. But first, let me talk about wondering.
I do a lot of wondering. You’ve seen the results of many of my wonderings in previous issues of