The secondary exit is called by your region with Register 1 containing the address of a parameter list which is always ten consecutive full words in length.
Depending upon the reason for the call, some of these words can be set to binary zeroes.
The first word of the secondary exit parameter list is always the address of a full word that contains a function code identifying the type of call being made.
The other parameters passed depend upon the value of this function code, and the exit must therefore determine the function code first in order to decide which parameters to expect.
The parameter list passed to the exit is also used as a parameter returned from the exit, allowing the exit to indicate the processing required and to pass the appropriate information to your region.
Note: On a call to the exit, addresses are included in the parameter list of various fields. Only these fields can be used to return information from the exit; the exit cannot pass parameters back to your region in any other locations.
Initialization processing indicates to the secondary exit that a link has become active. There is no indication whether a primary exit exists in the remote system, or, if there is, whether that exit is going to attempt to communicate with the secondary exit. The secondary exit must therefore be written to expect whatever processing is implemented in the remote primary exit.
On entry to the secondary exit, Register 1 points to a list of ten full words, as shown in this diagram.

Points to a full word containing function code X'00000000'. Other words in the parameter list point to additional parameters.
Is the address of the link name of the remote system with which a link has been established. There may or may not be a primary exit defined for that system. If there is, it is up to the primary exit to determine whether it wants to communicate with this secondary exit.
Are set to zero.
The secondary exit does not have an opportunity to respond to the initialize call. On completion of any processing it chooses to perform when passed control, the secondary exit should return to your region with its ten full word parameter list unchanged.
When the primary exit sends a message to the secondary exit the message is presented to the secondary exit for processing using the Deliver Call.
The secondary exit performs whatever processing is required and then returns to your region. On return, your region expects the secondary exit to have set the message-length and message-text areas pointed to by words 6 and 7 of the parameter list with which it was called.
The secondary exit can, if necessary, indicate that a null message is to be returned to the primary exit, perhaps as an acknowledgment to the message sent by the primary.
On entry to the secondary exit, Register 1 points to a list of ten full words, as shown in this diagram.

Points to a full word containing function code X'00000004'.
Is the address of the link name of the remote system from which the message has been received.
Is set to zero.
Is the address of a full word containing the length of a message sent from the primary exit in the remote system. The maximum length is 256 bytes (decimal), minimum is zero (which would be a null message).
Is the address of the message sent from the primary exit.
Is the address of a full word, value F'0'. The secondary exit can place in this field the length of a message that is to be sent to the primary exit in the remote system. The maximum length is 256 bytes (decimal). If a longer length is specified it is truncated to 256. If a negative length is specified it is forced to 256.
Is the address of an area in which the secondary exit can place the text of a message that is to be sent to the primary exit in the remote system. The message is assumed to be left aligned in this message area. The maximum message text length is 256 bytes (decimal). The data in the message can be binary or character and is transparent to your region.
The meaning and format of the message sent to the primary exit is determined by the installation.
Are set to zero.
The secondary exit should set the full word pointed to by word 6 of the call parameter list to the length of the message text that is to be returned to the primary exit as a reply to the message just delivered.
The message length has a range of 0 to 256 in hexadecimal. Any text outside the specified range is truncated to 256 bytes decimal. A zero length is accepted. Negative length settings are forced to a zero value.
Word 7 of the call parameter list points to a 256-byte area in which the secondary exit can place the text of the message to be returned to the primary exit. The format and content of the message returned is decided by the installation.
No other return information is accepted from the secondary exit.
When the primary exit in a remote system decides that the primary/secondary exit exchange of information is complete, it returns to your region, indicating that exit processing is to terminate, and also specifies whether the link is to be activated or closed down.
The decision to finish communication is reported to the secondary exit as a disconnect call. This allows the secondary exit to determine that no further messages are to be received from the primary exit and to release any exit dependent resources it acquired.
The disconnect call is also issued when the link to the primary exit's remote system is lost.
On entry to the secondary exit, Register 1 points to a list of ten full words, as shown in this diagram.

Points to a full word containing function code X'00000008'.
Is the address of the link name of the remote system from which the message has been received.
The address of 1 byte disconnect reason code. Valid values are:
|
Field Value |
Definition |
|
X'00' |
Orderly termination of communication by choice of the primary exit. |
|
X'04' |
Disconnection caused by loss of contact. |
Are set to zero.
The secondary exit should clean up any resources allocated during the conversation with the primary exit and perform any required termination processing. No further communication is possible with the primary exit.
No parameters can be returned to your region.
On return to management service, the link either is out of action (if caused by a link outage) or is activated or deactivated according to the choice of the primary exit in the remote system.