× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It must be the call level that is your problem. When you put it into a
service program you will have yet another level in your call stack. So
simply add on to the level counter and the message will be sent to the same
program as before

Try this if you will understand the mechanism

Strdbg on your program and add a break point just befor your sndpgmmsg in
your new service program.
Now press f21 and dspjob. Here look at the “call stack” and you will now
count both the programs AND procedures - and this will give the number you
need to set the level parameter to.

As you can see RPG subroutines does not count- since they are just clever
hidden gotos

søn. 9. aug. 2020 kl. 00.11 skrev <smith5646midrange@xxxxxxxxx>:

For MANY years I have used the same messaging logic in 5250 programs which
involves using a copybook and now that I have made a slight change to it, I
can't figure out how to fix what I broke.



I have always used the variable sdsPgmNam which is part of the SDS. Rather
than including the copybook that has my SndMsg function in every program, I
decided to create a module (and will probably change to use a service
program at some point) with this and several other functions and bind it in
at compile time. The problem that I have run into is that when I call the
function now, sdsPgmNam is the name of the module, not the name of the
program. I've tried using some other values such as *PGMBDY but I've
apparently got something wrong because I can't get the message into my
subfile. Can anyone point me in the right direction on this?



Here is the SDS.

d sds

d sdsPgmNam *proc



Here is the subfile.

A R SUBMSG SFL

A SFLMSGRCD(27)

A MSGKEY SFLMSGKEY

A SDSPGMNAM SFLPGMQ(10)



Here is the SndMsg Function

p SndMsg b export

d SndMsg pi

d SndMsgData 256 const



d SndMsgDLen s 9b 0 inz(256)

d MsgQNB s 9b 0 inz(0)

d MsgKey s 4a



SndMsgDLen = %len(%trim(SndMsgData));

APIError.ErrPrv = %size(APIError);

callp QMHSNDPM(*blanks

:'QCPFMSG QSYS'

:SndMsgData

:SndMsgDLen

:'*INFO'

:sdsPgmNam

:MsgQnb

:MsgKey

:APIError);

endif;

p e

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.