No Output on ERRMSGID

IT Infrastructure - Other
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

From: Chris Ringer To: All

After a few very frustrating hours of work on an AS/400 interactive program, I determined why my output was not always sent to the screen. I used indicator- conditioned ERRMSGIDs. The DDS manual says that when this method is chosen, output is not sent to the screen. Apparently, fields defined as OUTPUT on the screen are not sent, although fields defined as BOTH are sent to the screen.

Is there a way around this? I want all output sent-even when I have detected an error. I have an idea for eliminating the ERRMSGIDs. A call to SUBR23R3 retrieves the error text, which I then display in an output field on the screen. But I'd have to do my own reverse image, position cursor, and so on. Has anyone else encountered this ERRMSGID limitation?

From: James Coolbaugh To: Chris Ringer

Anytime you use ERRMSG or ERRMSGID, the data will not be resent to the screen- only the attributes are resent. I agree that this is a frustrating limitation. Here's what I do to get around it.

Prior to rewriting the format-if I have any error messages-I save the indicators, clear them, issue a WRITE to the format, restore the indicators and then issue the EXFMT. I can do this very easily since all my error indicators are in order (e.g., 70-89) and are specifically set aside for error messages on all screens. 2 illustrates the code.

Prior to rewriting the format-if I have any error messages-I save the indicators, clear them, issue a WRITE to the format, restore the indicators and then issue the EXFMT. I can do this very easily since all my error indicators are in order (e.g., 70-89) and are specifically set aside for error messages on all screens. Figure 2 illustrates the code.

This method works very well. You also do not get any screen flash as long as you have DFRWRT(*YES) on the display file and are not using the FRCDTA keyword on the format.


No Output on ERRMSGID

Figure 2 Forcing Output to a Display File with Errors

 *. 1 .. + .. 2 .. + .. 3 .. + .. 4 .. + .. 5 .. + .. 6 C MOVEA*IN,70 ERRORS 20 C ERRORS IFNE *ZEROS C MOVE *ZEROS CLEAR 20 C MOVEACLEAR *IN,70 C WRITEFORMAT C MOVEAERRORS *IN,70 C ENDIF C EXFMTFORMAT 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$