Begin-session handler

The begin-session handler transaction is started by FEPI when a connection is acquired. This transaction handles any functions that are required to initialize the session.

Typical tasks are as follows:
  • Handling device queries.
  • Handling any initial inbound data, or “good morning” message, following the bind.
  • Signing on to the back-end system.

Device queries are sent by the back-end system (particularly CICS®) if the terminal definitions so demand. You would normally reply ‘null’ (as illustrated by the begin-session sample program), or with some particular terminal properties that you want. Note, if you want to match the terminal properties to those of the real front-end terminal that an application is using, you cannot use a begin-session handler; each application will have to do its own begin-session handling.

When a back-end system sends a message after a successful bind, the connection should be in a pool where the INITIALDATA property is set to INBOUND. For SLU2, IMS always sends such a message; CICS may or may not do so depending on the way your system is defined. This extends the process of acquiring a connection to include receiving the data. Note that, if INBOUND is specified, the begin-session handler (or each application program, if there is no begin session handler) must issue a FEPI RECEIVE command to get the data and then send a suitable reply to the back-end system.

Remember that handling this initial data is just like handling any other back-end data: you must cope with whatever the back-end system may send, and handle and reply to it accordingly.

Security requirements in the back-end system might make it more appropriate for sign-on to be part of the access program. For information about implementing signon security, see Generating and using PassTickets for secure sign-on.

There is a sample begin-session handler program. For more information, see FEPI sample program: Begin session.