fhg
Volume 9, Number 39 -- December 16, 2009

Miscellaneous Comments from Readers

Published: December 16, 2009

by 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


Sponsored By
PRODATA COMPUTER SERVICES

Simplify your iT!

DBU - super easy to use.
The leading data access tool on the market.

DBU RDB - does the work for you.
Analyze data on all your servers. MySQL, Microsoft SQL Server,
Oracle, DB2 databases and others.

RDB Connect - programmatic access to remote data!
Full SQL access to remote databases from all System i high-level languages.

Download your free trials NOW.
Order today and SAVE $$$!
www.prodatacomputer.com
800.228.6318


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
Power Systems i: Serve's Up

Abacus Offers i 6.1 Upgrade Virtual Test Drive Service

The Server Market Sees Some Stability

As I See It: What's Next?

Untested Backup and Recovery Fools Midrange Shops

Four Hundred Stuff
Data Masking Tool from Camouflage Now Supports DB2/400

Manhattan Keeps Commitment Strong to System i Products

Apptio Tailors BI Software for the IT Department

Micro Focus Emulation Software Brings Windows 7 Support, New Interface

Property Tax Records Kept Safe, Thanks to i365

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
December 12, 2009: Volume 11, Number 50

December 5, 2009: Volume 11, Number 49

November 28, 2009: Volume 11, Number 48

November 21, 2009: Volume 11, Number 47

November 14, 2009: Volume 11, Number 46

November 7, 2009: Volume 11, Number 45

October 31, 2009: Volume 11, Number 44

TPM at The Register
AMD cuts to the core with 'Bulldozer' Opterons

Verari Systems staff join alumni network amidst 'restructure'

Sun brews up Java EE 6

Red Hat opens up Spice desktop virtualisation protocol

IBM punts Linux-only mainframes

Europeans spend more on servers in Q3

IBM builds Pacific ring of cloud

ParAccel flashes data warehouses

Sun-Oracle x86 server combo tops the SAP charts

Intel Larrabee letdown leaves HPC to Nvidia's Fermi

Red Hat revs real-time MRG Linux to 1.2

IBM thinks outside the box with containerized data centres

THIS ISSUE SPONSORED BY:

SEQUEL Software
ProData Computer Services
Twin Data


Printer Friendly Version


TABLE OF CONTENTS
Encouraging Mere Mortals

Miscellaneous Comments from Readers

When i5/OS Backups Keep You Waiting

Four Hundred Guru

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2009 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement