End Request (ENDRQS)

The End Request (ENDRQS) command ends (cancels) a previously requested operation (command). One common use of the End Request (ENDRQS) command is to cancel a request that is currently stopped at a breakpoint. This command function is also available as an option on the System Request menu.

If the End Request (ENDRQS) command cannot be processed immediately because a system function that cannot be interrupted is currently running, the command is delayed until interruption is allowed.

When a request is ended, an escape message is sent to the request processing program that is currently called at the request level being canceled. Request processing programs can be canceled. Request processing programs can monitor for the escape message so that cleanup processing can be done when the request is canceled. The static storage and open files are reclaimed for any program that was called by the request processing program. None of the programs called by the request processing program is notified of the cancel, so they have no opportunity to stop processing.

To become a request processing program, the program must receive a request message.

If the ENDRQS command is in a program, that program must become a request processor before it issues this command.

More information on how to set up a program to become a request processor is in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Note: External objects that are locked by the Allocate Object (ALCOBJ) command are not unlocked (deallocated) by the canceled request.

Parameters

Keyword Description Choices Notes
RQSLVL Request level Integer, *PRV Optional, Positional 1

Request level (RQSLVL)

Specifies the (command) request level at which the command being canceled was entered.

*PRV
The command entered at the immediately previous level is being canceled.
integer
Specify the request level at which the command being canceled was entered. All request levels from the level specified to the current level are canceled.

Examples

Example 1: Ending a Command

CALL PROGA     (This is level 1)
 :
Breakpoint occurs
CALL PROGB     (This is level 2)
 :
Breakpoint occurs
ENDRQS         (This is level 3)

In this example, because RQSLVL(*PRV) is the default, the request made at level 2 is canceled. The user can then enter another command at level 2 or press F3 to show the PROGA breakpoint display again.

Example 2: Ending a Command

CALL PROGA          (This is level 1)
 :
Breakpoint occurs
CALL PROGB          (This is level 2)
 :
Breakpoint occurs
ENDRQS  RQSLVL(1)   (This is level 3)

In this example, the request made at the highest level (CALL PROGA) is canceled. Consequently, any requests made between level 1 and level 3 are also canceled.

Error messages

None