Previous Topic: CONFIRMEDNext Topic: DEALLOCATE


CONTROL SESSION

Purpose

Issued by the secondary dialog in response to the ALLOCATE command sent by the primary dialog.

Syntax

►►───── CONTROL SESSION ──────┬─ FORMAT ◄ ─┬──────────────────────────────────►
                              └─ NOFORMAT ─┘

 ►───┬─────────────────────────┬─────────┬──────────────────────────┬──── . ──►◄
     └─ LOCAL VERSION version ─┘         └─ REMOTE VERSION version ─┘

Parameters

FORMAT

Specifies that data will be converted by APPC presentation services before the receiving program sees it:

FORMAT is the default for CONTROL SESSION.

NOFORMAT

Specifies that no data will be converted. If data conversion is required, you must code any data translation or conversion.

Note: The FORMAT/NOFORMAT setting on the ALLOCATE command must match the FORMAT/NOFORMAT setting on the CONTROL SESSION command.

LOCAL VERSION version

Specifies either a 1- to 32-character local program version identifier or a field containing a version ID sent to the remote program.

REMOTE VERSION version

Specifies a variable of at least 32 characters to receive the version identifier sent by the remote program.

Usage

CONTROL SESSION is issued in response to the ALLOCATE command sent by the primary program. These 2 commands establish the conventions governing the conversation.

This command is required in PC-to-mainframe conversations but is not used for mainframe-to-mainframe conversations.

Considerations

The FORMAT/NOFORMAT setting on the ALLOCATE command must match the FORMAT/NOFORMAT setting on the CONTROL SESSION command.

Example

In response to an ALLOCATE with the FORMAT setting, the local dialog sends LEVEL 1 in its local version to the remote dialog for testing. The remote dialog will receive it in the field, REMOTE-FIELD, for testing.

CONTROL SESSION FORMAT LOCAL VERSION 'LEVEL 1'
  REMOTE VERSION REMOTE-FIELD.
IF APPCCODE NE ZERO
  THEN
  DO.
  DEALLOCATE ABEND.
  ABORT MSG TEXT 'CONTROL SESSION ERROR'.
  END.
IF REMOTE-FIELD NE 'FIRST RELEASE'
  THEN
  DO.
  DEALLOCATE ABEND.
  ABORT MSG TEXT 'WRONG RELEASE OF PARTNER DIALOG'.
  END.