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



John,

Even if everything worked the way you expected (which it won't) your code makes no sense. Sending an *ESCAPE message to the system operator's message queue? In what world does that make sense? The system operator isn't a program, it can't deal with an *ESCAPE message.

But that's just a start:

a) The way you handled quoting is going to wreak havoc. Please re-read the recent message about quoting in shell scripts that I wrote to Rob Berendt on this list.

b) QMHSNDPM is for program messages, and the system operator's message queue is not a program queue. That's why the API docs for QMHSNDPM don't list *SYSOPR as an option... you can't send a program message to *SYSOPR. There's a different API (QMHSNDM) that's for sending non-program messages if that's what you want. (But they can't be type *ESCAPE!)

c) The API docs for QMHSNDPM ask for binary(4) parameters for the message length and the call stack count parameters. You are not passing binary(4), however, you are passing a text string.

d) The final parameter to the API is an error code parameter, which is a data structure made up of two binary(4) fields followed by optional text fields. You are simply passing one blank for this parameter, instead of passing what it asks for.

e) Sending a program message from QShell makes no sense whatsoever. Remember, Unix does not use the same call-stack semantics as a traditional IBM i program would. When you run the system utility (or call a program for that matter) it will spawn a new job to run that in. If you got the parmeters right, you could send a message to a call stack entry in that newly spawned job, but what good would that do? You can't send it to the caller, since the caller isn't in the same job in a QShell scenario.

If you would please explain what you're trying to do, I'd be happy to see if I can help... but right now, I just can't fathom what you're trying to accomplish.


John McKee wrote:
I used teh following QSH command:

system 'call pgm(qmhsndpm) parm('CPF9898' 'QCPFMSG *LIBL' 'TEST MESSAGE' '1
2' '*ESCAPE' '*SYSOPR' '3' ' ' ' ')'
CPF24B3: Message type MESSAGE not valid.
CPC2206: Ownership of object QZSHSYSTEM in QTEMP type *USRSPC changed.

Issues I have: No idea what should be used just after the *SYSOPR parameter. Coding a 3 is just guesswork.

Is the CPF24B3 related to the value of '3'? The command SNDPGMMSG does not show
a MESSAGE parameter.

I was wondering if SNDPGMMSG was restricted based on a parameter, but the API
that actually sends the message did not need that restriction.

John McKee



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.