Miscellaneous Comments from Readers
December 16, 2009 Ted Holt
Dear Esteemed Colleagues:
One of the best parts of writing for this newsletter is hearing from the readers. Whether what you write is laudatory or not, I appreciate your wisdom and your willingness to share it with me, and I regret that I’m not able to answer every email I receive. To end the year, here are some of your comments, with my replies or comments in italics, for the benefit of fellow readers.
Thanks for the maze article. I enjoyed reading every part of it. It reminded me that a maze is a curled tree after all, and recursive processing is the way to process a tree data structure as I learned in the old days. I had to deploy the same technique, way back, to parse XML-like data in old RPG, which did not support recursive processing. The solution was creating a dummy subroutine to call its calling subroutine, plus arrays to stack up values from each instance of the subroutine, as the system would not keep track of them. Thank you again and have a Merry Christmas!
A maze is a curled tree? I never heard that before. Thanks for the enlightenment!
I’ve spent a ton of time reading all I can find about pase env or qsh. Finding your article, EDTF and End-of-Line Delimiters, Take Two, you said you didn’t know why redirecting a file to a new file changed the line terminating character.
Here’s the answer: http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/rzalf/rzalflineterm.htm. Now, if someone could help with a gpg encrypted ACH file problem I’m having, it would be great!
Thanks for the link, Jim. I’ll look at it soon. There’s so much I don’t know. How’s a guy supposed to know it all?
As always, thanks for what you do!
My 16 and 1/2 years at the insurance brokerage ended due to a sale of a subsidiary and less programming workload. I recently had a nice interview, and the words “offer” and “start date” were sent to me in an email! I think perhaps there is a timing issue, but I emailed again today to express my continuing interest and the fact that this old codger ordered Jim Martin’s Free-Format RPG IV on last Tuesday, received it Thursday, and has gone through most of it by today.
Actually, at the other shop I wasn’t in a position to decree what RPG was used, but old codger Ken was the first to use new instructions Check, Scan, Iter, Leave, etc., when they came out years ago. Yes, I proclaimed that RPG/400 was better than RPG IV, but at that shop it was I who showed another programmer how to code an RPG IV program in order to use EditC.
Anyway, at the recent job interview I mentioned that I would program in the fashion that the shop used, and the senior programmer mentioned he was a proponent of free-format. I said I realized the indentation was very valuable as a documentation tool, but I wondered out loud to him if the B001, B002, etc., are shown on the compile for free-format. He didn’t know, as I guess hardly anyone but old codgers print compiles! I said I was worried that one might mess up the indentation (hard to do, I admit) and thus the true logic might be misrepresented by the faulty indentation. (I wonder, do you know if the compiler prints B001, B002, etc., to show nesting levels for free-format?)
Anyhow, if few people pay attention to the definitive nesting levels shown by the compiler, then obviously free-format has the very valuable feature of showing visually the organization and flow of a program.
Please convey my thanks to Susan Gantner and Jon Paris for their BIF articles in the April 15, 2009, Four Hundred Guru. Susan may be surprised to hear that I might be doing free format soon, as I corresponded with her awhile back on an article that she did, and I might have mentioned to her that I have a kind of infamous Web page going back about almost 10 or 15 years, stating that RPG III (RPG/400) was better than RPGIV. That page was done by me at home on my WebTV device, as I still don’t have a PC at home! The WebTV idea was bought by Microsoft, so my modem and wireless keyboard, which are used with a TV set, are now known as the Microsoft Internet TV Device.
Anyway, thanks again to you, Guru!
I always enjoy hearing from fellow codgers. I need to remind Ken, as I do others, that I am not a Guru. The Four Hundred Guru is a newsletter, and I am the editor of that newsletter.
I just discovered this AS/400 parody site, and thought I might share it with you: Mid-Deranged.com
I didn’t know that site existed, Dave. Thanks for telling me about it.
Please encourage conversion to C++, RPG.NET from BluePhoenix (only if IBM buys BluePhoenix) or EGL if EGL is for real. If RPG-V had been announced 7 to 9 years ago with real Class, Methods, Properties, Variables, polymorphism, etc., the community could have moved forward.
Now it is time to break the mold, Ted. Is this just a job?
Thank you, John! For some time, I’ve wanted to run some articles on C++. The first idea I had was for an article that showed how much easier it would be to call APIs from C++ than from RPG. The problem is that I don’t have enough experience with C or C++ to do a good job.
Is anyone out there interested in writing some articles (or collaborating with me) about the advantages of C++?
I hope all is well with you and your family.
I just read your latest, and the first article caught my eye. I dealt with this for a long while. Finally in V5R4, IBM gave us an option to remove blanks from the delimited fields with the RMVBLANK keyword. You can remove *TRAILING, *LEADING, *BOTH, or the original pain, *NONE.
CPYTOIMPF FROMFILE(QIWS/QCUSTCDT) TOSTMF('/somedir/custcdt.temp') MBROPT(*REPLACE) RCDDLM(*LF) STRDLM('"') RMVBLANK(*TRAILING) FLDDLM(',')
Keep up the great work. I always like the SED stuff.
Once again, I Overlooked the Obvious, and Russ was not the only one to tell me so!
You could use free-format calculations in current RPG programs, but as we have noticed in our shop, it is messy and breaks the flow for the existing code. Most of our developers really dislike seeing “free” inserted in the middle of existing code. My recommendation would be to save it for new programs.
That sounds reasonable, Dianne. Thanks for the recommendation.
I am shocked that you didn’t present an SQL solution in your Case Conversion article. I’m sure you had a good reason though. Regardless, here is a quick demo of how I do the conversion.
D mixed s 38a inz('aBcdEf') D upper s 38a D lower s 38a /free Exec SQL set :upper= upper(:mixed); Exec SQL set :lower= lower(:mixed);
I always subscribe to the KISS philosophy and, elegant though your case conversion strategy is, I know I’d be looking at that code and trying to work out what the heck it was doing! RPG has a very straightforward way to do this and it’s pretty obvious what you’re doing. It also has the advantage that one set of constants work for any length of variable.
Define two constants:
D lo C 'abcdefghijklmnopqrstuvwxyz' D UP C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
We do this in a common declaration copy member so they’re automatically available to every program.
Then simply translate the variable:
Option = %XLate(lo: UP: inOption); Option = %XLate(UP: lo: inOption);
I appreciate the comments of Ken, Trevor, and several others who wrote about the same techniques. I didn’t intend to provide a complete list of ways to convert case. I’ve used both of those methods. At my day job, I have uppercase and lowercase subprocedures in a service program, and that’s what I use AFAIK, no one had ever written about the bit-twiddling technique.
Thanks again to everyone who wrote, for your feedback and comments. May 2010 be our best year ever!