QSYS2.FIND_AND_CANCEL_QSQSRVR_SQL and QSYS2.CANCEL_SQL procedures
The procedure, QSYS2.CANCEL_SQL(), can be called to request the cancellation of an SQL statement for a target job.
SQL cancel support provides an alternative to end job immediate when deciding how to deal with an orphaned or runaway process. End job immediate is a hammer, where SQL cancel is more like a tap on the shoulder. Prior to this improvement, the SQL cancel support was only available to ODBC, JDBC, and SQL CLI applications. The CANCEL_SQL() procedure extends the SQL cancel support to all application and interactive SQL environments.
See IBM Documentation for details: CANCEL_SQL procedure
- No authority required to cancel your own jobs
The FIND_AND_CANCEL_QSQSRVR_SQL() procedure uses the QSYS2/FIND_QSQSRVR_JOBS and QSYS2/CANCEL_SQL() procedures to derive the set of jobs which have active SQL activity. Each job found is made a target of an SQL cancel request.
See IBM Documentation for details: FIND_AND_CANCEL_QSQSRVR_SQL procedure
Was this topic helpful?
06 October 2023