Geekish Garrulous Grumblings blogs › How do I check for numeric values using RPGLE?
IBM RPG is a lovely language.
RPGLE (as the latest version is known) has got some heritage. Some might say its an old language, but it's kept young by its constantly evolving syntax. The current version of RPGLE (IBM i V7R1 at time of writing this) has free form code, multitudes of built in functions and handles big system database crunching with as much ease as it handles little web page servlets. RPG's evolved over 20+ years from an archaic and mystical thing bound by the rules of something called 'the logic cycle' into the modern power language for all IBM i Systems everywhere.
Personally, I find a few of the older functions still a bit annoying and wish there was a nicer way of handling them.
In this case, it's time to convict RPGLE's ability of checking data variables to see if they contain numeric or alphanumeric variables:
Your Honor - I present the defendant: TESTN
TEST(N) Is just a little bit smelly when it comes to really/truly finding out if a field is numeric or not.
Read the original at Geekish Garrulous Grumblings blogs.