fhg
Volume 7, Number 5 -- February 7, 2007

Opportunities, Not Problems!

Published: February 7, 2007

by Ted Holt


The code accompanying this article is available for download


One of my former bosses would often greet me with the phrase, "We have an opportunity." I suppose he didn't like the word problem. A recent problem I faced turned out to be a great opportunity. The utility I developed has turned out to be handy, and I thought you might like to have it in your toolbox.

It all started when a CL program that I had written blew up because the value of a variable was in mixed case (i.e., "Print") instead of uppercase ("PRINT"). An IF command in a CL program was testing the variable against a fully uppercase PRINT and determining that the two values were not equal. I had not foreseen the possibility that the value might not be all uppercase and did not plan accordingly. (Just call me shortsighted.) Besides, there is no built-in function or command in the CL language to convert a value to uppercase, and had I thought about it, I would not have wanted to write an RPG program just to capitalize one trifling variable.

I wrote a command to convert a character value to all uppercase. I shrewdly and cannily named it UPPERCASE. (Well, not really. I shrewdly and cannily named it something else, but in this article it's shrewdly and cannily named UPPERCASE). You can find the source code for the UPPERCASE command and the RPG program that it runs (simply named CASE) in the downloadable code that accompanies this article.

Here's an example of the UPPERCASE command at work in a CL procedure.

   dcl    &PrintOpt   *char      64
   dcl    &PrintTest  *char      64

   uppercase value(&PrintOpt) tovar(&PrintTest)
   if (&PrintTest *eq PRINT) do

Isn't that nice? The case of the value of the print option is immaterial in the IF condition.



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


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
E-mail: software@worksright.com
Web site: www.worksright.com


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
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

Aldon:  ALM solutions to accelerate your application development
COMMON:  Join us at the 2007 conference, April 29 – May 3, in Anaheim, California
Maximum Availabilty:  Secure, cost-effect, real-time iSeries replication software


Books on Sale at the IT Jungle Store: 30 Percent Off for 30 Days

The System i Pocket RPG & RPG IV Guide: List Price, $69.95; Sale Price, $49.00
The iSeries Pocket Database Guide: List Price, $59.00; Sale Price, $41.00
The iSeries Pocket Developers' Guide: List Price, $59.00; Sale Price, $41.00
The iSeries Pocket SQL Guide: List Price, $59.00; Sale Price, $41.00
The iSeries Pocket Query Guide: List Price, $49.00; Sale Price, $34.00
The iSeries Pocket WebFacing Primer: List Price, $39.00; Sale Price, $27.00
Migrating to WebSphere Express for iSeries: List Price, $49.00; Sale Price, $34.00
iSeries Express Web Implementer's Guide: List Price, $59.00; Sale Price, $41.00
Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95; Sale Price, $56.00
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00; Sale Price, $62.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00; Sale Price, $34.00
WebFacing Application Design and Development Guide: List Price, $55.00; Sale Price, $38.00
Can the AS/400 Survive IBM?: List Price, $49.00; Sale Price, $34.00
The All-Everything Machine: List Price, $29.95; Sale Price, $21.00
Chip Wars: List Price, $29.95; Sale Price, $21.00

 

The Four Hundred
IBM Upgrades System i5 Disk Controllers, Adds Enclosures

IBM and ISVs Launch VIP Program to Reinvigorate System i5 Sales

Sundry Other System i5 Announcements

The X Factor: One Socket to Rule Them All

The Linux Beacon
PA Semi Samples Homegrown Dual-Core Power Chip

Intel, AMD Push and Pull for X64 Market Share

VMware, XenSource Launch Virtualization Bundles

The X Factor: One Socket to Rule Them All

Four Hundred Stuff
RevSoft Pushes 'Lights On' Approach to Systems Automation

Oracle Cools on Fusion, Focuses on Current ERP

LogLogic Aims to Ease Log Data Crunch

Halcyon Updates Systems Management Tools

Big Iron
IBM Buys Softek to Bolster Data Migration Offerings

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
February 3, 2007: Volume 9, Number 5

January 27, 2007: Volume 9, Number 4

January 20, 2007: Volume 9, Number 3

January 13, 2007: Volume 9, Number 2

January 6, 2007: Volume 9, Number 1

December 30, 2006: Volume 8, Number 50

The Windows Observer
Windows Vista: It's All About the Security

Gates, Ballmer Wow NYC with Vista Windows, Office 2007 Shindig

Microsoft Profit Sinks 28 Percent in Vista's Shadow

AMD: Native Quad Core Opteron Will Best Intel Quasi Quads

The Unix Guardian
AMD: Native Quad Core Opteron Will Best Intel Quasi Quads

IT Salaries Rise by 5.2 Percent in 2006, Dice Survey Says

IBM Bags System p5 Super Deals, But Is Power6 Slipping?

Ask TPM: The Economics of Open Source Software

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

THIS ISSUE SPONSORED BY:

WorksRight Software
SEQUEL
RPG & DB2 Summit



TABLE OF CONTENTS
Opportunities, Not Problems!

SQL Cross Platform Interoperability: The Proper Function

Admin Alert: Selectively Sending Break Messages to Active Users

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Julian Date file

Interesting resource and apparently free!

Alert emails from the iSeries

CL Question on Overrides

Entry parms getting overlayed--RPG





 
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-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement