|
I like simple and direct solutions that allow for easy changes later. Here would be my choice: C clear MSG C if (POO@#K <> 'A') C and (POO@#K <> 'B') C and (POO@#K <> 'C') C and (POO@#K <> 'D') C and (POO@#K <> 'E') C (alt #1) eval MSG = 'valid values are' C (alt #1) + ' A, B, C, D, E only' C (alt #2) eval *in33 = *on C endifI happen to prefer an indicator instead of a MSG field for a couple of reasons. First, if you have more than one validation error then the errsfl takes care of the displaying of the message. Secondly, the cursor is properly positioned for you should there be a validation error, third, setting of the indicator on the screen is pretty bulletproof.
Joseph Pascoguin wrote:
Hi In the below code: EVAL POO@#K = *BLANKS EVAL POO@#K = %SUBST(BDGXX:5:1)Iam extracting 5th position of BDGXX, now i want to validate this with one of 5 values A B C D E. When User enters anything other than that of these 5 values it should display a message in displayfile saying that "valid values are A,B,C,D,E only"... Please suggest various good ways to implement in RPGLE(not in display file)....Warm Regards, JoeP _________________________________________________________________FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.