BEGINTRANSACTION

Begins transaction processing by creating a transaction object.
Supports: MQSeries, MQSeries C, MSMQ

Syntax

CALL BEGINTRANSACTION(transid, tid, rc);

Required Arguments

transid
Numeric, output
Returns a handle to a transaction object that is generated for committing and canceling transactional processing, as well as freeing the resources that are associated with the transaction object.
tid
Numeric, input
Specifies the transport handle that is obtained from the INIT function.
rc
Numeric, output
Provides the return code from the CALL routine. If an error occurs, then the return code is nonzero. You can use the SAS function SYSMSG() in order to obtain a textual description of the return code.

Details

The created transaction object is used to commit or cancel prior processing (SENDMESSAGE and RECEIVEMESSAGE calls) that use the transaction object as a message property. Transaction processing is supported only by the MQSeries, MQSeries C, and MSMQ transports.

Example

The following example begins a transaction:
length msg $ 200;
length transid tid rc 8;
rc=0;
transid=0;
call begintransaction(transid, tid, rc);
if rc ^= 0 then do;
  put 'BEGINTRANSACTION: failed';
  msg = sysmsg();
  put msg;
end;
else put 'BEGINTRANSACTION: succeeded';