Example 1: Using session parameters associated with CINIT
INQ1 INQUIRE RPL=RPL1,OPTCD=SESSPARM
(Test for (RTNCD,FDB2)=
(00,05) in the RPL.)
(Load value in RECLEN field of the RPL into
register 7 and check that it does not
exceed the length of AREA1.)
.
.
.
MODCB AM=VTAM,RPL=RPL1,AREALEN=(7)
(Test return codes from execution of the MODCB macro.)
.
.
.
INQ2 INQUIRE RPL=RPL1,OPTCD=SESSPARM
.
.
.
(Check session parameters placed in AREA1 and
determine that they are appropriate.)
.
.
.
OPNDST RPL=RPL1,OPTCD=ACCEPT
.
.
.
RPL1 RPL AM=VTAM,NIB=NIB1,AREA=AREA1,AREALEN=0
NIB1 NIB NAME=LU1,LOGMODE=0,BNDAREA=0
AREA1 DS XL100
The INQUIRE macroinstruction at INQ1 attempts to get the session parameters (from the CINIT) with the RPL's AREALEN field set to 0. The macroinstruction fails with (RTNCD,FDB2)=(X'00',X'05') (insufficient length). Upon return from the macroinstruction, however, the RPL's RECLEN field contains the number of bytes needed for the session parameters (and any user data). The required length is loaded into register 7, and the MODCB macroinstruction is issued to put the value into the AREALEN field of the RPL. Then, at INQ2, the INQUIRE macroinstruction is issued again, causing VTAM to put the session parameters into AREA1. (The session parameters are those that are received with the CINIT.) The logic of the LOGON exit routine checks the session parameters and determines that they are appropriate for the LU and for the type of session that the application program has with that LU. Therefore, the application program issues the OPNDST OPTCD=ACCEPT macroinstruction to generate the BIND request, using the NIB whose BNDAREA and LOGMODE fields are set to 0. Because the LOGMODE and BNDAREA fields are set to 0, VTAM uses the session parameters associated with the CINIT to build the BIND that is sent to the LU. (An area of 100 bytes is shown in the example for the amount of storage reserved for AREA1; that might not be the correct value for your application program. The value should be equal to the maximum size of the session parameters plus any user data from the Initiate.)