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



I am using QMHSNDPM to send messages. Another programmer in the
organization used a validation method where the error messages are
contained in a physical file. Rather than create a bunch of new entries
in a MSGF, I created a generic message (&1) and just pass the text from
his file to this parm.

Now, to make all this easier, I wrapped my usual code in a procedure and
pass it the message text.

What I usually use:


w@msid = 'MAI0000'; generic msg in msgf
w@msda = e_local_Msg; the error text from the validation file
msgfd(w@msid : w@msgf : w@msda : w@mstp : ErrorDs); the subprocedure I
use to send msg.

To make this all easier I created a subprocedure to handle this:

send_Msg(e_local_Msg);

Which is defined as:

Psend_Msg B
Dsend_Msg PI
D Message 70
/free
w@msid = 'MAI0000';
w@msda = Message;
msgfd(w@msid : w@msgf : w@msda : w@mstp : ErrorDs);
/end-free
Psend_Msg E

Now when I execute the code without using the send_msg subprocedure, the
error displays properly. When I use subprocedure, the error does not
display. The best answer I could come up with is that this is some
visiblity issue due to the message not being sent to the correct stack
(I am totally grasping at straws with the last statement). For some
further info, here are the subprocedures I use to send the messages (and
this all works fine, until I tried the wrapping in send_msg.



pmsgfd b
d pi
d w@msid 7
d w@msgf 20
d w@msda 132
d w@mstp 7
d ErrorDS 16
/free
callp SendMsgQ (w@msid:
w@msgf:
w@msda:
%size(w@msda):
w@mstp:
'*':
1:
MsgKey:
ErrorDS);
write MSGCTL;



and



dSendMsgQ pr extpgm('QMHSNDPM')
d MsgID 7a const
d MsgF 20a const
d MsgData 30a const
d MsgDataLen 10i 0 const
d MsgType 10a const
d CallStackEnt 10a const
d CallStackCtr 10i 0 const
d MsgKey 4
d ErrorRtn like(ErrorDS)




David M. Petrosky
Programmer/Analyst
Maines Paper & Food Service, Inc.
607-251-7378
Dave.Petrosky@xxxxxxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.