Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending a message from an ILE program. Please help

653 views
Skip to first unread message

Hussain Akbar

unread,
Aug 1, 1998, 3:00:00 AM8/1/98
to
I am trying to get a CLLE module to work to send messages from ILE programs.
I have a CLLE module with:
SNDPGMMSG MSGID(&ID) TOPGMQ(*PRV (*CTLBDY)) TYPE(*STATUS)
I bind this with a simple RPGLE module so I can send error messages etc.
I get an error saying that *CTLBDY was not found. In other combinations, the
message just doesn't appear anywhere.
I tried all combinations I could think of but can't get messages to stay on
the message line after a program terminates.

Can anyone help? Kindly cc replies to my e-mail address.

Thanks
--
S. Hussain Akbar
email: hus...@myself.com
web: http://www.wp.com/Hussain

Ian Stewart

unread,
Aug 2, 1998, 3:00:00 AM8/2/98
to Hussain Akbar
Hussain,

I think you need to check the message type. *STATUS messages do not
remain in the queue like other messages. If you send them to *EXT, I
think they are automatically displayed at the bottom of the screen,
otherwise, if you don't monitor for them (such as at your control
boundary) I think they are just ignored.

You'll probably get what you need with *INFO or *ESCAPE message types.

Also note that you can call the QMHSNDPM API directly from the RPG
program to eliminate the need for a separate CL module.

Hope this helps ...

-Ian.

Hussain Akbar wrote:
>
> I am trying to get a CLLE module to work to send messages from ILE
> programs.
> I have a CLLE module with:
> SNDPGMMSG MSGID(&ID) TOPGMQ(*PRV (*CTLBDY)) TYPE(*STATUS)
> I bind this with a simple RPGLE module so I can send error messages
> etc.
> I get an error saying that *CTLBDY was not found. In other
> combinations, the
> message just doesn't appear anywhere.
> I tried all combinations I could think of but can't get messages to
> stay on
> the message line after a program terminates.


--
Ian Stewart
i...@incognito.co.nz

Nils Kilden-Pedersen

unread,
Aug 3, 1998, 3:00:00 AM8/3/98
to
I posted a similar question not to long ago, which resulted in the following:
If you're using ILE programs with procedures, you have to supply the procedure name which
displays the message, AND it has to be somewhere in the call stack. Which makes it
virtually unusable in ILE using procedures.
If on the other hand, you're not using procedures it should work, but I suspect you are.

Nils


Hussain Akbar skrev i meddelelsen <35c2c...@news1.ibm.net>...


>I am trying to get a CLLE module to work to send messages from ILE programs.
>I have a CLLE module with:
> SNDPGMMSG MSGID(&ID) TOPGMQ(*PRV (*CTLBDY)) TYPE(*STATUS)
>I bind this with a simple RPGLE module so I can send error messages etc.
>I get an error saying that *CTLBDY was not found. In other combinations, the
>message just doesn't appear anywhere.
>I tried all combinations I could think of but can't get messages to stay on
>the message line after a program terminates.
>

Hussain Akbar

unread,
Aug 4, 1998, 3:00:00 AM8/4/98
to
I got it.

My RPGLE program calls a bound CLLE module which has the command:
SNDPGMMSG MSGID(&ID) TYPE(*INFO) TOPGMQ(*PRV (CTLBDY)

It worked. The message type has to be INFO


Nils Kilden-Pedersen

unread,
Aug 5, 1998, 3:00:00 AM8/5/98
to
Then you're not using procedures?

Nils

Hussain Akbar skrev i meddelelsen <35c73...@news1.ibm.net>...

Ian Stewart

unread,
Aug 7, 1998, 3:00:00 AM8/7/98
to
Nils Kilden-Pedersen wrote:
...

> If you're using ILE programs with procedures, you have to supply the
> procedure name which
> displays the message, AND it has to be somewhere in the call stack.
> Which makes it
> virtually unusable in ILE using procedures.
> If on the other hand, you're not using procedures it should work, but
> I suspect you are.

Hmm ... I think Hussain got that bit right. Specifying *CTLBDY instead
of a specific procedure will work in most cases to aim the message back
to the caller. I specify this now even in OPM CL programs, so that they
will work as required if recompiled as ILE. Not that I've tried using
procedures within an RPG program yet ...

--
Ian Stewart
i...@incognito.co.nz

Mike Cravitz

unread,
Aug 8, 1998, 3:00:00 AM8/8/98
to
Err...Why are we talking about specifying *CTLBDY which is rarely
where you want to send a message. Why not *PGMBDY with a call stack
counter of 1. This will send your message 1 level up from the program
boundary which is the procedure which invoked this program. If you're
running OPM, the message still gets to where you want it. *CTLBDY
sends the message to the control boundary.

In ILE, control boundaries are odd things. They are the place where
one activation group transitions into another. You also have an ILE
control boundary at the point where an ILE program running in the
default activation group calls an OPM program or vice verse. What is
the usefulness of sending a message relative to a control boundary? I
escape know messages are percolated to control boundaries until a
function check is issued but so what?

Mike Cravitz

NEWS/400 Technical Editor

Ian Stewart

unread,
Aug 9, 1998, 3:00:00 AM8/9/98
to
Oops!

You're right. I just went and did a search of a few recent programs
(should have done that before posting earlier), and indeed, I've been
using *PGMBDY. When I saw *CTLBDY in his example, I didn't remember the
details, and presumed it was the same :-( Sorry for any confusion ...

Either way, I'm sure that sending messages from ILE programs *IS* quite
possible (well, at least it seems to work for me!) His biggest problem
was the message type, which is easily fixed ...

I wonder how many people out there are using ILE much so far? I've been
trying to go further than just converting the old RPG to the new format
and compiling it DFTACTGRP(*YES) ... some of the issues are easier to
deal with than others, but I suffer from what I presume is a common
problem (too much real work to do to really spend the time needed to get
to know it inside out ...)

Having said that, I no longer like going back to RPG III ... the data
definitions etc are much better in the ILE version (especially basing
pointers, which can make things much more straight forward, at the
expense of incurring the wrath of others less adventurous!)

--
Ian Stewart
i...@incognito.co.nz

0 new messages