Access program

The main purpose of an access program is to start a conversation, communicate with the back-end application, and end the conversation.

It must also be able to handle exception cases such as edit errors, transactions that are not valid, or security violations, and it might need to manage signon/signoff sequences. It might also need to handle begin-session and end-session requirements, if special handlers are not provided. The SESSNSTATUS option of FEPI ALLOCATE tells you if a new session has been started, or if you are reusing an existing session.

For many FEPI applications, particularly where formatted data is used, the access program is not complex. However, you do need to be fully conversant with everything that the back-end application might do. Your application must behave just like the real terminal and operator, and you m ust send and receive data in the correct sequence. Within a conversation, any data received is passed to the application that owns the conversation; FEPI cannot determine whether it is the data or screen image that was expected or, for example, a message reporting an abnormal end. Although the FEPI application needs to handle these cases, the access program need not test for all possibilities. The suggested method is to test only for the expected data or screen image and use a special error-handling program if the test fails.

Other applications may require more sophisticated programming. In some cases, you not only have to understand all the displays and protocols of the back-end application, but must also be conversant with the detailed data stream protocols. Applications may have to be custom-written for each device and type of target that is to be supported.

Syncpoints are not needed and not applicable in FEPI because communication environments do not provide any recoverable units of work. It is up to you to provide the syncpoints and any recovery of data that you need. For particularly critical operations with the back-end applications, you may find that using “definite responses” is helpful; see DRx responses.