In Numeric field if user enter blank then system interprets it as zero. Say 1xxx1 is interpreted as 1001 where "X" is blank. I used Valnum keyword along with Check(RZ) to handle the same but getting "Invalid Character sequence in numeric only field" error. I want to show user specific error in place of that. Please suggest how to handle these kind of error.
Could you use a MONITOR / EndMon around the EXFMT which generates the error? If so, you could then trap the error and send the user the message you wish.
My experience only leading and trailing blanks get interpreted as zeros, leaving a blank between two valid digits in a numeric will throw an error by the system.
No string with blanks embedded between digits will be seen by the iSeries as a numeric field.
If, for some reason, you want the users to be able to enter invalid data so as to allow you to return a specific message you'll have to define the input field as character. You would then need to validate the contents of the field within the program.
There may be a better solution. What is actually keyed into this field and how is it being used / stored for starters. Is this field strictly numeric or alphanumeric? What error message do you want and on what conditions?
Discuss This Question: 4  Replies