Virtual terminal connection problem with applications.

Document ID : KB000053140
Last Modified Date : 14/02/2018
Show Technical Document Details


Occasionally a user would report that when they tried to logon to an application they would immediately get a session ended message.
TPX LOG displays, Error message:TPXL0085 - with a SENSE CODE=0805000B. The Log will show details that may look something like:

   PLU=GHDB1269  SLU=GR2GR005  USER=ITJL     REQ=29 00001024 0080 
   TERMSB=1B31AC98 APPLSB=1B2ED968 EB=18B32380 RPL=18B39C88 
                 EVENT STORAGE PURGED


Receiving a Sense code 0805xxxx after TPX selects an ACB and requests a session with an application is almost always a result of the 'application' not cleaning up completely after a TERMSESS OPTCD=UNCOND (Unconditional).

This is the type of TERMSESS that TPX issues when TPX initiates a normal termination of the session (example; when a user issues a /I against a session). When this is initiated, VTAM will drive the applications losterm exit for the session, if there is one set up, and will send TPX an unbind at the same time to trigger TPX to clean up its half of the session. Some 'applications' do not handle the unconditional TERMSESS very well and may not completely clean up its half session (Control blocks or flags were not reset), although the application must be able to handle every type of TERMSESS trigger. At this point VTAM and TPX have correctly cleaned up all of their respective areas concerning the session.

When a subsequent session request is sent to the same 'application', using the same ACB, the application incorrectly believes that there is already a session to it on that ACB and returns a SENSE 0805xxxx error. This will usually occur on one or a handful of ACB's.

There are various ways to correct this situation. Using TPXOPER, mark the ACB(s) involved as unavailable. This makes the ACB unavailable for selection by TPX for any new session requests for any application. User currently using that ACB will not be effected. TPX will select the next appropriate available ACB to establish the session. This manual process can be automated using the supplied TPXUERR2 user exit (Sample in TPX SAMPLIB). Customize this exit and assemble and rename it to TPXUERR1 before moving it to the TPX load library.

A termination ACL is another approach of avoiding this situation. 'Applications' usually do not have a problem with users logging off natively. The termination ACL will be invoked whenever TPX senses a normal session termination /I processing and full control of terminating the session will be given to the ACL. TPX will not send the TERMSESS - this means that the author of the ACL must ensure that the ACL will always terminate the session.

The best solution to this situation, however, is to take care of the actual problem. Applications may or may not have various exits or utilities to handle similar error situations. For instance, CICS has a node error program, which can be coded to force a cleanup of the session for which the sense 0805 was issued.

With an unconditional termination the applications only recourse is to issue a close DEST.
This does not have to be immediate, as sometimes it goes through a clean up for data integrity. Close DEST should be issued following the clean up process.