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



When I moved that code to a service program I added a parameter passing the pgm name. Faster than looking at the pgm stack.

Sent from my iPhone

On Aug 8, 2020, at 4:11 PM, smith5646midrange@xxxxxxxxx wrote:

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

Follow-Ups:
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.