return command

Last Updated : Oct 24, 2012 |

Purpose

The goto vector command can invoke a subroutine call. After the subroutine has processed, the return command returns vector processing to the step following the goto vector command.

Reason to use

When you use a subroutine, you need a command that returns vector processing to the calling vector.

Syntax

return

Operation

The subroutine return destination information for a goto vector command branch remains with the call until a return command is executed in a subsequent vector step, or until vector processing terminates for that call. Multiple return destinations, one for each goto vector command branch executed for the call, are stored for the call in Last In First Out (LIFO) order up to the limit of 8,000 or 400. When a return step is executed, the processing uses the most recent return destination for the call, which clears that return destination. A subsequent return step uses the next most recent return destination - and so on - until all return destinations for the call have been cleared.

The subroutine return destination information remains with the call through any subsequent vector processing, including subsequent goto vector commands. The exception is when a route-to number/digits to a VDN step is executed for the call or when vector processing ends for the call. When the route-to VDN step is executed, all subroutine return destinations stored for the call are cleared, and the call is removed from any queues. All return destinations for the call are also cleared when vector processing ends for the call.