|
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: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
This mailing list archive is Copyright 1997-2026 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.