130 pts.
 AS400 – DDS
Hello All, I am having one doubt related to display file handling. Let’s say I have one Display file which handles different functionalities like add/update/delete/display of records. For Adding record (Function 10 from main screen) I have a separate window screen. I am doing data validation for this window screen. The problem I am facing is whenever I enters some invalid data and re-displays the window screen again the existing invalid data from screen gets cleared. I want to retain the invalid data, so that user can change the date and add record. Can anyone help me in this regards. Check out the code, If some error in window screen, as per logic it will GOTO LABEL1 and “EXFMT EMPADD” after this window screen will get displayed with no datas in fields. LABEL1 TAG EXFMT EMPADD IF *IN03 = *ON EVAL *INLR = *ON GOTO LABEL2 ENDIF IF EMPIDADD = *BLANKS OR EMPNAMADD = *BLANKS OR EMPSEXADD = *BLANKS MOVEL ERRMSG5 INFMSG2 GOTO LABEL1 ENDIF IF EMPSEXADD = *BLANKS OR EMPSEXADD <> 'F' AND EMPSEXADD <> 'M' MOVEL ERRMSG6 INFMSG2 GOTO LABEL1 ENDIF

Software/Hardware used:
ASKED: August 6, 2009  6:51 AM
UPDATED: August 11, 2009  2:15 PM

Answer Wiki:
I don't see any issue with the program code. How are the fields defined on the record format? If they're defined as I (Input) rather than B (Both input & output) that may be the source of your problem. ---------------------------------------------------------------------------------------------------------------------- right, I agree on the possibility of an I instead of a B on your window fields. I try to avoid being critical but, GOTO's and Labels are not allowed in most IT standards. These operations make code that is unreliable and hard to read. Phil --------------------------------------------------------------------------------------------------------------------- Meh. Tags can be misused like anything else - there are times when the contortions required to avoid tags make for more illegible code. ----------------------------------------------------------------------- I don't think the code above is well structured. Phil --------------------------------------------------------------------------------------------------------------------- Didn't say it was. Splat
Last Wiki Answer Submitted:  August 11, 2009  2:15 pm  by  Splat   5,670 pts.
All Answer Wiki Contributors:  Splat   5,670 pts. , philpl1jb   44,150 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _