STSN command format

Both the STSN command and STSN response contain a 5-byte data field.

The format of the STSN command is:
Byte 0
Action code
Bytes 1, 2
Sequence number of the last inbound sync point message sent to the PHS
Bytes 3, 4
Sequence number of the last outbound sync point message sent from the PHS
The primary half session uses the action code to ask the secondary half session to verify the VTAM® sequence numbers. The bits of the action code byte are as follows:
Bits 0 and 1
Refer to the inbound sequence-number field
Bits 2 and 3
Refer to the outbound sequence-number field
Bits 4 through 7
Reserved
These values are acceptable for bits 0, 1, 2, and 3 of the STSN command action code:
00 IGNORE
Do not alter value. IMS does not send this action code value as PHS. IMS as SHS returns an INVALID response code for this action code when resynchronization is required and TEST POSITIVE when resynchronization is not required.
01 SET
Set the appropriate sequence number to the value indicated in the sequence number field. For ISC, this code only occurs when the PHS must send a second STSN to indicate a unilateral decision was made to commit or back out a pending work unit.
10 SENSE
Do not alter value. The SHS should return its version of the sequence number in the command response. IMS as SHS returns an INVALID response to this action code.
11 SET AND TEST
Set the appropriate sequence number to the value indicated in the sequence number field. For ISC, this code always occurs for both flows on the first STSN sent by the PHS. The SHS must indicate in the command response whether the sequence number values are acceptable.
When the secondary half session receives the STSN command, it must be able to:
  • Verify the SHS-outbound (PHS-inbound) sequence number and arrange to retransmit a message to the PHS if required.
  • Verify the SHS-inbound (PHS-outbound) sequence number and inform the PHS whether the number matches the SHS-saved number. Further, the SHS might or might not agree with unilateral decisions by the PHS to commit or back out a pending work unit from the previous session.
  • Return to the PHS a DR1 and a 5-byte data response to the STSN command.
The format of the STSN response has the same format as the STSN command:
Byte 0
Action code
Bytes 1, 2
Sequence number of the last recoverable message the SHS sent to the PHS
Bytes 3, 4
Sequence number of the last recoverable message the SHS received from the PHS
The secondary half session (SHS) uses the action code to indicate the test results. The action code must be returned to the primary half session (PHS). Returning the sequence numbers (bytes 1 through 4) is optional. However, for debugging recovery and restart problems, always return these to the PHS whenever the STSN numbers do not match those maintained by the SHS. The bits of the action code byte are as follows:
Bits 0 and 1
Refer to the SHS inbound sequence number
Bits 2 and 3
Refer to the SHS outbound sequence number
Bits 4 - 7
Reserved
These values are acceptable for bits 0, 1, 2, and 3 of the STSN response action code:
00 RESET
Returned on both sequence number flows in response to the SET AND TEST option to indicate that the SHS must cold start and has no sequence number information. The PHS should continue session initiation and should not treat this response as an error. IMS sends this code when cold-starting and replying to STSN, and continues the session when receiving it.
01 TEST POSITIVE
Returned in response to the SET AND TEST option to indicate that the sequence number agrees with the sequence number that the SHS checkpointed. This code should be returned in response to the SET option when the SHS agrees to continue session initiation following a unilateral decision by the PHS to commit or back out a pending work unit on its outbound flow during the session outage.
10 INVALID
Returned in response to the SET AND TEST option to indicate that the STSN SHS outbound sequence number does not agree with the sequence number that the SHS checkpointed (major session restart mismatch). INVALID is also returned in response to the SET option to indicate disagreement with a unilateral action by the PHS to commit or back out a pending work unit on its outbound flow. The PHS should not continue the session when receiving an INVALID response to either flow.
11 TEST NEGATIVE
Returned in response to the SET AND TEST option on the SHS inbound flow to indicate that the sequence number does not agree with the sequence number checkpointed by the SHS. The PHS responds with SDT if the reason for the mismatch is a pending work unit sent by the PHS, but is not received by the SHS; with a second STSN indicating the SET option for both flows if the PHS had made a unilateral decision to commit or back out a pending work unit; or UNBIND if no work unit was pending and no unilateral decision had been made (major session restart mismatch). TEST NEGATIVE can also be returned in response to the SET AND TEST option to indicate that the SHS had made a unilateral decision to commit or back out a pending work unit on its outbound flow. In this case, the PHS can optionally agree to continue session initiation by sending SET or not to continue session initiation by sending UNBIND.