Yes, sort of. We've a service program with an export procedure call
sndMsgQ. The first parameter in this procedure is the message queue
that caller want the message to send to. Unfortunately, it is declared
as 10 alphanumeric. This procedure uses this parameter as the
CallStkEnt when calling QMHSNDPM. Not good, yeap not good.

"Kurt Anderson" <kjanderson@xxxxxxxxxxxxx> wrote in message
Are you using the QMHSNDPM API? If so, you can specify the location of
the program in the stack. This is how I have it prototyped:

// Send Program Message API
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 4096a Const
D CallStkCnt 10i 0 Const
D MessageKey 4a Const
D ErrorCode LikeDS( APIErrorDS )
// Optional Parameter Group 1
D CallStkLen 10i 0 Const Options( *NoPass )
D CallStkQual 20a Const Options( *NoPass )
D ScrnWaitTime 10i 0 Const Options( *NoPass )

In this prototype I'm referring to the field CallStkCnt. It's been a
while since I've actually had to touch this API (since it's in a service
program) but if you play with that value you may find what you're
looking for.

Kurt Anderson
Application Developer

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai
Sent: Friday, August 08, 2008 4:30 PM
To: RPG programming on the AS400 / iSeries
Subject: message subfile not working in service program

I'm attempting to use message subfile on a service program for the first
time and am having problem with it.

On the DSPF file, I have the SFLPGMQ(10) keyword on both the message
subfile and control record formats. In a regular RPG ILE program, I
usually set the value of SFLPGMQ(10) as the program name and use send
program message api to send messages that I want to display to the
Program Message Queue. This method works fine in regular ILE RPG

I attempted the same think on a service program and I'm getting a
CPF2479 error. This problem goes a way if I change the SFLPGMQ(10) to
SFLPGMQ(276) and place the value of the procedure name as the value of
SFLPGMQ(276). Just curious as why using the service program name as
value SFLPGMQ(10) won't work on service program.


This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at


This thread ...

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

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