Re: rcvmsg wait(*max) doesn't wait for reply
Sam_L <[email protected]> Thu, 4 Jun 2026 13:17:31 -0400
| Newsgroups | gmane.comp.hardware.ibm.midrange |
|---|---|
| Message-ID | <[email protected]> |
Sure you are running the correct program?
On 6/3/2026 9:34 PM, Michael Quigley wrote:
> I have a program which sends an inquiry message and is supposed to wait for the reply. Here's the actual code:
>
> dowhile cond('1') /* Force a yes or no answer */
> sndpgmmsg msg('Reports are generated. Please review the data before +
> continuing and sending out the emails.&N Reply ''Y'' to +
> continue and send emails out or ''N'' to abort.') +
> tomsgq(QSYSOPR) msgtype(*inq) rpymsgq(*pgmq)
> rcvmsg wait(*max) msg(&RpyMsg)
> if cond(%sst(&RpyMsg 1 1) *eq 'Y' *or %sst(&RpyMsg 1 1) *eq +
> 'y') then(leave)
> if cond(%sst(&RpyMsg 1 1) *eq 'N' *or %sst(&RpyMsg 1 1) *eq +
> 'n') then(return)
>
>
> If I isolate the code for sending the message, it waits for the response as expected. But when running in the context of the entire program, it does the sndpgmmsg 4 times. On the forth time, it takes the 'N' branch and the program terminates.
>
> I'm stumped. Does anyone know any reason this code would behave that way?
>
> Thanks,
> Michael Quigley
> Computer Services
> www.TheWay.org<http://www.TheWay.org>
>
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.