Example of CNOS negotiation

Using the sample macroinstructions shown in Figure 1 and in Figure 1, see how VTAM® would process these macroinstructions. Figure 1 shows a simplified view of the flow of the CNOS request. The following description is keyed to the numbers in the figure.

Six sessions are active with Application B. Each side has three contention-winner sessions. None are presently allocated for conversations. Application A's AUTOSES value is 8.

Figure 1. Sample CNOS negotiation
Sample CNOS negotiation
1 Application A issues the following APPCCMD:
 APPCCMD CONTROL=OPRCNTL,QUALIFY=CNOS,RPL=RPLA,ACB=APPLA,      X
               AAREA=RPLAX,LUNAME=APPLB,LOGMODE=EXAMPLE,AREA=CNOSCB,    X
               RECLEN=16

(For more information on this sample CNOS request, see the example in Figure 1.) The first 7 bytes of the CNOS session limits control block are set to X'000B0008000320', which indicates the requested session limit values. The values are SESSLIM=11, MINWINL=8, and MINWINR=3, and indicate that the partner application program is responsible for session deactivation.

2  VTAM A uses the SNASVCMG session to pass Application A's CNOS request to VTAM B.

3 VTAM B negotiates the CNOS request and returns the results to VTAM A over the SNASVCMG session. The negotiation values in effect in Application B's LU-mode table for the EXAMPLE mode are DSESLIM=12, DMINWNL=8, and DMINWNR=4, and deactivation responsibility will not be accepted.

The negotiation values were established earlier by Application B by issuing the following macroinstruction:
APPCCMD CONTROL=OPRCNTL,QUALIFY=DEFINE,RPL=RPLB,ACB=APPLAB,   X
               AAREA=RPLBX,LUNAME=APPLA,LOGMODE=EXAMPLE,AREA=CBAREA,    X
               RECLEN=68
(See the example in Figure 1 for more information on the macroinstruction.)

Application B's AUTOSES value is 5.

VTAM B negotiates the CNOS request as follows:

  1. The requested SESSLIM value (source) is compared to the DSESLIM value (target), and the smaller value used for the rest of the negotiation. In this case, the SESSLIM value of 11 is used because the DSESLIM value is 12.
  2. Half of the negotiated SESSLIM value (rounded downward) is compared to the DMINWNR value. The larger of the two values is used in step three of the negotiation. In this case, half of SESSLIM is 5. This value is used because DMINWNR is 4.
  3. The value determined in step two is compared to the number of contention-winner sessions that Application A is requesting. The smaller of the two values is used. In this case, 5 is being compared to 8; therefore, five contention-winner sessions will be given to Application A.
  4. The number of contention-winner sessions given to Application B is subtracted from the overall session limit determined in step one. This value is compared to the DMINWNL value, and the smaller of the two values is used to determine the number of contention-winner sessions to give to the application program whose VTAM is conducting the negotiation. In this case, six sessions are left over and this number is compared to the DMINWNL value of 8. Six is smaller; therefore, Application B will be given six contention-winner sessions.
  5. The part of the CNOS request that handles responsibility for session deactivation is checked against the DRESPL value. In this case, VTAM B will not accept a CNOS that requires Application B to be responsible for deactivation, so the DRESPL value of the reply is set appropriately. (The DRESPL value is set in the CNOS session limits control block values returned to the application program after the CNOS negotiation is complete.)

4 VTAM B schedules Application B's ATTN exit to inform it of the new session limits. The AREA field of the read-only RPL in the exit's parameter list points to a CNOS control block. The first 7 bytes of this CNOS control block are set to hex 000B0006000520. This indicates values of SESSLIM=11, MINWINL=6, and MINWINR=5, and the partner is responsible for session deactivation.

VTAM B also activates two additional contention-winner sessions for Application B, bringing the number of contention-winner sessions to the AUTOSES limit of 5. Application B still has an inactive contention-winner session available.

5 VTAM A completes the CNOS request macroinstruction of Application A and sets return codes of X'0000' in RCPRI and X' 0002' in RCSEC. This combination of return codes indicates successful processing. (For a description of the return codes, refer to z/OS Communications Server: SNA Programmer's LU 6.2 Reference.)

The CNOS control block supplied by Application A has been updated and is now X'000B0005000600'. This indicates values of SESSLIM=11, MINWINL=5, and MINWINR=6, and the local LU (Application A) is responsible for deactivation. The AUTOSES value for Application A is 8, but VTAM A activates only two more contention-winner sessions because the contention-winner limit is 5, and three sessions are already active.