Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error Messages in a DSPF

970 views
Skip to first unread message

Markjstev

unread,
Nov 7, 1997, 3:00:00 AM11/7/97
to

I am trying to use errmsgid in a display file. It works fine it I am only
display one format. However if I try to display two formats (i.e. a command
key line, and a body format, with code write cmdkey, exfmt scr01) the
errmsg does not show up. I tried to put errsfl in the DDS also. Any ideas?


OSITim

unread,
Nov 7, 1997, 3:00:00 AM11/7/97
to

Does the command key record format overlap any portion of line specified on the
MSGLOC keyword?

Nigel Wiggins

unread,
Nov 9, 1997, 3:00:00 AM11/9/97
to

It could be that either you are using the same line for command key and
message, or you've missed an overlay command.

The following example may help.

Create message & message file

CRTMSGF MSGF("work library"/USERMSG)

ADDMSGD MSGID(MSG0001) MSGF("work library"/USERMSG) MSG('&1 is invalid.
Entry must be &2') FMT((*CHAR 8) (*CHAR 8))

Create display file......

A DSPSIZ(24 80 *DS3)
A CA01
A ERRSFL
A MSGLOC(22)
A R RECORD1
A OVERLAY
A FIELD1 1A I 3 2
A 50 ERRMSGID(MSG0001 USERMSG &MDTA)
A
A MDTA 78A P
A R CMDKEY
A OVERLAY
A 23 4'F1=End'


Create RPG

FTSTMSGFMCF E WORKSTN
*
C MOVE *ON CHECK 1
*
C *INKA DOWNE*ON
C CHECK ANDEQ*ON
* Display screen...
C WRITECMDKEY
C EXFMTRECORD1
* Validate...
C FIELD1 IFNE 'Y'
C FIELD1 ANDNE'N'
C SETON 50
C MOVELFIELD1 DATA 16
C MOVE 'Y or N 'DATA
C MOVELDATA MDTA
C ELSE
C SETOF 50
C MOVE *OFF CHECK
C ENDIF
*
C ENDDO
*
C SETON LR
C RETRN


Markjstev <mark...@aol.com> wrote in article
<19971107024...@ladder02.news.aol.com>...

Ann E. Gerling

unread,
Nov 9, 1997, 3:00:00 AM11/9/97
to

Something that I have learned was that if you use the same line for the
command key line and the errmsg line, the message overlays the Cmd Key
line.

The things I check for when my messages don't display are the use of the
OVERLAY keyword, either at the file, or record level AND to make sure the
indicator the message is conditioned on isn't getting SETOFF before the
display of the record. Sounds simple, but sometimes it happens!


---------------------------------------------------------------------
Ann Gerling
SPANS Consulting Group
AS/400 Consulting & Contract Programming
email: ager...@nemonet.com
Phone/FAX 573.985.7726
--------------------------------------------------------------------


0 new messages