z/OS Communications Server: SNA Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Program structure recommendations

z/OS Communications Server: SNA Programming
SC27-3674-00

When coding the application program or changing application-program code, follow these recommendations:
  • Code SCIP, NSEXIT, and LOSTERM exit routines for the application program. If the application program does not have the applicable exit routines, notification of session outage or session disruption might not occur, and you might no longer be able to communicate with the network resource. See Exit routines related to session establishment and termination and Session outage notification for information about these exit routines.
  • When using multinode persistent sessions (MNPS), structure the application so that the OPEN ACB macroinstruction is done early in the application processing. This allows VTAM®, during recovery OPEN processing, to begin the recovery process (rebuilding sessions) in parallel with application setup processing.
  • Reinitialize all VTAM control blocks to the values provided by VTAM before reusing the control block. Failure to do so can result in the application program not being able to complete macroinstructions issued later that reference one of the control blocks. For example, if you are reusing an RPL or NIB for another session, reinitialize the control block fields before issuing the OPNDST macroinstruction to open the session.
  • Code an NSEXIT exit routine (see Using exit routines) in application programs that issue SIMLOGON, REQSESS, TERMSESS, or CLSDST OPTCD=PASS macroinstructions. This exit routine receives Notify or NSPE request units. These macroinstructions are posted as complete when processing is started; however, processing might fail later, particularly in a cross-domain environment. The only notification of such an error is through the NSEXIT exit routine. Without an NSEXIT exit routine, the session-initiation or termination request cannot be completed until VTAM is terminated.
  • When using this system, specify the following program attributes: an addressing mode (AMODE) of 31 and a residence mode (RMODE) of ANY. These specifications allow the application program to run in 31-bit addressing mode and to reside anywhere in 31-bit storage, wherever space is available. See Operating system facilities, for more information about 31-bit addressing. For coding or referencing application programs with programming attributes other than those recommended above, see z/OS MVS Programming: Assembler Services Guide.
  • When your application program shares printers with other IBM® subsystems (for example, CICS® and IMS™) or other application programs, make provisions within the application program to end the printer session without operator intervention. This can be accomplished by one of the following procedures:
    • Terminate the session with the printer when there is no output waiting to be printed (or when there has been no output requested for a given length of time).
    • Include a RELREQ exit routine (described in Using exit routines) in the application program.
    • If the subsystem has a generation procedure, specify that the printer resource is (or is not) released when the application program's RELREQ exit routine is driven.
    • Use the SIMLOGON macroinstruction with OPTCD=RELRQ,Q options to initiate the session with the printer resource. RELREQ does not apply if the primary logical unit (PLU) is an independent LU.
  • Whether the PLU application program receives a session-initiation request or initiates a session, specific session parameters might need to be requested. To specify a session parameter, use the rules in Table 1.
Table 1. Rules for specifying a session parameter

 
Program action

Session initiated by
PLU application program

Session not initiated
by PLU application program

PLU application program modifies default parameters Allow generated name or name in master terminal requirements. Issue OPNDST OPTCD=ACCEPT with BNDAREA. Issue an INQUIRE OPTCD=SESSPARM in the LOGON exit routine. Then issue OPNDST OPTCD=ACCEPT with the new parameters.
PLU application program accepts default parameters Allow generated name or name in master terminal requirements. Issue OPNDST OPTCD=ACQUIRE. Or, issue SIMLOGON with name and then issue OPNDST OPTCD=ACCEPT with LOGMODE=0. Issue an INQUIRE OPTCD=SESSPARM in the LOGON exit routine. Then issue OPNDST OPTCD=ACCEPT.
PLU application program uses CLSDST OPTCD=PASS Specify the name to establish a new COS. Issue SIMLOGON for the desired resource and interrogate the session parameters in the LOGON exit routine. Then issue CLSDST OPTCD=PASS with AREA containing the appropriate session parameter.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014