I worked on a system where the constraint name WAS the message. The name
can be 128 characters, and if it's enclosed in quotes, you can use
spaces and punctuation, e.g.
ADDPFCST FILE(A) TYPE(*CHKCST) CST('"This field requires a value that is
10% lower that the employee salary if the employee is under 42 years
old. Please try again."')
Then just use the name of the constraint as the error message.
On 5/17/2017 8:19 AM, Jonathan Wilson wrote:
<snip>
I have also seen an article (on iprodev I think) that allowed a way of
sending messages for constraints by naming the constraint in such a way
that it was possible to translate its name into a more human readable
message. Instead of the generic "CPFxxxx constraint error for constraint
&1" the program retrieved the constraint name (from &1) CST0004,
CST0009, etc. from within the error message and then used that name to
send the actual message "CST0004" from a message file that said
something along the lines of "invalid customer prefix error".
</snip
As an Amazon Associate we earn from qualifying purchases.
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.