Previous Topic: INVOKENext Topic: LINK


LEAVE

Purpose

Terminates the current application thread or terminates the current CA ADS runtime session.

Syntax

►►── LEAVE ─┬────────────────────────────────────────────────────────────►─
            ├─ APPLication ◄ ──┬────────────────────────────────────┬────
            │                  └─ NEXT ─┬─ TASK - task-code ───────┬┘
            │                           └─ dialog ◄ - dialog-name ─┘
            └─ ADS/online ─────┬──────────────────────────┬──────────
                               └─ NEXT TASK dc-task-code ─┘

─►───────────────────────────────────────────────────┬── . ───────────────────►◄
  ───────────────────────────────────────────────────┤
  ───┬─────────────────────────────────────────────┬─┘
     └─ CONDition code ─┬──────┬─ condition-code ──┘
                        ├─ IS ─┤
                        └─ =  ─┘

Parameters

APPLication

Terminates the current application and passes control as specified by NEXT TASK or NEXT dialog.

LEAVE is the equivalent of LEAVE APPLICATION.

NEXT TASK task-code

Passes control to an application as defined on the Task Codes screen of the application compiler.

Task-code specifies an application task code, as defined on the Task Codes screen of the application compiler. Task-code is either the name of a variable field containing the task code or the task code itself, enclosed in single quotation marks.

NEXT dialog dialog-name

Specifies the name of a mainline dialog to which control passes. If the keyword TASK or dialog is not specified, dialog is the default.

Dialog-name is either the name of a variable data field that contains the dialog name or the dialog name itself, enclosed in single quotation marks.

The load module for the named dialog must be stored in the data dictionary.

ADS/online

Terminates the current application and the current CA ADS session. Control returns to CA IDMS/DC or DC/UCF (DC/UCF).

NEXT TASK dc-task-code

(Online only) Passes control to another DC/UCF task.

Dc-task-code is either the name of a variable field containing the DC/UCF task or the task name itself, enclosed in single quotation marks.

Dc-task-code must be defined with the NOINPUT parameter, which specifies that only a task code, and no additional data, is expected.

CONDition code IS condition-code

(Batch z/OS only) Clause introducing a completion code for the current job step.

The completion code can be tested using the COND parameter in the job control language (JCL).

Condition-code is either the name of a variable field containing the condition code or the number itself, expressed as a numeric literal.

IS or = are optional keywords and have no effect on processing.

Usage

Effects of Issuing LEAVE

Example

Dialog UPDATEC, shown in Example 1 in the earlier diagram, includes the following response process, which allows the terminal operator to terminate the application thread:

LEAVE APPLICATION.

When the above response process executes, control passes to the Dialog Selection screen. The user can then select the next mainline dialog to be executed.