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



Hello Chris,

You wrote:
>Am I missing the forest because the trees are blocking the view here?

No, you are simply forgetting that with ILE the program stack became more
complex.  Every procedure is an entry in the call stack.

Your example with SNDPGMMSG from CL is probably using a CLP (i.e., OPM
program) in which case *PRV is previous to the PROGRAM invoking SNDPGMMSG.

Your RPG IV program is ILE therefore *PRV (or its equivalent * 1) is the
previous PROCEDURE.  All ILE programs have an entry procedure plus the main
procedure and then any other procedures you have invoked.

Find the message in the joblog, put the cursor on it and press F1, then
press F9 and you'll see the name of the program queue to which the message
was sent.

You'll probably find that it was sent to the _QRNP_PEP_mod-name procedure
(where mod-name is the name of the main module).  You can use the prefix
'_QRNP_PEP_' and concatenate the contents of the *PROC field from the
Program Status Data Structure to derive the name of the entry procedure and
send the mesage to 1 above that.  For example:

D PSDS          DS
D   PSDS_Pgm                  *PROC

C callp     SndPgmMsg('CPF9898':
C                     'QCPFMSG   *LIBL  ':
C                     MsgTxt:
C                     %Len(MsgTxt):
C                     '*INFO':
C                     '_QRNP_PEP_' + PSDS_Pgm :
C                     1:
C                     KeyVal:
C                     dsEC)

NOTE: While prototyping the API directly is a good idea you should also
encaspulate it in a procedure that can determine most of the input
parameters itself.  Doing this properly will simplfy the interface
immensely.

(Of course if the compiler used a fixed entry name like CLLE and C do you
wouldn't have to stuff around with building a call stack entry name and
could simply encapsulate the target call stack queue in the procedure)

Regards,
Simon Coulter.

--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/

   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.