RSC/MP 7.2 Programming Manual

Application Development
HP NonStop Remote Server Call (RSC/MP) Programming Manual522360-004
6-10
Generating Transactions Automatically (Implicitly)
Server Reply Codes in TMF
The RSC/MP server reply code implicitly ends transactions. When used properly, this
feature can reduce network traffic by reducing or eliminating calls to
RscEndTransaction and RscAbortTransaction.
The server reply code that is specified in the SUCCESS_HI and SUCCESS_LO
options is an arbitrary value that is stored in the first two bytes of a message. The TDP
monitors this reply code (only if TMF_OPTION is set to RSC_END_TRANS or
RSC_BEGIN_END_TRANS) and uses this code to determine whether to end a
transaction. Both the NonStop host and the RSC/MP application must know the value
of the server reply codes.
If the server reply code is within the range specified by the SUCCESS_LO and
SUCCESS_HI options, RSC/MP automatically ends the transaction, and the database
changes are committed.
If the server reply code is not within the specified range, RSC/MP sets the return code
for the RscWriteRead to RSC_TRANSACTION_NOT_ENDED, and you must end or
abort the transaction explicitly.
Single-Step Transactions
To automatically generate a single-step TMF transaction, follow these steps:
1. Set the TMF_OPTION to RSC_BEGIN_END_TRANS.
2. Set the SUCCESS_LO and SUCCESS_HI options to the desired values. These
values establish the range of server reply codes that indicates successful
completion.
3. Issue an RscWriteRead call to perform a database operation.
Multi-step Transactions
To automatically generate a multi-step TMF transaction, follow these steps:
1. Set the TMF_OPTION option to 1 (the value of the RSC_BEGIN_TRANS
constant).
2. Issue an RscWrite or RscWriteRead call to send the first message in the
transaction to the host.
3. Set the TMF_OPTION option to zero.
4. Issue one or more RscWrite or RscWriteRead calls to perform further operations
on the database.
5. Set the TMF_OPTION option to RSC_END_TRANS.
Note. The RSC/MP server reply code is not the same as the server reply code for the
SCREEN COBOL SEND statement or for the Guardian file system REPLY procedure.