Is there a maximum number of outstanding WTORs allowed? How long does a message
token last. I have to build a piece of fairly complex logic that has to read
data and do look ups before responding to a console message. It can have
extreme variability in finding and waiting for a response. Most of the time a
response can be looked up and derived quickly, sometime it will have to wait
for something else to happen.
Here is a simplified example of what I want to do.
This is a model of a message that needs a response. Codes in the message inform
about specific look up requirements
JMX0431R Spin 03 to partner X-M0005 (Y/N)
There is an initialization procedure that defines the name of a program to
handle this message, because at different times of day different activity is
needed.
*Initialization procedure
AT STARTUP
VAR #CMDJMX LEN 8
LET #CMDJMX = 'JMXHND1' /* default handler */
The message is intercepted by this. It defines part of the message text as a
variable from which information is to be extracted.
MSG=JMX0431R
VAR &SPCT POS 14 LEN 4 LOCAL /* parm falls in this range */
VAR &PARM1 LEN 4 LOCAL
VAR &PARM2 LEN 14 LOCAL
VAR #CMDJMX LEN 8
PARSE NUMERICS &SPCT INTO &PARM1
LET &PARM2 = $$MSGRID /* REPLY ID */
SET DISPLAY=SUPPRESS
RUN #CMDJMX ( &PARM1 &PARM2) ASYNCH
The numeric value in the message is extracted and the message identifier is
obtained. The message is suppressed from the display and an asynchronous
program JMXHND1 is started. Control then returns to the message handler. The
actual work is done in the asynch program to shorten the path length in the
message handler, and to allow a variable name to be used for the handler
program.
JMXHND1 Command list
This command list pics up the parameter extracted from the message and the
reply id which were passed. It then does a series of look ups and determines
the correct response, which it gives and it then ends.
VAR &PARM1 LEN 4 LOCAL
VAR &REPID LEN 14 LOCAL
PARSE ARGS INTO &PARM1 &REPID
IF &PARM1 GT 2
/* READ AND PROCESS */
REPLY &REPID (Y) /* REPLY Y TO LET IT CONTINUE */
This is a simplification of a process I propose to use, but it is possible for
a response not to be know for days or even longer. So is there any kind of
limits I need to consider before implementing this kind of logic?
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN