TRANSFER Programming Manual

Sample Client Code
Designing and Writing a Client
9–26 069138, Update 1 to 040970 Tandem Computers Incorporated
Step 15: Discard a package.
The user can discard a package from the INBOX while reading the mail by pressing
the F4 function key. In response, the client executes a BEGIN-TRANSACTION
operation, issues an UNSAVE-ITEM UOW, and then executes an
END-TRANSACTION operation. (If the UNSAVE UOW fails, TISERV reports the
error and the client displays an error message.) If more packages reside in the INBOX,
TISERV displays the next package.
After reading the mail, the correspondent presses the F16 key to return to the Logon
screen and log off.
Step 16: End the session.
To end the session, the client begins another transaction and issues the END-SESSION
UOW. When TISERV terminates the session, the client ends the transaction and again
presents the Logon screen. At this point, TISERV also resets the SESSION-ID field in
the IPC header to binary zeros.
Sample Client Code The SCREEN COBOL code required to support this simple client appears in Figure 9-5
and is explained with comments embedded in the code. In this code, you see:
UOW and IPC header definitions copied from the GCOB and GLNK files into a
program during compilation
UOWs that are issued outside the framework of a transaction
IPCs with one or more UOWs comprising the total content of a transaction
Transactions that span more than one SEND operation
The code also illustrates how to define your own copies of definitions supplied by the
TRANSFER delivery system and then modify the lengths of fields or number of
occurrences specified by some of them. (This is done, for instance, in the ADD-ITEM-
REC, ADD-SUBJECT-REC, and SCAN-FOLDER definitions.)
Where feasible, the conventions established by Tandem mail clients for REC-TYPE and
other values are also applied in this example, so that Tandem mail clients can handle
packages created by this client.