AS/400: Handle error in subfile screen

755 pts.
Tags:
AS/400
AS/400 Subfiles
How do I handle error mechanism in subfile screen when invalid option was selected by user? We need to display a message in the subfile display screen.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

It depends on your validation. You could have another record format that would display the error message by ding an EXFMT on the record if the error condition is met.

You could also use the ERRMSGID () in the DSPF to control your error message.
If it’s a simple check of valid data you could also use the VALUES().

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    Best (most flexible, most wdely used, most documented) is probably to use a "message subfile". All messages sent to the named program message queue are displayed when the message subfile is displayed.

    In general, send error messages to the program message queue while validating input. When you're ready to redisplay the main subfile, first issue a WRITE for the message subfile control record. Then display your main subfile.

    Message subfiles are usually defined as one or two lines starting at line 23 or 24.

    A useful example of DDS for a message subfile is in the 'Displaying Error Messages from Subfiles' topic in Chapter 4 of the Application Display Programming manual. Chapter 8 of that manual gives a lot of info about various ways of displaying messages.
    35,620 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: