When using a subprocedure, you may need to go back one extra level in the
call stack.


Thanks,
Jeff Davis
Dental Network of America




"Buzz Fenner" <bfenner@xxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
09/03/2008 11:33 AM
Please respond to
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>


To
"Discussion RPG" <RPG400-L@xxxxxxxxxxxx>
cc

Subject
QMHSNDPM, QMHRMVPM, & Error Message Subfiles






To begin, I?ve looked through the archives and have not found a solution
to
the problem I?m having. Secondly, this is my 1st attempt at using error
message subfiles (in RPG) and the two APIs. I coded the two APIs in
subprocedure calls in the main program. I?ll eventually incorporate them
into a service program, but I wanted to keep it simple to begin with.

The user is presented with a subfile (in a window) where they enter check
numbers, which are then validated. A single check number can generate
numerous errors, hence the perfect ?excuse? to use an error message
subfile.
Field PgmPgmQ (in the DDS) is set to the PEP procedure name. The sending
and displaying of the messages work perfectly ? that is only on the first
pass. Using QMHRMVPM to clear the queue (prior to re-validating the input
on subsequent passes) does not appear to be working. Checking the error
API
data structure in debug mode reveals nothing at all. So, each time the
check numbers get validated, the error messages pile up in the subfile
message queue. Here?s some snippets of the code:

The DDS:

A R ERRSFL SFL
A SFLMSGRCD(8)
A MSGKEY SFLMSGKEY
A PGMPGMQ SFLPGMQ(276)
A R ERRCTL SFLCTL(ERRSFL) OVERLAY
A WINDOW(NTRKEY)
A LOCK
A SFLSIZ(50) SFLPAG(1)
A 03 SFLEND
A 03 SFLDSP
A 03 SFLDSPCTL
A 03 SFLINZ
A PGMPGMQ SFLPGMQ(276)


The subprocedures:

P ErrMsg b

D ErrMsg pi
D pChkNbr 7s 0 const
D pErrTxt 256a const options(*varsize)

D SndPgmMsg pr ExtPgm('QMHSNDPM')
D MessageID 7a Const
D QualMsgF 20a Const
D MsgData 256a Const
D MsgDtaLen 10i 0 Const
D MsgType 10a Const
D CallStkEnt 276a Const
D CallStkCnt 10i 0 Const
D MessageKey 4a
D ErrorCode likeds(dsEC)

D wwMsgLen s 10i 0
D wwTheKey s 4a
D errTxt s 256a

C eval errTxt = '#' + %char(pChkNbr) + '- '
C + pErrTxt
C ' ' checkr errTxt wwMsgLen
C callp SndPgmMsg('CPF9897': 'QCPFMSG *LIBL':
C errTxt: wwMsgLen: '*INFO':'*CTLBDY':
C 0: wwTheKey: dsEC)

P e

*---------------------------------------------------------------------
----

P RmvMsg b

D RmvMsg pi

D RmvPgmMsg pr ExtPgm('QMHRMVPM')
D CallStkEnt 276a Const
D CallStkCnt 10i 0 Const
D MessageKey 4a Const
D MsgToRemove 10a Const
D ErrorCode likeds(dsEC)

C callp RmvPgmMsg('*':0:' ':'*ALL':dsEC)

P e

It?s probably something trivial?what I need is a really good primer on
using
the message handling API?s with error message subfiles. Thanks.


Buzz Fenner
Systems Analyst/Network Administrator
870.930.3374
mailto:bfenner@xxxxxxxxxxxxxxxx <mailto:bfenner@xxxxxxxxxxxxxxxx>




--
PRIVACY WARNING: For auditing purposes, a copy of this message has been
saved in a permanent database.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.