How to check the response of a WTOR issued by OPS/REXX?
OPS/MVS
The keyword "REPLY" of the ADDRESS WTO statement causes the message to be a WTOR.
The reply of the WTOR can be retrieved using the PULL REXX instruction.
Sample code below:
/* REXX TO ISSUE WTOR AND TAKING DIFFERENT ACTIONS */
/* DEPENDING ON THE RESPONSE */
/* Re-issues the WTOR if the response is not Y or N */
ask:
ADDRESS WTO
text = 'TESTING WTOR - REPLY (Y/N)'
address WTO "TEXT('"text"') HILITE REPLY MSGID('U00001')"
Do queued()
pull prefix response .
end
if wordpos(response,'Y N') = 0 then signal ask /* re-issues the WTO if not Y or N */
else
do
if response = 'Y' then
do
say 'Actions when response=Y'
end
if response = 'N' then
do
say 'Actions when response=N'
end
end