Skip to main content

Getting Started with Processed Transaction Data Interface

Overview

The Processed Transaction Data Interface is a crucial component of the CICS Bank Sample Application (CBSA). It is designed to handle the data related to processed transactions within the banking application. This interface is implemented using the Proctran class, which represents the structure and data of processed transactions.

Proctran Class

The Proctran class is generated by the IBM Record Generator for Java and includes various fields and constants that define the structure of a processed transaction. It includes fields for transaction details such as sort code, transaction number, date, time, reference, type, and description. This class is used across multiple components of the application, including COBOL programs and Java classes, to handle transaction data.


The Proctran class is defined in the src/webui/src/main/java/com/ibm/cics/cip/bankliberty/datainterfaces/PROCTRAN.java file. It initializes a CobolDatatypeFactory to handle COBOL data types.

public class PROCTRAN {
protected static CobolDatatypeFactory factory = new CobolDatatypeFactory();
static { factory.setStringTrimDefault(false); }

Usage in Java

In Java, the Proctran class is used in the ProcessedTransactionResource and ProcessedTransaction classes to manage and query transaction data.

Usage in COBOL

In COBOL, the Proctran class is used in various programs like DELACC, XFRFUN, CRECUST, CREACC, DELCUS, and DBCRFUN to interact with the transaction data stored in the DB2 database.


The DELACC COBOL program includes the PROCDB2 copybook and defines host variables for Proctran to interact with the DB2 database.

      * PROCTRAN DB2 copybook
EXEC SQL
INCLUDE PROCDB2
END-EXEC.

* PROCTRAN host variables for DB2
01 HOST-PROCTRAN-ROW.
03 HV-PROCTRAN-EYECATCHER PIC X(4).
03 HV-PROCTRAN-SORT-CODE PIC X(6).
03 HV-PROCTRAN-ACC-NUMBER PIC X(8).

Main Functions

The Proctran class includes several main functions to handle transaction data. Two important functions are getProcTranType and isProcTyChequeAcknowledged.

getProcTranType

The getProcTranType function retrieves the transaction type from the byte buffer. This function is essential for determining the type of transaction being processed.


The getProcTranType function checks if the procTranType is null and retrieves the transaction type from the byte buffer if it is.

	public String getProcTranType() {
if (procTranType == null) {
procTranType = PROC_TRAN_TYPE.getString(byteBuffer);
}
return procTranType;
}

isProcTyChequeAcknowledged

The isProcTyChequeAcknowledged function checks if the transaction type is 'Cheque Acknowledged'. It uses the getProcTranType function to get the transaction type and compares it with the constant PROC_TY_CHEQUE_ACKNOWLEDGED.


The isProcTyChequeAcknowledged function returns true if the transaction type is 'Cheque Acknowledged'.

	public boolean isProcTyChequeAcknowledged() {
return getProcTranType().equals(PROC_TY_CHEQUE_ACKNOWLEDGED);
}

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human