Previous Topic: CONTROL SESSIONNext Topic: PREPARE-TO-RECEIVE


DEALLOCATE

Purpose

Ends the conversation.

Syntax

►►─── DEALLOCATE ────┬─ FLUSH ────────┬────── . ──────────────────────────────►◄
                     ├─ SYNC-LEVEL ◄ ─┤
                     ├─ ABEND ────────┤
                     └─ LOCAL ────────┘

Parameters

FLUSH

Sends all data in the communications buffer to the remote program and then terminates the conversation normally.

SYNC-LEVEL

Terminates the conversation based on the synchronization level. If the current synchronization level is:

SYNC-LEVEL is the default for DEALLOCATE

ABEND

Terminates the conversation abnormally.

The following considerations apply:

LOCAL

Terminates the conversation after the remote dialog has deallocated the conversation.

Usage

DEALLOCATE is the last command in the conversation, but each dialog can continue independent processing. The command only ends the conversation.

Considerations

DEALLOCATE:

Example

IF APPCCODE NE ZERO
  THEN
  DO.
  DEALLOCATE ABEND.
  ABORT MSG TEXT 'PROBLEM IN PROCESSING'.
  END.