Structure and design

In addition to your main access program that handles communication with the back-end system, you may need to provide programs for other functions:

Begin session
Handle begin-session processing.
Unsolicited data
Handle unsolicited inbound data that arrives when there is no conversation.
End session
Handle end of conversation and end of session processing.

These functions could be combined in one program or implemented in separate programs with individual transaction names. There may be any number of each function, again according to your requirements and preferences. Suggestions about the various possibilities are given later.

As the application programmer, you will always write the main access programs. Sometimes the system programmer provides any special functions that are required; otherwise you would be responsible for these. Even if you are writing only the main access program, you need to be aware of what these special functions do and how they affect how you communicate with the back-end system. Because the use of these special functions is controlled by the pools that you use, you need to liase with the system programmers or administrators who set them up.

Several different styles of access program are possible:

One-out one-in conversational
One program performs the complete conversation with the target and each conversation has a single transmission to and from the back-end system.
Conversational
One program performs the complete conversation with the target with multiple transmissions to and from the back-end system, waiting each time for the inbound data.
Pseudoconversational
Here, one program sends data to the target and requests CICS® to start another program when the inbound data arrives.

The section beginning with FEPI key stroke and screen-image applications and ending with Specialized FEPI functions describes the various features of writing application programs. A set of sample programs is available to help you to get started; these are supplied as source code on the distribution tape. For details, see Appendix A. FEPI sample programs.

Programming

FEPI programs are CICS applications, so all aspects of CICS programming apply. For general information about writing CICS application programs, see the CICS Application Programming Guide. For programming information (including command formats, argument values, details on the translation of programs, and language considerations), see the CICS Application Programming Reference. Particularly relevant are the chapters in the CICS Application Programming Guide about designing efficient applications and dealing with exception conditions.

The FEPI application programming commands are an extension of the EXEC CICS commands. They have similar names and similar functions. The FEPI commands also have similar keywords, but they are distinguished by having FEPI as a prefix. For application programming the commands are:

EXEC CICS FEPI ALLOCATE
Starts a conversation with a back-end system.
EXEC CICS FEPI FREE
Ends the conversation with a back-end system.
EXEC CICS FEPI REQUEST PASSTICKET
Requests the external security manager to supply a password substitute.
EXEC CICS FEPI SEND
Sends data to the back-end system.
EXEC CICS FEPI RECEIVE
Receives data from the back-end system.
EXEC CICS FEPI CONVERSE
Sends data to and receives data from the back-end system.
EXEC CICS FEPI ISSUE
Sends control data to the back-end system.
EXEC CICS FEPI EXTRACT
Gets field data and attributes, set-and-test sequence number (STSN) data, or information about a conversation.
EXEC CICS FEPI START
Schedules a CICS transaction to handle inbound data.

Note that, when translating your programs, you must specify the FEPI option; this instructs the translator to process FEPI commands.

Your FEPI application programs can be AMODE(24) or AMODE(31)--that is, they can issue FEPI commands in either 24- or 31-bit addressing mode, and reside above or below the 16MB line.

Exception conditions

As with all CICS commands, FEPI commands may produce exception conditions that you can check using the RESP option, or capture using HANDLE CONDITION. Most FEPI command errors return INVREQ. The particular error in each case is uniquely identified by the RESP2 value. All the FEPI exception conditions and RESP2 values are listed in FEPI application programming reference. There are copy books that contain declarations for the RESP2 values:

If there is an error, the command does nothing, and output values are not changed. Note, however, that commands such as FEPI SEND may have transferred data before the condition is recognized.

You can use EDF and CECI to debug FEPI programs. Because FEPI commands can be quite long, you will probably find the NAME field of CECI useful.

[[ Contents Previous Page | Next Page Index ]]