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.
-
Print PC Documents to iSeries Printers
August 2, 2006 Hey, Ted
I have access through the Internet to a client’s iSeries machine, which has a Hewlett-Packard LaserJet printer attached to it. Is it possible for me to print a PC document (for example, a Word processing document or a spreadsheet) to the LaserJet?
–Jim
Here’s how I’ve done just that from my Windows XP machine. First, create an ASCII printer file on the iSeries. Place the name and library of the LaserJet’s output queue in the OUTQ parameter.
CRTPRTF FILE(QGPL/LASERJET) DEVTYPE(*USERASCII) TEXT('Print PC documents to Laserjet') OUTQ(outqlib/outqname)
Second, install the proper printer driver on your PC. Create the printer as a
-
EDTF and End-of-Line Delimiters
July 26, 2006 Hey, Ted
I have an IFS file whose lines are terminated with a carriage-return and line-feed combination. I need them to have a line-feed character only. Is there a quick way to strip out those carriage-return characters?
–Bob
Here’s an easy way that has worked for me.
First, make a backup copy of the file, in case something goes wrong. Now, use the Edit File (EDTF) command from a CL command line to open the file.
EDTF STMF('somefile.txt')
Press F15 to display the EDTF options screen. Key 5 in the Selection blank (the first entry field on the display). Tab to the
-
Don’t Depend on Arrival Sequence
July 19, 2006 Hey, Ted
We have a sequential (i.e., unkeyed) database file that contains several years of shipment transactions. We’ve built a lot of indexes over it, and we slice and dice it daily, all day long, from both programs and queries. We have two problems that surface occasionally.
The first problem is that sometimes we are not always able to see shipments in chronological order. Since we only store a shipment date, but not a time, we depend on the order in which shipments are loaded into the file to tell us which shipment occurred before another. Depending on the order in which
-
Unix Calls from OCL
July 12, 2006 Hey, Ted
Our shop runs a System/36 emulation environment on an RS/6000 AIX machine. We want to move this environment to an i5. In our current situation, we issue a ton of Unix calls within our OCL procedures. We have over 5,500 of these calls. We’re trying to wrap our arms around understanding the impact/feasibility of the move to the i5. If we can’t continue the Unix calls “as is,” going to the i5 probably will not happen.
We plan to keep the RS/6000 along with the i5. So, in a nutshell, is there a way to issue the Unix calls from
-
Query/400 Handles Zero Dates (Sort Of)
June 28, 2006 Hey, Ted
I have a file that has two dates that are stored in eight-digit numeric fields in YYYYMMDD format. Using Query/400, I wish to find the difference in days between the two dates. However, one of the date fields may contain values of zero. When I view the resulting data from the query on my display, Query/400 fills the difference field with plus signs if a date is zero. But when I direct the query’s output to a disk file, the query ends abnormally. Is there a way to replace the zero date with some other value, such as the current
-
Guru Readers Contribute Their Favorite SEU Tips
June 21, 2006 Hey, Ted
I have a couple of comments about your article, Lesser-Known SEU Commands. First, I’m still unashamedly an SEU user for one main reason: I like the “instantaneousness” of it. I can log in to the green screen and start editing a source member within SEU in just a few seconds, vs. the load/startup time of WDSc, the loading of libraries and files and member lists, and so forth.
Yes, I know–I can preload WDSc. I can set filters for libraries and files and members. I can create project definitions to load and display the views I need, etc. But
-
Database Output from CL
June 7, 2006 Hey, Ted
I know that IBM added a lot of new programming features to CL in the past two releases. However, one of the features I’ve been hoping for–the ability to do output operations to database files–doesn’t appear to be among them. Please tell me that I’m wrong and that there really is a way to update a database record within a CL program.
–David
You’re right in thinking that IBM has not added CL commands to write, delete, and update database records, David, but that does not mean that there is no way to update a record in a database file.
-
Thinking in Sets
May 24, 2006 Hey, Ted
I have a program that contains a complicated SQL command that selects a group of records exactly the way I want them selected. My boss has added a new wrinkle by creating an exceptions file, which would indicate other records that are to be selected, whether they meet the selection criteria or not. I cannot find a way to add the exceptions file without breaking my query. How do I modify my SQL command to handle the exceptions file?
–Clayton
You were taught the solution to your problem in elementary school. Do you remember learning about sets in math class?
-
Dynamically Sized Arrays
May 10, 2006 Hey, Ted
I have created an array to sort customer shipment data in the correct order for all part numbers that need to ship on a particular day. I want to define the array to grow as needed, as we anticipate our business growing. I don’t want the program blowing up when the number of elements is exceeded. Is it possible to dynamically size an array in an RPG program, rather than specify the number of elements at compile time?
–Jennifer
I have two ideas for you, Jennifer. The first is to use RPG’s memory allocation features to get memory as you
-
Where’s the Other MBROPT Option?
April 19, 2006 Hey, Ted
I suppose everybody knows that the Copy File (CPYF) command can copy data from one database file to another. And I suppose everybody knows that, depending on the MBROPT parameter, the data in the source file (the “from” file) can either replace or be added to the data in the target file (the “to” file). Furthermore, I suppose that some people know that the MBROPT(*UPDADD) option causes the system to replace the records that have matching key values and add records with no matching key values. But does anybody know how to add the records that don’t have matching key