Writing a back-end transaction program for CICS
The back-end transaction (in VA Smalltalk Server, this transaction can be packaged) is initiated as a result of the front-end transaction's CONNECT PROCESS command.
Note:
This section, and other sections in this chapter, pertain to applications deployed on MVS.
Step 1: Obtaining the conversation identifier
Initially, the back-end transaction should determine the conversation identifier, although this is not strictly necessary (the convid is useful for audit trails). Also, if the back-end transaction is involved in more than one conversation, always specifying the convid improves program readability and debugging. The back-end transaction can obtain the convid using either the ASSIGN command or the EIB field EIBTRMID.
"Determine the conversation ID"
self convid: (CICS address exec eib eibtrmid).
Step 2: Retrieving conversation characteristics
Use the EXTRACT PROCESS in the back-end transaction to retrieve the transaction name and other conversation characteristics. With the EXTRACT PROCESS command, the transaction can also obtain the sync level at which the conversation was started.
| retrieveCharacteristics transactionName
transactionNameLength syncLevel |
"Issue EXTRACT PROCESS"
retrieveCharacteristics := CICS appcextractprocess
convid: (self convid);
exec.
"Assign transaction name"
transactionName := retrieveCharacteristics procname.
"Assign transaction name length"
transactionNameLength := retrieveCharacteristics proclength.
"Assign sync level"
syncLevel := retrieveCharacteristics synclevel.
Step 3: Receiving data from the front-end transaction
The back-end transaction starts in receive state (state 5) and must issue a RECEIVE command. By issuing the RECEIVE command, the back-end transaction receives whatever data the front-end transaction has sent and allows CICS to raise EIB flags and change the conversation state to reflect any request the front-end transaction has issued. Note that the receive methods for the front-end and back-end transactions can be identical.
| receiveData |
"Receive data from the front-end transaction"
receiveData := CICS appcreceive
convid: (self convid);
maxlength: 1024;
exec.
The back-end transaction can now use the SEND command to send data to the front-end transaction in the same manner the front-end transaction sends data to the back-end transaction. See Step 3: Sending data to the partner transaction. Also, the back-end transaction can end the conversation in the same way the front-end transaction requests the conversation be ended. See Step 5: Ending the conversation.
Last modified date: 01/29/2015