Return to the RPG Tips
Converting Alpha to Numeric in RPG /Free
The following was found on the Google Group comp.sys.ibm.as400.misc.
If %Check('0123456789' : FieldAlpha) = 0 // contains numeric data Else // contains non-numeric data Endif or
You could also do it this way. This has the added advantage that fieldAlpha CAN have decimals, negative sign, and blanks. /free Monitor; fieldNumeric = %dec(fieldAlpha,9,2); On Error; (Error handling goes here) EndMon; /end-free
[report a broken link by clicking here]