• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Opportunities, Not Problems!

    February 7, 2007 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

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Midrange Dynamics North America

    Git up to speed with MDChange!

    Git can be lightning-fast when dealing with just a few hundred items in a repository. But when dealing with tens of thousands of items, transaction wait times can take minutes.

    MDChange offers an elegant solution that enables you to work efficiently any size Git repository while making your Git experience seamless and highly responsive.

    Learn more.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    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

    Bottomline Hooks Into J.D. Edwards Via Oracle Fusion Middleware Faster i5 595 Rumored to Be Imminent

    Leave a Reply Cancel reply

Volume 7, Number 5 -- February 7, 2007
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

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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