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
Highsmith

-----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
program.

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.

thanks




--
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,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


This thread ...

Replies:

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

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