× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Mike,

> Is there a way to convert lower to uppercase in a CL program, or do I need
> to do an RPG thing?

I'd use the "Convert Case (QLGCNVCS)" API to convert lower to upper in a
CL program. I published sample CL code that converts upper to lower in my
newsletter. If you've got a Pro membership to the iSeries Network, you
can read it here:
http://www.iseriesnetwork.com/resources/clubtech/index.cfm?fuseaction=ShowNewsletterIssue&ID=18395

It's pretty simple.  To change it to convert the other direction (lower to
upper) change the 3rd part of the control block so that it's all zeroes.

For example, right now my sample code lists this:

     CHGVAR VAR(&CTLBLK) VALUE(X'00000001+
                                 00000025+
                                 00000001+
                                 00000000000000000000')

To make it convert the other direction, do this instead:

     CHGVAR VAR(&CTLBLK) VALUE(X'00000001+
                                 00000025+
                                 00000000+
                                 00000000000000000000')

One nice thing about this API is that it's able to use the job's CCSID.
Unlike techniques that rely on QDCXLATE or RPG's XLATE or %xlate()
capabilities, it'll work properly no matter what language your system is
configured for....  without any changes...

It's the best approach I've found.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.