OPS/MVS

 add parameter to TPFCON.rexx allowing the option to STOPREXX

Jeff Kriley's profile image
Broadcom Employee Jeff Kriley posted Mar 16, 2021 02:52 PM
Hello - We've built a web site kicking off rexx programs through Automation Point that start/stop zVM instances.  The Automation Point Desktop system (TPFCON.REXX) works great in that when a request is kicked off and an existing process is already running against that session (session_id) those new requests are never kicked off but stopped within TPFCONN.REXX.

However, we would like to give the user an option to stop the existing process and kick off the new one.  We have an idea how this is done but would like some guidance on the best approach.  It seems that we could pass in a "cancel" parameter to TPFCONN requesting that the existing rexx processes (against the session in question) are killed and the new one allowed to proceed.  The code could be something similar to what is shown below (from documentation).

But maybe altering TPFCONN.REXX is not advisable and therefore we should build our own REXX to intercept these processes and kill them should the user choose to do so. 

What is the best approach?

"GETREXXL"
/* GETREXXL populates GETREXXL.0 with the number */
/* of active and queued REXX programs, the */
/* GETREXXL_NAME.i variables with the name and */
/* arguments of a program, and GETREXXL.i with the */
/* number used by STOPREXX to terminate the program*/
DO I = 1 TO GETREXXL.0
parse upper value GETREXXL_NAME.i with rxname.
IF rxname = token THEN
"STOPREXX "GETREXXL.I
END