MC Systems Insight
MC Power Technology Manager
MC RPG Developer
MC Power Developer
MC TNT Tips 'n Techniques
MC AIX Expert
MC Linux Expert
MC Mobile on Power
This Week @ the MC Press Bookstore

August 31, 2012 | Volume 9 Issue 35


TOP STORY: The CL Corner: A CL-Based Implementation of RPG Built-in %Check
FEATURED ARTICLE: BCD and Zend Forge PHP Market Alliance
NEWS HIGHLIGHT: IBM to Acquire Kenexa To Bolster Social Business Initiatives
FORUM: Poll a File on a Remote FTP Server and Then Transfer It
MC STORE: Top 10 Best-Selling Titles
EVENT: Help/Systems Solutions Summit 2012
Manage Subscription | Contact Us


Feature Article - Programming
The CL Corner: A CL-Based Implementation of RPG Built-in %Check

Find characters that don't belong!

bruce viningWritten by Bruce Vining

I recently received the following from Wayne R.: "I use RPG's %CHECK function to check if any characters are not valid. Is there something similar in CL?" RPG's %Check built-in, if you're not familiar with it, returns the first position in a variable that contains a character that is not in a list of valid characters. If, for instance, you had a variable with a value of 'cabbage', then comparing this to a list of valid values such as 'abc' would return a position value of 6. This is due to the sixth character (the "g") not being in the list of valid values ('abc'). If all characters in the variable are found in the valid character list, %Check returns a position value of 0. While CL currently does not have a built-in such as RPG's %Check, you will see it's not that difficult to create a CL command to provide this function for programming our IBM i—and in fact that's what we'll do in today's article.


Feature Article - News
BCD and Zend Forge PHP Market Alliance

Two companies that see app modernization as the future of the IBM i join hands to facilitate that goal.

john gristWritten by John Ghrist

Business Computer Design International and Zend Technologies have formed a market partnership that aims to promote use of each others' PHP-related development tools for modernization of IBM i applications.


In the News

Support MC Press - Visit our Sponsors

Forums Sponsor





Search Sponsor