rcvmsg wait(*max) doesn't wait for reply

Michael Quigley <[email protected]> Thu, 4 Jun 2026 01:34:05 +0000
Newsgroups gmane.comp.hardware.ibm.midrange
Message-ID <DM3PPFA767A9C1BB699669F666038F789AEA5102@DM3PPFA767A9C1B.namprd15.prod.outlook.com>
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.