• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • 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.

    –Ted

    Hey, Ted:

    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!

    Avid reader,

    –Efren

    Hi, Efren:

    A maze is a curled tree? I never heard that before. Thanks for the enlightenment!

    –Ted

    Hey, Ted:

    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!

    –Jim

    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?

    –Ted

    Hey, Ted:

    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!

    –Ken

    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.

    –Ted

    Hey, Ted:

    I just discovered this AS/400 parody site, and thought I might share it with you: Mid-Deranged.com

    –Dave

    I didn’t know that site existed, Dave. Thanks for telling me about it.

    –Ted

    Hey, Ted:

    RPG is so last generation. IBM‘s own C++ could help manage this [problem of global variables]. RPG encourages bad habits and is:

    1. Labor-intensive
    2. Disappearing

    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?

    –John

    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++?

    –Ted

    Hey, Ted:

    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.

    –Russ

    Once again, I Overlooked the Obvious, and Russ was not the only one to tell me so!

    –Ted

    Hey, Ted:

    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.

    –Dianne

    That sounds reasonable, Dianne. Thanks for the recommendation.

    –Ted

    Hey, Ted:

    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);
    

    –Ken

    Hey, Ted:

    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);
    

    –Trevor

    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!

    –Ted

    RELATED STORIES

    Two A-maze-ing Programs

    EDTF and End-of-Line Delimiters, Take Two

    Circumventing Two Limitations of CPYTOIMPF

    A Bevy of BIFs: Dealing with a Bad Date

    A Bevy of BIFs: %CHAR, %EDITC and %EDITW



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    10ZiG Technology:  Ask us about our new Ethernet Terminal for only $195!
    Bytware StandGuard Security:  Are you monitoring and auditing your System i security? FREE trial.
    Manta Technologies:  Year-End SALE! 40% off the complete library and all combo packs. Ends Jan 15

    IT Jungle Store Top Book Picks

    Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    Chip Wars: List Price, $29.95

    SafeData Moves Data Center to SAS Type II Facility Power Systems i: The Windows Conundrum

    Leave a Reply Cancel reply

Volume 9, Number 39 -- December 16, 2009
THIS ISSUE SPONSORED BY:

SEQUEL Software
ProData Computer Services
Twin Data

Table of Contents

  • Encouraging Mere Mortals
  • Miscellaneous Comments from Readers
  • When i5/OS Backups Keep You Waiting

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle