⚡ demo⇄ rewrite🛤 journey📊 assessment📈 stats🖥 green screen🔬 console🚧 blockers⬢ served from poc-smk · Linux x86_64 · cloud VM (poc-jkdm-ai)
Quarry × MAT

Combined mainframe assessment

Quarry's deterministic scan, joined with Google MAT's Gemini judgments. The scanner owns every number; each judgment is labelled with the engine that produced it. On the 5 programs both engines reached, the two analyses sit side by side as a cross-check.

44/44
programs with judgment
5
Quarry LLM
44
MAT / Gemini
44
JCL jobs
83
datasets
Credibility contract. Before the merge, only 5 of 44 programs carried a judgment — Quarry's LLM pass is deliberately narrow because it is expensive. MAT fills the other 39, plus the JCL and dataset layers the scan never modelled. No MAT text is presented as a Quarry number; every panel says which engine spoke.

Programs

scanner

Facts from the scanner. Judgment from Quarry's LLM where it ran, MAT elsewhere.

CBACT01C

cbl/CBACT01C.cbl
scanner358 code lines2 calls out0 called by2 copybooks4 files
MAT / Gemini

Account Data Extraction and Formatting Batch Utility

Account Data Extraction and Formatting Batch Utility

The CBACT01C program is a batch processing component of the CardDemo credit card management system. Its primary business purpose is to read master account information from a primary database and distribute, format, and restructure this data into multiple downstream files. This utility acts as a data preparation and integration bridge, ensuring that core account metrics are readily available for reporting, archiving, and external subsystems.

For every account …

Full MAT analysis

Account Data Extraction and Formatting Batch Utility

The CBACT01C program is a batch processing component of the CardDemo credit card management system. Its primary business purpose is to read master account information from a primary database and distribute, format, and restructure this data into multiple downstream files. This utility acts as a data preparation and integration bridge, ensuring that core account metrics are readily available for reporting, archiving, and external subsystems.

For every account record retrieved from the master file, the program extracts key financial and administrative details, including current balances, credit limits, and cycle activities. It standardizes date formats—specifically the card reissue date—by invoking an external date-formatting utility to ensure consistency across the system. Additionally, the program applies business rules to populate default financial values, such as setting a standard debit amount when no cycle debit activity is recorded, before writing the formatted record to the main output file.

In addition to the primary output, the program restructures the account data into an array-based format for a second output file. This file captures multi-period balance and debit snapshots for each account, populating specific data slots to facilitate trend analysis, historical tracking, or multi-value reporting in downstream applications.

To optimize storage and support varied data consumers, the program also writes to a third, variable-length output file. It splits the account information into two distinct record types—a short administrative record containing the account ID and active status, and a longer financial summary record containing balances, credit limits, and the reissue year. Both records are written sequentially to the same variable-format file, allowing downstream systems to process only the specific data segments they require.

The program features robust error-checking mechanisms that monitor all file operations. If any file access or formatting error occurs, the program logs the diagnostic status and safely terminates execution to prevent data corruption, ensuring high operational reliability and data integrity within the batch production environment.

Functional Overview

The CBACT01C program is a batch utility designed to process account records from an indexed VSAM Key-Sequenced Data Set (KSDS) named ACCTFILE-FILE . For every account record read sequentially from the input file, the program performs data transformations, formats dates using an external utility, and writes output records to three distinct sequential target files:

  • OUT-FILE : A sequential file containing detailed account information.
  • ARRY-FILE : A sequential file containing an array structure populated with a combination of mapped and hardcoded financial balances.
  • VBRC-FILE : A variable-length sequential file. For each input account record, the program writes two separate records of different lengths (12 bytes and 39 bytes) to this file.
Detailed Business and Processing Logic

1. Initialization and File Operations

  • The program begins execution by displaying a startup message.
  • It attempts to open four files:
  • ACCTFILE-FILE (Input, VSAM KSDS)
  • OUT-FILE (Output, Sequential)
  • ARRY-FILE (Output, Sequential)
  • VBRC-FILE (Output, Variable-Length Sequential)
  • If any file fails to open successfully (status other than '00' ), the program displays an error message and terminates abnormally.

2. Main Processing Loop

The program executes a sequential read loop on ACCTFILE-FILE until the End-of-File (EOF) condition is met (File Status '10' ). For each valid record retrieved:

  • The raw input record is displayed in the system log.
  • The program processes and writes data to the three output files sequentially.

3. Output File Generation Logic

A. Detailed Account Extract ( OUT-FILE )

  • Direct Mapping : Key fields such as Account ID, Active Status, Current Balance, Credit Limit, Cash Credit Limit, Open Date, Expiration Date, Current Cycle Credit, and Group ID are mapped directly from the input record to the output record structure.
  • Date Formatting :
  • The program maps the input ACCT-REISSUE-DATE to the date-formatting parameter structure CODATECN-REC and to a working storage variable WS-REISSUE-DATE .
  • It sets the input date format type to '2' (indicating YYYY-MM-DD ) and the desired output date format type to '2' (indicating YYYYMMDD ).
  • It calls the external Assembler program COBDATFT to perform the date conversion.
  • The formatted date ( CODATECN-0UT-DATE ) is then moved to OUT-ACCT-REISSUE-DATE .
  • Conditional Debit Logic :
  • The program checks the input ACCT-CURR-CYC-DEBIT .
  • If the input debit amount is equal to zero, it overrides the output field OUT-ACCT-CURR-CYC-DEBIT with a default value of 2525.00 .
  • Note : If the input debit amount is non-zero, the program does not copy the input value to the output record, leaving the output field unpopulated (retaining residual or uninitialized data).
  • The completed record is written to OUT-FILE .

B. Array Account Extract ( ARRY-FILE )

  • The array record structure ARR-ARRAY-REC is initialized to clear previous data.
  • The Account ID is mapped to ARR-ACCT-ID .
  • A 5-occurrence array ( ARR-ACCT-BAL ) is populated with a mix of mapped and hardcoded values:
  • Occurrence 1 : Current Balance is mapped from ACCT-CURR-BAL ; Current Cycle Debit is set to a hardcoded value of 1005.00 .
  • Occurrence 2 : Current Balance is mapped from ACCT-CURR-BAL ; Current Cycle Debit is set to a hardcoded value of 1525.00 .
  • Occurrence 3 : Current Balance is set to a hardcoded value of -1025.00 ; Current Cycle Debit is set to a hardcoded value of -2500.00 .
  • Occurrences 4 and 5 : Remain zero-filled due to the initialization step.
  • The record is written to ARRY-FILE .

C. Variable-Length Record Extract ( VBRC-FILE )

For every single input account record, the program writes two separate records of different lengths to the variable-length file:

  • Record 1 (Status Record) :
  • The program initializes the VBRC-REC1 structure.
  • It maps the Account ID and Account Active Status.
  • It sets the variable record length indicator WS-RECD-LEN to 12 .
  • It writes the 12-byte record to VBRC-FILE .
  • Record 2 (Financial & Reissue Record) :
  • The program maps the Account ID, Current Balance, and Credit Limit.
  • It extracts the 4-digit reissue year ( WS-ACCT-REISSUE-YYYY ) parsed during the date-formatting step and maps it to VB2-ACCT-REISSUE-YYYY .
  • It sets the variable record length indicator WS-RECD-LEN to 39 .
  • It writes the 39-byte record to VBRC-FILE .

4. Program Termination

  • Upon reaching the end of the input file, the program closes the input ACCTFILE-FILE .
  • Note : The program does not explicitly close the three output files ( OUT-FILE , ARRY-FILE , and VBRC-FILE ) in its termination routine.
  • It displays an execution end message and exits using GOBACK .
Important Constants
  • CODATECN-TYPE = "2" : Specifies that the input date format to the formatting utility is YYYY-MM-DD .
  • CODATECN-OUTTYPE = "2" : Specifies that the desired output date format from the formatting utility is YYYYMMDD .
  • 2525.00 : Default debit amount applied to OUT-ACCT-CURR-CYC-DEBIT when the input debit is zero.
  • 1005.00 / 1525.00 / -1025.00 / -2500.00 : Hardcoded financial values used to populate occurrences 1, 2, and 3 of the output array record.
  • 12 : Record length specified for the first variable-length output record ( VBRC-REC1 ).
  • 39 : Record length specified for the second variable-length output record ( VBRC-REC2 ).
  • 999 : Abend code passed to the CEE3ABD system utility during abnormal termination.
Validation Logic
  • File Status Validation :
  • Open Operations : The program validates that the file status is '00' after opening each of the four files. Any other status is treated as a critical failure.
  • Read Operations : The program validates that the read status is either '00' (successful read) or '10' (End of File). Any other status triggers an immediate failure.
  • Write Operations : The program validates that write operations return a status of '00' or '10' . Any other status triggers an immediate failure.
  • Data Condition Validation :
  • Debit Zero Check : The program explicitly checks if ACCT-CURR-CYC-DEBIT EQUAL TO ZERO to determine whether to apply the default value of 2525.00 .
  • Numeric Status Check : During error handling, the program checks if the file status is numeric or if the first byte is '9' (indicating a VSAM-specific operating system code) to format the error display appropriately.
Data Elements Processed

Input Elements ( ACCTFILE-FILE )

  • ACCT-ID (11-digit numeric): Unique account identifier.
  • ACCT-ACTIVE-STATUS (1-character alphanumeric): Account status indicator.
  • ACCT-CURR-BAL (Signed numeric, 10 integer, 2 decimal): Current account balance.
  • ACCT-CREDIT-LIMIT (Signed numeric, 10 integer, 2 decimal): Total credit limit.
  • ACCT-CASH-CREDIT-LIMIT (Signed numeric, 10 integer, 2 decimal): Cash advance limit.
  • ACCT-OPEN-DATE (10-character alphanumeric): Date the account was opened.
  • ACCT-EXPIRAION-DATE (10-character alphanumeric): Account expiration date.
  • ACCT-REISSUE-DATE (10-character alphanumeric): Date the account card was reissued.
  • ACCT-CURR-CYC-CREDIT (Signed numeric, 10 integer, 2 decimal): Total credits in the current cycle.
  • ACCT-CURR-CYC-DEBIT (Signed numeric, 10 integer, 2 decimal): Total debits in the current cycle.
  • ACCT-GROUP-ID (10-character alphanumeric): Group identifier associated with the account.

Transformed and Output Elements

  • OUT-ACCT-REISSUE-DATE (10-character alphanumeric): Reissue date reformatted to YYYYMMDD via COBDATFT .
  • WS-ACCT-REISSUE-YYYY (4-character alphanumeric): Extracted year portion of the reissue date, written to the variable-length file.
  • ARR-ACCT-BAL (Array of 5 occurrences): Contains mapped current balances and hardcoded cycle debits.
  • WS-RECD-LEN (4-digit numeric): Controls the record length dynamically written to the variable-length file VBRC-FILE .
Exception and Error Handling
  • I/O Error Detection : After every file operation (OPEN, READ, WRITE, CLOSE), the program evaluates the corresponding file status variable.
  • File Status Formatting ( 9910-DISPLAY-IO-STATUS ) :
  • If a file status is non-numeric or starts with '9' (indicating a VSAM binary status code), the program extracts the binary sub-codes and formats them into a 4-digit display structure ( FILE STATUS IS: NNNN ).
  • For standard status codes, it formats them directly into the display structure.
  • Abnormal Program Termination ( 9999-ABEND-PROGRAM ) :
  • If any file operation returns an unexpected status code, the program displays a descriptive error message (e.g., 'ERROR READING ACCOUNT FILE' ), calls the status formatting routine, and invokes the IBM Language Environment (LE) abend service CEE3ABD .
  • It passes an abend code of 999 and a timing parameter of 0 to force an immediate dump and termination.
Security and Authorization Checks

No explicit security checks identified. The program relies entirely on external dataset-level security (such as RACF or ACF2) managed by the operating system and JCL execution environment.

Performance Considerations
  • Sequential VSAM Access : The program accesses the indexed VSAM KSDS file sequentially ( ACCESS MODE IS SEQUENTIAL ). This is highly efficient for batch processing where the entire file must be read.
  • Double Write Operations : For every input record, the program performs two separate write operations to the variable-length file VBRC-FILE . This doubles the I/O overhead for this specific dataset.
  • Lack of Commit/Checkpointing : The program does not implement intermediate commits or checkpointing. In the event of a failure mid-run, the entire step must be restarted, and output files must be cleared to prevent duplicate records.
  • Missing File Closes : The program fails to close OUT-FILE , ARRY-FILE , and VBRC-FILE before exiting. While modern operating systems automatically close open files upon step termination, relying on this behavior can lead to buffered data loss or resource locks in certain legacy environments.

<h2

CBACT02C

cbl/CBACT02C.cbl
scanner129 code lines1 calls out0 called by1 copybooks1 files
MAT / Gemini

Card Account Data Extraction and Reporting Utility

Card Account Data Extraction and Reporting Utility

The CBACT02C program is a batch utility within the CardDemo application designed to sequentially read and report credit or debit card information from a master indexed database. Its primary business purpose is to provide a straightforward mechanism for extracting, auditing, and verifying cardholder data stored within the system, serving as a foundational tool for administrative reporting and data validation.

During execution, the program processes individual card …

Full MAT analysis

Card Account Data Extraction and Reporting Utility

The CBACT02C program is a batch utility within the CardDemo application designed to sequentially read and report credit or debit card information from a master indexed database. Its primary business purpose is to provide a straightforward mechanism for extracting, auditing, and verifying cardholder data stored within the system, serving as a foundational tool for administrative reporting and data validation.

During execution, the program processes individual card records containing essential business and security details. This includes the unique 16-digit card number, the associated 11-digit customer account identifier, the 3-digit card verification value (CVV), the cardholder's embossed name, the card's expiration date, and its current operational status (such as active or inactive).

The operational flow of the utility is structured and sequential. It begins by establishing a connection to the card data file. Once the file is successfully opened, the program enters a processing loop that retrieves each card record one by one. For every record successfully read, the utility outputs the complete card details to the system log or standard output stream, continuing this process until it reaches the end of the file.

To ensure operational reliability, the program incorporates robust error-handling routines. If an unexpected issue occurs during the file opening, reading, or closing phases, the utility captures the specific file status code. It then formats this code into a readable diagnostic message, logs the error details to assist system administrators in troubleshooting, and initiates a controlled abnormal termination of the program to safeguard data integrity.

Program Overview

The CBACT02C program is a batch COBOL utility designed to sequentially read and print the contents of an indexed card data file ( CARDFILE ). The program opens the file, loops through all records sequentially, displays each record's content to the standard output, and closes the file upon reaching the end of the file (EOF). It features robust error handling, including specialized formatting for VSAM file status codes, and abnormally terminates (ABENDs) using the IBM Language Environment service CEE3ABD if any file operation fails.

Important Constants
  • 999 : The abnormal termination (ABEND) code passed to the CEE3ABD system utility.
  • 0 : The timing parameter value passed to CEE3ABD .
  • 'Y' : The state flag indicating that the End-of-File (EOF) has been reached.
  • 'N' : The state flag indicating that active processing is ongoing.
  • '00' : The standard COBOL file status code representing a successful I/O operation.
  • '10' : The standard COBOL file status code representing End-of-File.
  • 16 : The internal application result code ( APPL-EOF ) representing EOF.
  • 12 : The internal application result code representing a general I/O error.
  • 8 : The initial application result code set before opening or closing the file.
Validation Logic

Before and during processing, the program performs the following validation and integrity checks:

  • File Status Verification : After every file I/O operation (OPEN, READ, and CLOSE), the program validates the CARDFILE-STATUS variable.
  • A status of '00' is validated as successful, allowing the program to continue.
  • During a READ operation, a status of '10' is validated as a normal End-of-File condition, which gracefully stops the processing loop.
  • Any other status code is treated as an integrity failure, triggering error reporting and an immediate program abend.
  • File Status Type Validation : In the status display routine, the program checks if IO-STATUS is non-numeric or if the first character of the status is '9' . This validates whether the error is a standard COBOL file status or a VSAM-specific operating system status code, determining how the error code is parsed and formatted.
Data Elements Processed
  • CARDFILE-FILE : The input indexed VSAM dataset (KSDS) containing card records.
  • CARD-RECORD : The Working-Storage structure into which each record is read. It contains the following fields:
  • CARD-NUM (PIC X(16)): The primary key of the record, representing the credit card number.
  • CARD-ACCT-ID (PIC 9(11)): The account identifier associated with the card.
  • CARD-CVV-CD (PIC 9(03)): The card verification value.
  • CARD-EMBOSSED-NAME (PIC X(50)): The cardholder's name as embossed on the card.
  • CARD-EXPIRAION-DATE (PIC X(10)): The expiration date of the card.
  • CARD-ACTIVE-STATUS (PIC X(01)): The status flag indicating if the card is active.
  • CARDFILE-STATUS / IO-STATUS : Two-byte file status variables used to capture and evaluate the result of file operations.
  • IO-STATUS-04 : A formatted 4-character field used to display the file status in a standardized format.
  • TWO-BYTES-BINARY / TWO-BYTES-ALPHA : A redefinition structure used to convert binary VSAM status codes (when the status starts with '9') into a displayable numeric format.
  • APPL-RESULT : An internal status variable used to control program flow based on the success or failure of file operations.
Exception and Error Handling
  • I/O Error Detection : If any file operation (OPEN, READ, CLOSE) returns a status other than '00' (or '10' for READ), the program initiates its error handling routine.
  • Error Reporting : The program displays a specific error message (e.g., 'ERROR OPENING CARDFILE' , 'ERROR READING CARDFILE' , or 'ERROR CLOSING CARDFILE' ). It then calls 9910-DISPLAY-IO-STATUS to format and print the file status.
  • VSAM Status Formatting : If the file status is non-numeric or starts with '9' , the program extracts the second byte of the status as a binary value, converts it to a 3-digit integer, and displays it alongside the first character (e.g., 9 followed by the binary code converted to decimal). Otherwise, it displays the standard 2-digit status padded with leading zeros.
  • Abnormal Termination (ABEND) : After displaying the error details, the program calls 9999-ABEND-PROGRAM , which invokes the IBM Language Environment abend routine CEE3ABD with an abend code of 999 and a timing parameter of 0 . This terminates execution immediately and generates a dump for debugging.
Security and Authorization Checks

No explicit security checks identified. The program relies on external mainframe security, such as RACF (Resource Access Control Facility), to control access to the CARDFILE dataset at the JCL/operating system level.

Performance Considerations
  • Sequential Access of Indexed File : The program accesses an indexed file ( ORGANIZATION IS INDEXED ) using ACCESS MODE IS SEQUENTIAL . This is highly efficient for reading the entire dataset from beginning to end, as it avoids random index lookups for each record.
  • No Commit/Checkpointing : Since this is a read-only program that does not update any databases or files, there is no need for commit processing, checkpointing, or transaction logging.
  • Console I/O : The program uses DISPLAY statements to print every record. In a high-volume production environment, displaying thousands of records to the system console or job log ( SYSOUT ) can cause significant I/O overhead and inflate spool usage. If the dataset is large, redirecting this output or writing to a sequential report file would be more performant.

<h2

CBACT03C

cbl/CBACT03C.cbl
scanner130 code lines1 calls out0 called by1 copybooks1 files
MAT / Gemini

Batch Utility for Reading and Reporting Card Account Cross-Reference Data

Batch Utility for Reading and Reporting Card Account Cross-Reference Data

The CBACT03C program is a batch utility within the CardDemo application designed to retrieve and display account cross-reference information. In credit card processing systems, maintaining a clear link between physical cards, customer profiles, and financial accounts is essential. This program serves as an administrative and diagnostic tool to extract and output these relationships from the master cross-reference data store.

At its core, …

Full MAT analysis

Batch Utility for Reading and Reporting Card Account Cross-Reference Data

The CBACT03C program is a batch utility within the CardDemo application designed to retrieve and display account cross-reference information. In credit card processing systems, maintaining a clear link between physical cards, customer profiles, and financial accounts is essential. This program serves as an administrative and diagnostic tool to extract and output these relationships from the master cross-reference data store.

At its core, the program processes records that map individual credit card numbers to their corresponding customer and account identifiers. Each record contains a 16-digit card number, a 9-digit customer ID, and an 11-digit account ID. By reading this data, the program provides visibility into how credit cards are linked to specific customer accounts, which is vital for auditing, troubleshooting, and system reconciliation.

During execution, the program operates sequentially. It opens the indexed cross-reference file and enters a processing loop, reading each record one by one until it reaches the end of the file. As each valid record is retrieved, its contents are written to the system's standard output log, allowing administrators to view the complete mapping of cards to accounts. Once all records have been processed, the program closes the file and terminates normally.

To ensure operational reliability, the utility incorporates structured error handling for all file interactions. If an error occurs during the opening, reading, or closing of the cross-reference file, the program captures the file status, formats a diagnostic error message for system operators, and triggers a controlled abnormal termination. This prevents the program from failing silently and ensures that data access issues are immediately flagged for technical support.

Business Logic

The primary purpose of the CBACT03C program is to sequentially read and print the contents of an indexed Account Cross-Reference VSAM dataset ( XREFFILE ).

The execution flow of the program is structured as follows:

Initialization :

  • The program displays a startup message: 'START OF EXECUTION OF PROGRAM CBACT03C' .
  • It attempts to open the cross-reference file ( XREFFILE-FILE ) in INPUT mode.

Sequential Processing Loop :

  • The program executes a processing loop that continues until the END-OF-FILE flag is set to 'Y' .
  • Within each iteration, it calls the read routine ( 1000-XREFFILE-GET-NEXT ) to retrieve the next record from the file.
  • Redundant Display Behavior : If a record is successfully read (File Status '00' ), the program displays the record contents twice:
  • First, inside the read routine ( 1000-XREFFILE-GET-NEXT ) immediately after a successful read.
  • Second, in the main control loop after verifying that the END-OF-FILE flag remains 'N' .
  • When the end of the file is reached (File Status '10' ), the END-OF-FILE flag is set to 'Y' , which terminates the loop.

Termination :

  • The program closes the XREFFILE-FILE .
  • It displays a completion message: 'END OF EXECUTION OF PROGRAM CBACT03C' .
  • The program terminates and returns control to the operating system via GOBACK .
Important Constants
  • APPL-AOK (Value 0 ) : Represents a successful application operation (e.g., successful file open, read, or close).
  • APPL-EOF (Value 16 ) : Represents the End-of-File condition.
  • ABCODE (Value 999 ) : The specific abnormal termination code passed to the IBM Language Environment abend utility.
  • File Status '00' : Standard COBOL file status indicating successful completion of an I/O operation.
  • File Status '10' : Standard COBOL file status indicating that the end of the file has been reached during a sequential read.
Validation Logic

The program does not perform business-level validation on the data fields contained within the records. Instead, its validation logic is strictly focused on technical I/O integrity and file status verification:

  • File Open Validation : After executing the OPEN INPUT statement, the program verifies if XREFFILE-STATUS is equal to '00' . Any other status is treated as a critical failure.
  • File Read Validation : During sequential retrieval, the program checks XREFFILE-STATUS .
  • A status of '00' is validated as a successful read.
  • A status of '10' is validated as a normal End-of-File condition.
  • Any other status code is treated as an unexpected I/O error.
  • File Close Validation : After executing the CLOSE statement, the program verifies if XREFFILE-STATUS is equal to '00' . Any other status triggers an error routine.
Data Elements Processed
  • FD-XREF-CARD-NUM / XREF-CARD-NUM : A 16-character alphanumeric field representing the credit card number. This field serves as the primary record key for the indexed VSAM file.
  • XREF-CUST-ID : A 9-digit numeric field representing the unique customer identifier associated with the card.
  • XREF-ACCT-ID : An 11-digit numeric field representing the unique account identifier associated with the card.
  • XREFFILE-STATUS / IO-STATUS : Two-character alphanumeric fields used to capture and evaluate the status codes returned by the file system after every I/O operation.
  • IO-STATUS-04 : A formatted 4-character display field used to present file status codes in a readable format during error reporting.
Exception and Error Handling

If any file operation (Open, Read, or Close) fails with an unexpected status code, the program initiates a standardized abnormal termination sequence:

  • Error Logging : The program displays a specific error message indicating where the failure occurred (e.g., 'ERROR READING XREFFILE' , 'ERROR OPENING XREFFILE' , or 'ERROR CLOSING XREFFILE' ).
  • Status Formatting ( 9910-DISPLAY-IO-STATUS ) :
  • If the file status is non-numeric or begins with '9' (indicating a VSAM-specific operating system status), the program extracts the binary value of the second status byte, converts it to a 3-digit integer, and displays it alongside the first character (e.g., 9 followed by the binary sub-code).
  • If the status is standard numeric, it formats it as a 4-digit number with leading zeros (e.g., 0030 ) and displays it.
  • Abnormal Termination ( 9999-ABEND-PROGRAM ) :
  • The program displays 'ABENDING PROGRAM' .
  • It sets the timing parameter to 0 and the abend code to 999 .
  • It calls the IBM Language Environment dump and abend utility CEE3ABD using these parameters to force an immediate task termination and generate diagnostic logs.
Security and Authorization Checks

No explicit security checks identified. The program relies entirely on mainframe operating system-level security (such as IBM RACF) to control dataset access permissions for the physical file associated with the XREFFILE DD statement.

Performance Considerations
  • Sequential Access Mode : The program accesses the indexed VSAM file sequentially ( ACCESS MODE IS SEQUENTIAL ). This is the most efficient method for reading an entire dataset from beginning to end, as it minimizes index lookups.
  • I/O Overhead : The program contains redundant DISPLAY statements that write the entire CARD-XREF-RECORD to the system output ( SYSOUT ) twice for every record processed. In a high-volume production environment containing millions of cross-reference records, this redundant console logging will cause severe I/O bottlenecks and generate excessively large spool files.

<h2

CBACT04C

cbl/CBACT04C.cbl
scanner552 code lines1 calls out0 called by5 copybooks5 files
MAT / Gemini

Credit Card Account Monthly Interest Calculation and Posting Batch Process

Credit Card Account Monthly Interest Calculation and Posting Batch Process

This batch program is a core financial component of the CardDemo credit card processing system, responsible for calculating and posting monthly interest charges to customer accounts. By processing outstanding balances categorized by specific transaction types (such as purchases or cash advances), the program ensures that finance charges are accurately assessed and applied to each account according to its associated terms.

The program …

Full MAT analysis

Credit Card Account Monthly Interest Calculation and Posting Batch Process

This batch program is a core financial component of the CardDemo credit card processing system, responsible for calculating and posting monthly interest charges to customer accounts. By processing outstanding balances categorized by specific transaction types (such as purchases or cash advances), the program ensures that finance charges are accurately assessed and applied to each account according to its associated terms.

The program sequentially processes transaction category balances for each account. For every unique account, it retrieves master account details and cross-references the account with its associated card number. To determine the correct interest rate, the program matches the account's group classification, transaction type, and transaction category against a disclosure group registry. If a specific rate structure is not defined for an account group, the system automatically falls back to a standardized default interest rate to ensure continuous processing.

Once the applicable interest rate is determined, the program calculates the monthly interest charge based on the outstanding balance for that specific transaction category. For every calculated interest charge, the program generates a new system-initiated transaction record. This transaction includes details such as the calculated interest amount, a standardized description, the associated card number, and a current timestamp, which is then written to an output transaction file for downstream ledger posting.

As the program aggregates the calculated interest across different transaction categories for an account, it maintains a running total of the monthly interest. When the program finishes processing all categories for a given account, it updates the master account record. The total accumulated interest is added to the account's current balance, and the current cycle's credit and debit accumulators are reset to prepare the account for the next billing cycle.

Business Logic

The program CBACT04C is a batch COBOL program designed to calculate monthly interest for credit card accounts based on their category balances and applicable interest rates. It processes transaction category balances, computes interest, generates system transactions for the calculated interest, and updates the account master balances.

1. Initialization and File Processing

  • Parameter Input : The program accepts an external parameter containing a 10-character date ( PARM-DATE ), which is used during transaction record generation.
  • File Operations : Upon execution, the program opens five files:
  • TCATBAL-FILE (Input): Contains transaction category balances.
  • XREF-FILE (Input): Cross-references account IDs to card numbers.
  • DISCGRP-FILE (Input): Contains disclosure group interest rates.
  • ACCOUNT-FILE (I-O): Contains account master records.
  • TRANSACT-FILE (Output): Stores generated interest transactions.

2. Sequential Balance Processing and Account Grouping

  • The program reads the TCATBAL-FILE sequentially.
  • It groups transaction category balance records by Account ID ( TRANCAT-ACCT-ID ).
  • Account Change Detection :
  • When a new Account ID is encountered (or on the first record):
  • If it is not the first record processed, the program updates the previous account's master record with the accumulated interest.
  • It resets the accumulated interest accumulator ( WS-TOTAL-INT ) to zero.
  • It retrieves the new account's master record from ACCOUNT-FILE using the Account ID.
  • It retrieves the card cross-reference record from XREF-FILE using the Account ID to obtain the associated card number ( XREF-CARD-NUM ).

3. Interest Rate Retrieval and Fallback Logic

  • For each transaction category balance record, the program attempts to retrieve the interest rate from DISCGRP-FILE using a composite key consisting of:
  • Account Group ID ( ACCT-GROUP-ID from the account master record)
  • Transaction Category Code ( TRANCAT-CD )
  • Transaction Type Code ( TRANCAT-TYPE-CD )
  • Fallback Mechanism : If no specific disclosure group record is found (File Status '23' ), the program displays a warning and attempts to read a default interest rate by setting the Account Group ID to 'DEFAULT' while keeping the same transaction category and type codes.

4. Interest Calculation and Transaction Generation

  • If the retrieved interest rate ( DIS-INT-RATE ) is non-zero, the program performs the following:
  • Monthly Interest Calculation :

$$\text{Monthly Interest} = \frac{\text{Transaction Category Balance} \times \text{Interest Rate}}{1200}$$

  • Accumulation : The calculated monthly interest is added to the account's total accumulated interest ( WS-TOTAL-INT ).
  • Transaction Generation : A system-generated transaction record is created and written to TRANSACT-FILE with the following details:
  • Transaction ID : A concatenation of PARM-DATE and a sequential suffix ( WS-TRANID-SUFFIX ).
  • Transaction Type : '01' (representing interest/finance charges).
  • Transaction Category : '05' .
  • Source : 'System' .
  • Description : 'Int. for a/c [Account ID]' .
  • Amount : The calculated monthly interest.
  • Card Number : Retrieved from the cross-reference file.
  • Timestamps : Current system timestamp in DB2 format ( YYYY-MM-DD-HH.MIN.SS.MIL0000 ).

5. Fee Calculation (Stub)

  • The program contains a placeholder paragraph 1400-COMPUTE-FEES intended for fee calculations, which is currently not implemented.

6. Account Master Update and Logic Flaw

  • Account Update : When updating an account, the program:
  • Adds the accumulated interest ( WS-TOTAL-INT ) to the current account balance ( ACCT-CURR-BAL ).
  • Resets the current cycle credit ( ACCT-CURR-CYC-CREDIT ) and cycle debit ( ACCT-CURR-CYC-DEBIT ) fields to zero.
  • Rewrites the updated record back to ACCOUNT-FILE .
  • Critical Logic Flaw : Due to the structure of the main processing loop ( PERFORM UNTIL END-OF-FILE = 'Y' ), when the end of the TCATBAL-FILE is reached, the loop terminates immediately. As a result, the final account processed in the batch is never updated in ACCOUNT-FILE because the final 1050-UPDATE-ACCOUNT call is located in an unreachable ELSE branch of the loop.
Important Constants
  • Transaction Type Code (Interest) : '01'
  • Transaction Category Code (Interest) : '05'
  • Transaction Source : 'System'
  • Default Disclosure Group ID : 'DEFAULT'
  • Abend Code : 999
  • File Status Success : '00'
  • File Status End-of-File (EOF) : '10'
  • File Status Key Not Found : '23'
Validation Logic
  • File Open Status Verification : After opening each of the five files, the program verifies that the file status is '00' . Any other status code triggers an immediate program abend.
  • Sequential Read Validation : During sequential reads of TCATBAL-FILE , the program checks for status '00' (success) and '10' (EOF). Any other status code is treated as a critical error and triggers an abend.
  • Random Read Validation :
  • Account File : If a read on ACCOUNT-FILE fails with an INVALID KEY condition, the program displays an "ACCOUNT NOT FOUND" message. It then checks the file status; if it is not '00' , the program abends.
  • Cross-Reference File : If a read on XREF-FILE fails with an INVALID KEY condition, the program displays an "ACCOUNT NOT FOUND" message. If the file status is not '00' , the program abends.
  • Disclosure Group File : If a read on DISCGRP-FILE returns status '23' (Key Not Found), the program handles this as a valid business condition and triggers the fallback logic to search for the 'DEFAULT' group. Any status other than '00' or '23' triggers an abend.
  • Write/Rewrite Validation :
  • Rewriting to ACCOUNT-FILE and writing to TRANSACT-FILE require a file status of '00' . Any other status code results in an abend.
  • Interest Rate Check : The program verifies that DIS-INT-RATE is not equal to zero before executing interest calculations and transaction generation.
Data Elements Processed

Input Parameters

  • PARM-DATE : A 10-character date passed from the external execution environment, used as a prefix for generated transaction IDs.

Key Identifiers

  • TRANCAT-ACCT-ID / FD-ACCT-ID / FD-XREF-ACCT-ID / ACCT-ID : The 11-digit account number used to identify the customer account across the balance, master, and cross-reference files.
  • XREF-CARD-NUM : The 16-digit card number retrieved from the cross-reference file and written to the output transaction record.
  • ACCT-GROUP-ID / FD-DIS-ACCT-GROUP-ID : The 10-character group identifier used to determine the interest rate structure.
  • TRANCAT-CD / FD-DIS-TRAN-CAT-CD / TRAN-CAT-CD : The 4-digit transaction category code.
  • TRANCAT-TYPE-CD / FD-DIS-TRAN-TYPE-CD / TRAN-TYPE-CD : The 2-character transaction type code.
  • TRAN-ID : A 16-character unique transaction identifier generated by concatenating PARM-DATE and WS-TRANID-SUFFIX .

Financial Amounts and Balances

  • TRAN-CAT-BAL : The current balance for a specific transaction category, used as the principal for interest calculation.
  • DIS-INT-RATE : The interest rate retrieved from the disclosure group file.
  • WS-MONTHLY-INT : The calculated interest amount for the current category balance.
  • WS-TOTAL-INT : The accumulated interest across all categories for the current account.
  • ACCT-CURR-BAL : The current outstanding balance of the account, updated with the accumulated interest.
  • ACCT-CURR-CYC-CREDIT / ACCT-CURR-CYC-DEBIT : Cycle credit and debit accumulators, reset to zero during the account update.
  • TRAN-AMT : The transaction amount written to the output file (set to WS-MONTHLY-INT ).
Exception and Error Handling
  • File Status Formatting ( 9910-DISPLAY-IO-STATUS ) : When an I-O error occurs, the program formats the file status. If the status is non-numeric or represents a VSAM status code (first character '9' ), it extracts the binary sub-codes to display a detailed 4-digit error status.
  • Abnormal Program Termination ( 9999-ABEND-PROGRAM ) : In the event of an unrecoverable file status error, the program displays "ABENDING PROGRAM" and calls the IBM Language Environment abend service CEE3ABD with an abend code of 999 and a timing parameter of 0 to terminate execution and generate a dump.
  • Missing Master Records : If an account master or cross-reference record is missing for a processed balance, the program displays a console message but relies on the subsequent file status check to trigger the standard abend routine.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • Sequential vs. Random Access :
  • TCATBAL-FILE is processed sequentially, which is optimal for batch processing of all category balances.
  • ACCOUNT-FILE , XREF-FILE , and DISCGRP-FILE are accessed randomly. Because these are indexed files, performing random reads for every account change and category balance record can introduce significant I/O overhead if the dataset is large.
  • I/O Overhead :
  • A random read on DISCGRP-FILE is performed for every transaction category balance record. If accounts have multiple category balances, this results in repetitive disk I/O.
  • An output transaction is written to TRANSACT-FILE for every non-zero interest calculation, increasing write I/O.
  • Lack of Commit/Checkpointing : The program does not implement database commits, checkpointing, or restartability logic. If the program abends mid-run, the ACCOUNT-FILE (opened in I-O mode) will be left in a partially updated state, requiring a file restore before restarting the job.

<h2

CBCUS01C

cbl/CBCUS01C.cbl
scanner130 code lines1 calls out0 called by1 copybooks1 files
MAT / Gemini

CardDemo Customer Data Retrieval and Reporting Utility

CardDemo Customer Data Retrieval and Reporting Utility

This batch utility program is a core component of the CardDemo application, designed to sequentially retrieve and display comprehensive customer profile information from the primary customer database. Its primary business purpose is to serve as an administrative reporting and data verification tool, allowing system operators and business analysts to inspect the active customer registry.

The program processes detailed customer records containing sensitive and …

Full MAT analysis

CardDemo Customer Data Retrieval and Reporting Utility

This batch utility program is a core component of the CardDemo application, designed to sequentially retrieve and display comprehensive customer profile information from the primary customer database. Its primary business purpose is to serve as an administrative reporting and data verification tool, allowing system operators and business analysts to inspect the active customer registry.

The program processes detailed customer records containing sensitive and critical business data. This includes personal identification details such as full names, Social Security Numbers, government-issued IDs, and dates of birth. It also handles contact information, including multi-line physical addresses and telephone numbers, alongside financial attributes like electronic funds transfer (EFT) account identifiers, primary cardholder indicators, and FICO credit scores.

Operationally, the utility executes in a sequential batch flow. It begins by establishing a secure connection to the indexed customer data store. Once the file is successfully opened, the program enters a processing loop that reads each customer record one by one. For every record retrieved, the system outputs the complete customer profile to the system log for reporting purposes, continuing this cycle until it reaches the end of the database.

To ensure operational reliability and ease of maintenance, the utility features robust error-handling capabilities. It continuously monitors the status of all file operations. If an unexpected error occurs during the opening, reading, or closing of the customer database, the program captures the diagnostic status codes, logs a detailed error message to assist system administrators, and triggers a controlled abnormal termination to prevent data corruption or incomplete processing.

Functional Overview

The CBCUS01C program is a batch COBOL utility designed to sequentially read and print the contents of an indexed customer master file ( CUSTFILE ). The program opens the file, loops through all records from the beginning to the end of the file, outputs the record contents to the system display (SYSOUT), and closes the file before terminating.

A notable characteristic of this program's processing logic is that every successfully read customer record is displayed twice:

  • Once inside the read routine ( 1000-CUSTFILE-GET-NEXT ) immediately after a successful read.
  • A second time in the main processing loop of the PROCEDURE DIVISION after control returns from the read routine.
Important Constants
  • APPL-AOK (Value 0 ): Condition name indicating a successful file operation or application state.
  • APPL-EOF (Value 16 ): Condition name indicating that the End-Of-File (EOF) has been reached on the input file.
  • ABCODE (Value 999 ): The abnormal termination code passed to the IBM Language Environment (LE) abend service.
  • TIMING (Value 0 ): Timing parameter passed to the abend service, specifying immediate termination without delay.
  • END-OF-FILE Flags:
  • 'N' : Indicates there are more records to process.
  • 'Y' : Indicates the end of the file has been reached.
Validation Logic
  • File Status Code Verification: The program performs strict validation on the 2-character COBOL File Status key ( CUSTFILE-STATUS ) after every file system interaction:
  • Open Validation: Verifies that the status is exactly '00' (Success). Any other status is treated as a critical failure.
  • Read Validation: Validates if the status is '00' (Success) or '10' (End of File). Any other status (such as a hardware error or locked record) is treated as a critical failure.
  • Close Validation: Verifies that the status is exactly '00' (Success). Any other status is treated as a critical failure.
  • No Field-Level Validation: The program does not perform any data integrity or format validation (such as numeric checks on SSN, FICO score, or date formats) on the individual fields of the customer record before displaying them. It relies entirely on the structural integrity of the VSAM file.
Data Elements Processed
  • CUSTFILE-FILE : The input indexed VSAM dataset (KSDS).
  • FD-CUST-ID (PIC 9(09)): The primary key of the indexed file, representing the unique Customer Identifier.
  • CUSTOMER-RECORD : The 500-byte target structure into which the file records are read. Key fields within this structure include:
  • CUST-ID (PIC 9(09)): Customer Identifier.
  • CUST-FIRST-NAME (PIC X(25)), CUST-MIDDLE-NAME (PIC X(25)), CUST-LAST-NAME (PIC X(25)): Customer name components.
  • CUST-ADDR-LINE-1 / 2 / 3 (PIC X(50) each): Street address lines.
  • CUST-ADDR-STATE-CD (PIC X(02)), CUST-ADDR-COUNTRY-CD (PIC X(03)), CUST-ADDR-ZIP (PIC X(10)): Geographic address details.
  • CUST-PHONE-NUM-1 / 2 (PIC X(15) each): Contact phone numbers.
  • CUST-SSN (PIC 9(09)): Social Security Number.
  • CUST-GOVT-ISSUED-ID (PIC X(20)): Government-issued identification number.
  • CUST-DOB-YYYY-MM-DD (PIC X(10)): Customer Date of Birth.
  • CUST-EFT-ACCOUNT-ID (PIC X(10)): Electronic Funds Transfer Account ID.
  • CUST-PRI-CARD-HOLDER-IND (PIC X(01)): Primary cardholder indicator flag.
  • CUST-FICO-CREDIT-SCORE (PIC 9(03)): Customer's FICO credit score.
  • CUSTFILE-STATUS / IO-STATUS : 2-character status variables used to capture and evaluate VSAM I/O return codes.
  • IO-STATUS-04 : A formatted 4-character alphanumeric field used to construct a readable file status code for error reporting.
Exception and Error Handling
  • I/O Failure Detection: If any file operation (Open, Read, or Close) returns an unexpected file status code, the program bypasses normal processing and branches to error handling.
  • File Status Formatting ( Z-DISPLAY-IO-STATUS ):
  • If the file status is non-numeric or begins with '9' (indicating a VSAM-specific operating system/file system error), the program extracts the second byte of the status, redefines it as a binary value, and formats it into a 4-digit display string as 9NNN (where NNN is the binary value of the second byte).
  • For standard COBOL file status codes, it formats the status as 00XX (where XX is the 2-character status).
  • The formatted status is displayed to the console: FILE STATUS IS: NNNN [status] .
  • Abnormal Program Termination ( Z-ABEND-PROGRAM ):
  • Upon encountering a critical I/O error, the program displays the message 'ABENDING PROGRAM' .
  • It calls the IBM Language Environment service CEE3ABD using ABCODE ( 999 ) and TIMING ( 0 ) to force an immediate abnormal termination (ABEND) of the batch job step, preventing subsequent steps in the JCL from executing.
Security and Authorization Checks
  • No explicit security checks identified. The program relies entirely on mainframe dataset-level security (such as RACF or ACF2) to control read access to the physical CUSTFILE dataset at the JCL execution level.
Performance Considerations
  • Sequential Access Mode: The program accesses the indexed VSAM file using ACCESS MODE IS SEQUENTIAL . This is the most efficient access method for reading an entire dataset from start to finish, as it allows the operating system to utilize read-ahead buffering.
  • I/O Overhead (SYSOUT): The program executes two DISPLAY statements for every single customer record processed. In a production environment with a large volume of customer records, writing excessive data to SYSOUT will cause severe I/O bottlenecks, significantly increase execution time, and consume excessive system spool space.

<h2

CBEXPORT

cbl/CBEXPORT.cbl
scanner396 code lines1 calls out0 called by6 copybooks6 files
MAT / Gemini

CardDemo Branch Migration Data Export Utility

CardDemo Branch Migration Data Export Utility

The CardDemo Branch Migration Data Export Utility is a batch processing program designed to facilitate the migration of credit card and customer data during branch restructuring or system integration. Its primary business purpose is to consolidate disparate customer-related information from multiple source databases into a single, standardized sequential export file. This consolidated file serves as the primary data payload for downstream migration and ingestion …

Full MAT analysis

CardDemo Branch Migration Data Export Utility

The CardDemo Branch Migration Data Export Utility is a batch processing program designed to facilitate the migration of credit card and customer data during branch restructuring or system integration. Its primary business purpose is to consolidate disparate customer-related information from multiple source databases into a single, standardized sequential export file. This consolidated file serves as the primary data payload for downstream migration and ingestion systems.

To build a complete profile for migration, the utility extracts data across five core business areas. It reads comprehensive customer profiles (including contact details and credit scores), account financial statuses (such as balances and credit limits), card cross-reference mappings, historical transaction records, and active card details. By gathering these interrelated data points, the program ensures that no critical customer or financial history is left behind during the migration process.

The output of this utility is a unified, multi-record export file where each record is formatted with a standardized metadata header. This header includes a record type indicator (distinguishing customers, accounts, transactions, cross-references, and cards), a precise generation timestamp, a sequential tracking number, and regional branch identifiers. The specific business data for each entity is appended to this header, creating a highly structured and optimized file layout that simplifies parsing for target systems.

Operating in a sequential batch execution flow, the program processes each data category systematically. It incorporates strict validation and error-handling protocols; if any file access or write operation encounters an issue, the program immediately terminates processing to prevent the generation of incomplete or corrupted export files. Upon successful completion, the utility outputs a detailed summary report to the system logs, detailing the exact number of records processed for each category and the grand total, providing immediate verification for data audit and reconciliation teams.

Business Logic

The CBEXPORT program is a batch COBOL utility designed to consolidate and export normalized customer, account, cross-reference, transaction, and card data from five separate indexed VSAM files into a single, multi-record sequential export file. This consolidated file is structured for branch migration and data integration purposes.

The program executes its business logic through the following sequential phases:

1. Initialization Phase

  • Execution Start : The program logs its startup to the console.
  • Timestamp Generation :
  • Retrieves the current system date in YYYYMMDD format and system time in HHMMSS99 format.
  • Formats the date into YYYY-MM-DD and the time into HH:MM:SS .
  • Combines these into a standardized 26-character timestamp: YYYY-MM-DD HH:MM:SS.00 . This timestamp is applied to every exported record to ensure temporal consistency across the export batch.
  • File Opening : Opens the five input files ( CUSTOMER-INPUT , ACCOUNT-INPUT , XREF-INPUT , TRANSACTION-INPUT , CARD-INPUT ) in INPUT mode and the single output file ( EXPORT-OUTPUT ) in OUTPUT mode. Each open operation is verified against its file status.

2. Sequential Export Processing

The program processes each input file entirely in a sequential, back-to-back manner. For every record read, it increments a global sequence counter ( WS-SEQUENCE-COUNTER ), formats a 500-byte export record, writes it to the output file, and updates entity-specific counters.

Customer Export ( 2000-EXPORT-CUSTOMERS ) :

  • Reads CUSTOMER-INPUT sequentially until End-Of-File (EOF).
  • Sets the record type identifier to 'C' .
  • Populates the common header fields (Timestamp, Sequence Number, Branch ID '0001' , and Region Code 'NORTH' ).
  • Maps customer-specific fields (such as Customer ID, Name, Address lines, State, Country, Zip, Phone numbers, SSN, Government ID, Date of Birth, EFT Account ID, Primary Cardholder Indicator, and FICO Credit Score) into the redefined customer data area.
  • Writes the record to EXPORT-OUTPUT .

Account Export ( 3000-EXPORT-ACCOUNTS ) :

  • Reads ACCOUNT-INPUT sequentially until EOF.
  • Sets the record type identifier to 'A' .
  • Populates the common header fields.
  • Maps account-specific fields (including Account ID, Active Status, Current Balance, Credit Limit, Cash Credit Limit, Open/Expiration/Reissue Dates, Current Cycle Credit/Debit, Zip Code, and Group ID) into the redefined account data area.
  • Writes the record to EXPORT-OUTPUT .

Cross-Reference Export ( 4000-EXPORT-XREFS ) :

  • Reads XREF-INPUT sequentially until EOF.
  • Sets the record type identifier to 'X' .
  • Populates the common header fields.
  • Maps cross-reference fields (Card Number, Customer ID, and Account ID) into the redefined cross-reference data area.
  • Writes the record to EXPORT-OUTPUT .

Transaction Export ( 5000-EXPORT-TRANSACTIONS ) :

  • Reads TRANSACTION-INPUT sequentially until EOF.
  • Sets the record type identifier to 'T' .
  • Populates the common header fields.
  • Maps transaction-specific fields (Transaction ID, Type Code, Category Code, Source, Description, Amount, Merchant ID, Merchant Name, Merchant City, Merchant Zip, Card Number, Original Timestamp, and Processed Timestamp) into the redefined transaction data area.
  • Writes the record to EXPORT-OUTPUT .

Card Export ( 5500-EXPORT-CARDS ) :

  • Reads CARD-INPUT sequentially until EOF.
  • Sets the record type identifier to 'D' .
  • Populates the common header fields.
  • Maps card-specific fields (Card Number, Account ID, CVV Code, Embossed Name, Expiration Date, and Active Status) into the redefined card data area.
  • Writes the record to EXPORT-OUTPUT .

3. Finalization Phase

  • File Closure : Closes all five input files and the output export file.
  • Reporting : Outputs a summary report to the job log displaying the total number of records exported for each entity type, as well as the grand total of all records written.
Important Constants
  • Record Type Identifiers :
  • 'C' : Customer Record
  • 'A' : Account Record
  • 'X' : Card Cross-Reference Record
  • 'T' : Transaction Record
  • 'D' : Card Record
  • Default Branch ID : '0001'
  • Default Region Code : 'NORTH'
  • File Status Codes :
  • '00' : Success / OK
  • '10' : End of File (EOF)
Validation Logic
  • File Status Verification :
  • The program performs strict validation on the file status of every I/O operation.
  • After opening each file, the program verifies that the status is '00' (Success). Any other status code is treated as a critical failure.
  • During sequential read loops, the program verifies that the status is either '00' (Success) or '10' (End of File). Any other status code triggers an immediate abnormal termination.
  • After every write operation to the export file, the program verifies that the status is '00' .
  • Data Integrity :
  • The program does not perform field-level validation (such as range checks, numeric validation, or date format verification) on the input data. It assumes the source indexed files contain clean, pre-validated data and directly maps the fields to the output structure.
Data Elements Processed

Identifiers and Keys

  • CUST-ID / EXP-CUST-ID : 9-digit Customer Identifier.
  • ACCT-ID / EXP-ACCT-ID : 11-digit Account Identifier.
  • XREF-CARD-NUM / EXP-XREF-CARD-NUM : 16-character Card Number used for cross-referencing.
  • TRAN-ID / EXP-TRAN-ID : 16-character Transaction Identifier.
  • CARD-NUM / EXP-CARD-NUM : 16-character Card Number.
  • EXPORT-SEQUENCE-NUM : 9-digit binary ( COMP ) auto-incrementing sequence number for the export file.
  • EXPORT-BRANCH-ID : 4-character Branch Identifier (hardcoded to '0001' ).
  • EXPORT-REGION-CODE : 5-character Region Code (hardcoded to 'NORTH' ).

Financial Amounts

  • ACCT-CURR-BAL / EXP-ACCT-CURR-BAL : Current Account Balance (Signed, Packed Decimal COMP-3 ).
  • ACCT-CREDIT-LIMIT / EXP-ACCT-CREDIT-LIMIT : Account Credit Limit (Signed Numeric).
  • ACCT-CASH-CREDIT-LIMIT / EXP-ACCT-CASH-CREDIT-LIMIT : Cash Credit Limit (Signed, Packed Decimal COMP-3 ).
  • ACCT-CURR-CYC-CREDIT / EXP-ACCT-CURR-CYC-CREDIT : Current Cycle Credit Amount (Signed Numeric).
  • ACCT-CURR-CYC-DEBIT / EXP-ACCT-CURR-CYC-DEBIT : Current Cycle Debit Amount (Signed, Binary COMP ).
  • TRAN-AMT / EXP-TRAN-AMT : Transaction Amount (Signed, Packed Decimal COMP-3 ).

Dates and Timestamps

  • CUST-DOB-YYYY-MM-DD / EXP-CUST-DOB-YYYY-MM-DD : Customer Date of Birth.
  • ACCT-OPEN-DATE / EXP-ACCT-OPEN-DATE : Account Opening Date.
  • ACCT-EXPIRAION-DATE / EXP-ACCT-EXPIRAION-DATE : Account Expiration Date.
  • ACCT-REISSUE-DATE / EXP-ACCT-REISSUE-DATE : Account Reissue Date.
  • TRAN-ORIG-TS / EXP-TRAN-ORIG-TS : Original Transaction Timestamp.
  • TRAN-PROC-TS / EXP-TRAN-PROC-TS : Processed Transaction Timestamp.
  • CARD-EXPIRAION-DATE / EXP-CARD-EXPIRAION-DATE : Card Expiration Date.
  • EXPORT-TIMESTAMP : 26-character Export Generation Timestamp.

Control and Statistical Counters

  • WS-SEQUENCE-COUNTER : Internal counter tracking the global sequence of written records.
  • WS-CUSTOMER-RECORDS-EXPORTED : Total count of customer records processed.
  • WS-ACCOUNT-RECORDS-EXPORTED : Total count of account records processed.
  • WS-XREF-RECORDS-EXPORTED : Total count of cross-reference records processed.
  • WS-TRAN-RECORDS-EXPORTED : Total count of transaction records processed.
  • WS-CARD-RECORDS-EXPORTED : Total count of card records processed.
  • WS-TOTAL-RECORDS-EXPORTED : Grand total of all records written to the export file.
Exception and Error Handling
  • I/O Error Detection : The program continuously monitors the file status variables ( WS-CUSTOMER-STATUS , WS-ACCOUNT-STATUS , WS-XREF-STATUS , WS-TRANSACTION-STATUS , WS-CARD-STATUS , WS-EXPORT-STATUS ) after every file interaction.
  • Console Error Logging : If an unexpected file status is encountered (any status other than '00' , or '10' during a read), the program writes a descriptive error message to the console (e.g., 'ERROR: Reading CUSTOMER-INPUT, Status: [status-code]' ).
  • Abnormal Program Termination (ABEND) : Upon detecting a critical I/O error, the program transfers control to the 9999-ABEND-PROGRAM paragraph. This paragraph displays 'CBEXPORT: ABENDING PROGRAM' and calls the IBM Language Environment dump and abend service CEE3ABD to terminate execution immediately, preventing partial or corrupted exports.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • Sequential Access Mode : Although the input files are defined as ORGANIZATION IS INDEXED , they are accessed using ACCESS MODE IS SEQUENTIAL . This is highly efficient for bulk data extraction because it reads the VSAM datasets in physical sequence, avoiding the overhead associated with random index lookups.
  • Storage and I/O Optimization :
  • The export record structure utilizes computational data formats ( COMP for binary integers and COMP-3 for packed decimals) for numeric and financial fields. This significantly reduces the physical record size on disk.
  • The output record length is fixed at exactly 500 bytes ( RECORD CONTAINS 500 CHARACTERS with RECORDING MODE IS F ), which allows for predictable block sizes and optimized I/O buffer allocation on the mainframe.
  • Memory Efficiency : The program uses a single EXPORT-RECORD structure in Working-Storage with multiple REDEFINES clauses. This allows the program to reuse the same 460-byte data buffer ( EXPORT-RECORD-DATA ) for all five record types, minimizing the program's memory footprint.
  • Commit Frequency : The program does not implement intermediate commits, checkpoints, or restartability logic. It processes the entire export as a single, continuous unit of work. If a failure occurs mid-process, the entire job must be restarted from the beginning.

<h2

CBIMPORT

cbl/CBIMPORT.cbl
scanner337 code lines1 calls out0 called by6 copybooks7 files
MAT / Gemini

Batch Data Import and Normalization Utility for Credit Card Branch Migration

Batch Data Import and Normalization Utility for Credit Card Branch Migration

The CBIMPORT program is a batch processing utility designed for the CardDemo credit card application to facilitate seamless branch migrations. Its primary business purpose is to ingest a consolidated, multi-record export file containing migrated branch data and split it into separate, normalized target files. By acting as an ETL (Extract, Transform, Load) pipeline, the program ensures that legacy or consolidated branch data is cleanly …

Full MAT analysis

Batch Data Import and Normalization Utility for Credit Card Branch Migration

The CBIMPORT program is a batch processing utility designed for the CardDemo credit card application to facilitate seamless branch migrations. Its primary business purpose is to ingest a consolidated, multi-record export file containing migrated branch data and split it into separate, normalized target files. By acting as an ETL (Extract, Transform, Load) pipeline, the program ensures that legacy or consolidated branch data is cleanly distributed into the core system's structured data model.

The program sequentially processes a single input file containing mixed record types. As it reads each record, it identifies the specific business entity based on a record type indicator. The system supports five core business entities essential to credit card operations: Customer Profiles, Financial Accounts, Card-to-Account Cross-References, Financial Transactions, and Physical Card details.

During the processing phase, the program maps the fields from the consolidated import record into their respective normalized structures. Each validated record is then written to its dedicated sequential output file. This decomposition process ensures that downstream database tables and core application systems receive clean, isolated, and properly formatted datasets.

To maintain high operational integrity, the program features robust error handling and validation mechanisms. If a critical file system error occurs during the opening, reading, or writing of any file, the program immediately terminates execution to prevent data corruption. Any unrecognized or malformed records encountered during the run are redirected to a dedicated error log, complete with a timestamp, sequence number, and diagnostic message for administrative troubleshooting.

Upon reaching the end of the input file, the program performs finalization tasks by closing all resources and generating a comprehensive execution summary. It outputs detailed processing statistics to the system log, including the total number of records read, the count of successfully imported records for each business entity, and the total number of errors logged. This provides administrators with complete visibility and auditability over the migration process.

Business Logic Overview

The CBIMPORT program is a batch COBOL utility designed for the Branch Migration Import process within the CardDemo application. Its primary business purpose is to ingest a consolidated, multi-record export file containing migrated branch data and split (normalize) it into five distinct, entity-specific sequential target files: Customers, Accounts, Card Cross-References, Transactions, and Cards.

The program reads the input file sequentially, identifies the record type of each entry, maps the compressed/binary data fields into standard display formats, writes the formatted records to their respective output destinations, and logs any unrecognized record types to an error file. At the end of execution, it generates a detailed console report summarizing the import statistics.

Detailed Process Flow

Initialization ( 1000-INITIALIZE & 1100-OPEN-FILES ) :

  • Displays a startup message to the console.
  • Captures the current system date and time using FUNCTION CURRENT-DATE and formats them into YYYY-MM-DD and HH:MM:SS formats for reporting.
  • Opens the input export file ( EXPORT-INPUT ) and all six output files ( CUSTOMER-OUTPUT , ACCOUNT-OUTPUT , XREF-OUTPUT , TRANSACTION-OUTPUT , CARD-OUTPUT , and ERROR-OUTPUT ).
  • Verifies the file status of each open operation. If any file fails to open successfully, the program displays an error message and terminates abnormally.

File Processing Loop ( 2000-PROCESS-EXPORT-FILE ) :

  • Performs an initial read of the export file.
  • Enters a loop that continues until the End-of-File (EOF) status ( 10 ) is reached on the input file.
  • For each record read:
  • Increments the total record read counter ( WS-TOTAL-RECORDS-READ ).
  • Evaluates the record type and routes the record to the appropriate processing paragraph.
  • Reads the next record from the input file.

Record-Specific Processing ( 2200-PROCESS-RECORD-BY-TYPE through 2750-WRITE-ERROR ) :

  • Customer Records (Type 'C') :
  • Initializes the customer output record structure.
  • Maps fields from the input redefined area ( EXPORT-CUSTOMER-DATA ) to the output structure ( CUSTOMER-RECORD ). This includes converting the binary customer ID ( COMP ) and packed decimal FICO score ( COMP-3 ) into standard display formats, and mapping occurring arrays for addresses (3 occurrences) and phone numbers (2 occurrences).
  • Writes the record to CUSTOMER-OUTPUT , verifies the write status, and increments the customer import counter.
  • Account Records (Type 'A') :
  • Initializes the account output record structure.
  • Maps fields from EXPORT-ACCOUNT-DATA to ACCOUNT-RECORD . This includes converting packed decimal fields ( EXP-ACCT-CURR-BAL , EXP-ACCT-CASH-CREDIT-LIMIT ) and binary fields ( EXP-ACCT-CURR-CYC-DEBIT ) to display formats.
  • Writes the record to ACCOUNT-OUTPUT , verifies the write status, and increments the account import counter.
  • Card Cross-Reference Records (Type 'X') :
  • Initializes the cross-reference output record structure.
  • Maps fields from EXPORT-CARD-XREF-DATA to CARD-XREF-RECORD , converting the binary account ID ( COMP ) to display format.
  • Writes the record to XREF-OUTPUT , verifies the write status, and increments the cross-reference import counter.
  • Transaction Records (Type 'T') :
  • Initializes the transaction output record structure.
  • Maps fields from EXPORT-TRANSACTION-DATA to TRAN-RECORD , converting the packed decimal transaction amount ( COMP-3 ) and binary merchant ID ( COMP ) to display formats.
  • Writes the record to TRANSACTION-OUTPUT , verifies the write status, and increments the transaction import counter.
  • Card Records (Type 'D') :
  • Initializes the card output record structure.
  • Maps fields from EXPORT-CARD-DATA to CARD-RECORD , converting the binary account ID ( COMP ) and binary CVV code ( COMP ) to display formats.
  • Writes the record to CARD-OUTPUT , verifies the write status, and increments the card import counter.
  • Unknown Records (Any other type) :
  • Increments the unknown record counter.
  • Formats an error record with the current timestamp, the invalid record type character, the record's sequence number, and the message "Unknown record type encountered" .
  • Writes this formatted error record to ERROR-OUTPUT and increments the error write counter.

Validation ( 3000-VALIDATE-IMPORT ) :

  • Executes a placeholder validation paragraph that logs completion messages to the console.

Finalization ( 4000-FINALIZE ) :

  • Closes all open input and output files.
  • Prints a comprehensive execution summary to the console, detailing:
  • Total records read.
  • Total records successfully imported for each of the five target entities.
  • Total error records written.
  • Total unknown record types encountered.
Important Constants
  • Record Type Identifiers :
  • 'C' - Customer Record
  • 'A' - Account Record
  • 'X' - Card Cross-Reference Record
  • 'T' - Transaction Record
  • 'D' - Card Record
  • File Status Codes :
  • '00' - Success / OK
  • '10' - End of File (EOF)
  • System Abend Utility :
  • 'CEE3ABD' - IBM Language Environment service used to trigger an abnormal program termination.
Validation Logic
  • File Status Verification : The program strictly validates the file status code after every file operation (Open, Read, and Write). If any status code other than '00' (or '10' for EOF on reads) is returned, the program immediately halts processing and triggers an ABEND.
  • Record Type Validation : The program performs a structural validation on the input record's header field EXPORT-REC-TYPE . If the value is not one of the five valid constants ( 'C' , 'A' , 'X' , 'T' , or 'D' ), the record is rejected from normal processing, classified as an error, and written to the error log.
  • Data Integrity : Although the business use case mentions checksum validation, the actual implementation in 3000-VALIDATE-IMPORT is a placeholder that automatically logs successful validation without performing active data-level checksum calculations.
Data Elements Processed

Input Elements (from EXPORT-INPUT )

  • Metadata : EXPORT-REC-TYPE (1-byte type indicator), EXPORT-SEQUENCE-NUM (4-byte binary sequence key), EXPORT-TIMESTAMP (26-byte timestamp).
  • Customer Data : EXP-CUST-ID (4-byte binary), names (first, middle, last), address lines (3-element array), state, country, zip, phone numbers (2-element array), SSN, government ID, date of birth, EFT account ID, primary cardholder indicator, and EXP-CUST-FICO-CREDIT-SCORE (2-byte packed decimal).
  • Account Data : EXP-ACCT-ID (11-digit numeric), active status, EXP-ACCT-CURR-BAL (7-byte packed decimal), credit limit, EXP-ACCT-CASH-CREDIT-LIMIT (7-byte packed decimal), open/expiration/reissue dates, current cycle credit, EXP-ACCT-CURR-CYC-DEBIT (4-byte binary), zip, and group ID.
  • Cross-Reference Data : EXP-XREF-CARD-NUM (16-byte card number), EXP-XREF-CUST-ID (9-digit customer ID), and EXP-XREF-ACCT-ID (8-byte binary account ID).
  • Transaction Data : EXP-TRAN-ID (16-byte transaction ID), type code, category code, source, description, EXP-TRAN-AMT (6-byte packed decimal), EXP-TRAN-MERCHANT-ID (4-byte binary), merchant name/city/zip, card number, and transaction timestamps.
  • Card Data : EXP-CARD-NUM (16-byte card number), EXP-CARD-ACCT-ID (8-byte binary account ID), EXP-CARD-CVV-CD (2-byte binary CVV), embossed name, expiration date, and active status.

Output Elements (Transformed and Written)

  • Normalized Records : Mapped and unpacked equivalents of all input elements written to CUSTOMER-OUTPUT (500 bytes), ACCOUNT-OUTPUT (300 bytes), XREF-OUTPUT (50 bytes), TRANSACTION-OUTPUT (350 bytes), and CARD-OUTPUT (150 bytes). All binary ( COMP ) and packed decimal ( COMP-3 ) fields are expanded into standard zoned-decimal display formats.
  • Error Records : Written to ERROR-OUTPUT (132 bytes) containing the error timestamp, the invalid record type, the sequence number, and the literal message "Unknown record type encountered" .
Exception and Error Handling
  • Critical File Failures : If any file operation (such as opening a file or writing a record) fails with a non-zero status, the program writes a descriptive error message to the console (e.g., 'ERROR: Cannot open EXPORT-INPUT, Status: [status-code]' ) and calls paragraph 9999-ABEND-PROGRAM .
  • Program ABEND : The 9999-ABEND-PROGRAM paragraph calls the IBM Language Environment service 'CEE3ABD' to abnormally terminate the program. This ensures that the job step fails in the JCL, preventing downstream jobs from running with incomplete data.
  • Non-Critical Record Errors : If an unrecognized record type is encountered, the program does not abend. Instead, it handles the exception gracefully by logging the record's metadata to the ERROR-OUTPUT file, incrementing the error counters, and continuing to process the remaining records in the export file.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • Sequential I/O Efficiency : The program processes the input file sequentially, which is highly efficient for batch processing of large datasets.
  • Data Conversion Overhead : The program performs extensive data conversion from packed decimal ( COMP-3 ) and binary ( COMP ) formats in the input file to zoned decimal/display formats in the output files. This is a CPU-bound operation that occurs for every record.
  • No Commit/Checkpointing : The program does not implement database commits or checkpoint-restart logic (e.g., IMS or DB2 checkpoints), as it operates entirely on flat/sequential files. If a failure occurs, the entire batch job must be restarted from the beginning, and output files must be cleared/recreated (since they are opened in OUTPUT mode, which overwrites existing content).
  • I/O Overhead : Writing to six different output files simultaneously can introduce I/O channel contention depending on the mainframe storage configuration.

<h2

CBPAUP0C

app-authorization-ims-db2-mq/cbl/CBPAUP0C.cbl
scanner266 code lines0 calls out0 called by2 copybooks0 files
MAT / Gemini

Pending Credit Card Authorization Expiry and Database Cleanup Batch Process

Pending Credit Card Authorization Expiry and Database Cleanup Batch Process

The primary business purpose of this program is to manage and clean up pending credit card transaction authorizations within the CardDemo application. In credit card processing, authorizations temporarily hold funds on a customer's account. If these authorizations are not finalized within a specific timeframe, they must be removed to release the held credit and keep the database performing efficiently. This batch program automates the …

Full MAT analysis

Pending Credit Card Authorization Expiry and Database Cleanup Batch Process

The primary business purpose of this program is to manage and clean up pending credit card transaction authorizations within the CardDemo application. In credit card processing, authorizations temporarily hold funds on a customer's account. If these authorizations are not finalized within a specific timeframe, they must be removed to release the held credit and keep the database performing efficiently. This batch program automates the identification and deletion of these stale, expired pending authorizations.

Upon execution, the program initializes its configuration by reading runtime parameters, which define the expiration threshold (defaulting to five days if not specified), database checkpoint frequencies, and diagnostic logging preferences. It captures the current system date to establish a baseline for calculating the age of each pending transaction.

The program systematically processes the hierarchical database by scanning through account-level authorization summary records and examining their associated detailed transaction records. For every pending transaction detail, the program calculates the number of days that have elapsed since the authorization was originally requested. If the transaction's age meets or exceeds the configured expiration threshold, it is classified as expired and targeted for removal.

Before deleting an expired transaction, the program dynamically updates the parent account's summary record. It subtracts the transaction's value and count from the accumulated pending totals—distinguishing between approved and declined amounts—to ensure the customer's credit availability and account balances are accurately restored. If a parent summary record no longer contains any active pending transactions after this cleanup, the program deletes the summary record itself to reclaim database storage.

To ensure operational reliability and prevent data loss in the event of a system interruption, the program periodically commits its database updates using a checkpoint mechanism based on the configured frequency. Once the entire database has been processed, the program outputs a final execution report detailing the total number of summary and detail records analyzed and deleted, providing clear visibility into the cleanup operations.

Program Overview

The CBPAUP0C program is a batch COBOL IMS program designed to clean up expired pending authorization records from an IMS database. It processes a hierarchical database consisting of a root segment, Pending Authorization Summary ( PAUTSUM0 ), and a child segment, Pending Authorization Details ( PAUTDTL1 ).

The program identifies expired authorization details based on a configurable retention period, deletes those details, adjusts the corresponding summary counters and amounts, and deletes the parent summary segment if no active authorizations remain.

Important Constants
  • WS-PGMNAME : 'CBPAUP0C' — The program identifier used in messages and logs.
  • PSB-NAME : 'PSBPAUTB' — The Program Specification Block name used to access the IMS database.
  • PAUT-PCB-NUM : +2 — The PCB index offset representing the database PCB.
  • WK-CHKPT-ID Prefix : 'RMAD' — The prefix used to generate unique checkpoint IDs.
  • Default Expiry Days : 5 — The default retention threshold if the input parameter is invalid or non-numeric.
  • Default Checkpoint Frequency : 5 — The default number of processed summary records before committing database changes.
  • Default Checkpoint Display Frequency : 10 — The default interval for displaying checkpoint success messages.
  • Approved Response Code : '00' — The code indicating a successfully approved authorization.
Validation Logic

1. Input Parameter Validation

Upon startup, the program reads execution parameters from SYSIN into the PRM-INFO structure and validates them:

  • P-EXPIRY-DAYS : Checked to ensure it is numeric. If valid, it is moved to WS-EXPIRY-DAYS ; otherwise, it defaults to 5 .
  • P-CHKP-FREQ : Checked for spaces, zero, or low-values. If invalid, it defaults to 5 .
  • P-CHKP-DIS-FREQ : Checked for spaces, zero, or low-values. If invalid, it defaults to 10 .
  • P-DEBUG-FLAG : Checked to see if it equals 'Y' . If not, it is forced to 'N' .

2. IMS Database Status Code Validation

The program evaluates the Database Interface Block Status Code ( DIBSTAT ) after every database operation to ensure data integrity:

  • Get Next (GN) on Summary ( PAUTSUM0 ) :
  • ' ' (Spaces): Success; processing continues.
  • 'GB' (End of Database): Normal termination flag is set.
  • Any other code : Triggers an immediate program ABEND.
  • Get Next in Parent (GNP) on Details ( PAUTDTL1 ) :
  • ' ' (Spaces): Success; child record found.
  • 'GE' / 'GB' (Not Found / End of Database): Indicates no more child segments exist for the current parent; loop terminates normally.
  • Any other code : Triggers an immediate program ABEND.
  • Delete (DLET) on Details or Summary :
  • ' ' (Spaces): Success.
  • Any other code : Triggers an immediate program ABEND.
  • Checkpoint (CHKP) :
  • ' ' (Spaces): Success.
  • Any other code : Triggers an immediate program ABEND.
Data Elements Processed

Input Parameters (SYSIN)

  • P-EXPIRY-DAYS : Number of days an authorization is allowed to remain pending before expiration.
  • P-CHKP-FREQ : Number of root segments to process before issuing an IMS checkpoint.
  • P-CHKP-DIS-FREQ : Frequency of displaying checkpoint status messages in the job log.
  • P-DEBUG-FLAG : Activates verbose logging when set to 'Y' .

System Variables

  • CURRENT-DATE : Current system date in YYMMDD format.
  • CURRENT-YYDDD : Current system date in Julian format ( YYDDD ).

IMS Pending Authorization Summary Segment ( PAUTSUM0 )

  • PA-ACCT-ID : Account Identifier (Key field).
  • PA-APPROVED-AUTH-CNT : Count of approved pending authorizations.
  • PA-DECLINED-AUTH-CNT : Count of declined pending authorizations.
  • PA-APPROVED-AUTH-AMT : Total monetary amount of approved pending authorizations.
  • PA-DECLINED-AUTH-AMT : Total monetary amount of declined pending authorizations.

IMS Pending Authorization Details Segment ( PAUTDTL1 )

  • PA-AUTH-DATE-9C : Complemented authorization date (stored as 99999 - Julian Date for descending sort order).
  • PA-AUTH-RESP-CODE : Response code of the authorization (e.g., '00' for approved).
  • PA-APPROVED-AMT : Approved transaction amount.
  • PA-TRANSACTION-AMT : Requested transaction amount.

Internal Accumulators

  • WS-NO-SUMRY-READ : Total number of summary records read.
  • WS-NO-SUMRY-DELETED : Total number of summary records deleted.
  • WS-NO-DTL-READ : Total number of detail records read.
  • WS-NO-DTL-DELETED : Total number of detail records deleted.
Business Logic and Program Flow

1. Initialization Phase

  • Retrieves the current system date and Julian date.
  • Accepts and validates runtime parameters from SYSIN .
  • Displays startup messages and the active configuration parameters.

2. Main Processing Loop

The program performs a sequential sweep of the database:

  • Step 2.1: Read Parent Summary
  • Issues an IMS GN (Get Next) call to retrieve the next PAUTSUM0 segment.
  • If the end of the database is reached ( DIBSTAT = 'GB' ), the loop terminates.
  • Step 2.2: Process Child Details
  • Issues an IMS GNP (Get Next in Parent) call to retrieve the first child PAUTDTL1 segment under the current parent.
  • For each child segment retrieved, the program determines if it has expired:
  • Decode Date : Reconstructs the original Julian date of the authorization:

$$\text{WS-AUTH-DATE} = 99999 - \text{PA-AUTH-DATE-9C}$$

  • Calculate Age : Computes the difference in days:

$$\text{WS-DAY-DIFF} = \text{CURRENT-YYDDD} - \text{WS-AUTH-DATE}$$

  • Evaluate Expiration : If WS-DAY-DIFF is greater than or equal to WS-EXPIRY-DAYS , the record is marked for deletion.
  • Adjust Parent Totals : If the detail record is expired, the parent summary counters and amounts are adjusted before deletion:
  • If Approved ( PA-AUTH-RESP-CODE = '00' ) :
  • Subtract 1 from PA-APPROVED-AUTH-CNT .
  • Subtract PA-APPROVED-AMT from PA-APPROVED-AUTH-AMT .
  • If Declined (Any other response code) :
  • Subtract 1 from PA-DECLINED-AUTH-CNT .
  • Subtract PA-TRANSACTION-AMT from PA-DECLINED-AUTH-AMT .
  • Delete Detail : Issues an IMS DLET call to physically delete the expired PAUTDTL1 segment.
  • Repeats the GNP call until all child segments for the current parent have been processed.
  • Step 2.3: Evaluate Parent Summary Deletion
  • After processing all child details, the program checks if the parent summary segment itself should be deleted.
  • Note on Code Logic : The program contains a logical redundancy/quirk in this check:

IF PA-APPROVED-AUTH-CNT <= 0 AND PA-APPROVED-AUTH-CNT <= 0

This statement evaluates the approved count twice instead of checking both approved and declined counts. If this condition is met, the program issues an IMS DLET call to delete the parent PAUTSUM0 segment.

  • Step 2.4: Checkpoint Management
  • Increments the processed summary counter ( WS-AUTH-SMRY-PROC-CNT ).
  • If the counter exceeds P-CHKP-FREQ , the program issues an IMS basic checkpoint ( CHKP ) to commit database changes and resets the counter.

3. Termination Phase

  • Issues a final IMS checkpoint to commit any remaining uncommitted changes.
  • Displays execution statistics including total records read and deleted for both summary and detail segments.
  • Terminates execution using GOBACK .
Exception and Error Handling
  • Centralized ABEND ( 9999-ABEND ) : Any unexpected database status code or system error routes processing to this paragraph.
  • Error Reporting : Before terminating, the program writes diagnostic information to the standard output, including:
  • The failed IMS operation status code ( DIBSTAT ).
  • The Account ID ( PA-ACCT-ID ) currently being processed.
  • The total number of records processed up to the point of failure.
  • Return Code : Sets the job step return code ( RETURN-CODE ) to 16 to signal a critical failure to the Job Control Language (JCL) controller, preventing subsequent job steps from executing.
Security and Authorization Checks

No explicit security checks (such as RACF calls or transaction authorization checks) are identified within this program. Security is assumed to be managed at the environment level via JCL execution authority and IMS database access control lists.

Performance Considerations
  • Get Next in Parent ( GNP ) : The program utilizes GNP rather than unqualified GN calls to retrieve child segments. This restricts database searching strictly to the twin chain of the current parent segment, minimizing database I/O.
  • Complemented Keys : The authorization date is stored in a complemented format ( 99999 - Date ). This is a standard mainframe design pattern that allows IMS to index and retrieve the most recent authorization records first (descending order) without requiring a database sort.
  • Dynamic Checkpoint Frequency : Database commits are managed dynamically via the P-CHKP-FREQ parameter. This allows database administrators to tune the commit frequency to balance lock retention times against checkpoint overhead based on the volume of data in the environment.

<h2

CBSTM03A

cbl/CBSTM03A.CBL
scanner784 code lines14 calls out0 called by4 copybooks2 files
MAT / Gemini

Account Statement Generator with Dual-Format Output

Account Statement Generator with Dual-Format Output

This batch program is a core utility within the card processing system designed to generate comprehensive account statements for credit card customers. Its primary business purpose is to aggregate financial data and produce statements in two distinct formats simultaneously: a traditional plain-text report suitable for legacy printing or archiving, and a structured HTML document designed for digital distribution, email delivery, or web-based customer portals.

To …

Full MAT analysis

Account Statement Generator with Dual-Format Output

This batch program is a core utility within the card processing system designed to generate comprehensive account statements for credit card customers. Its primary business purpose is to aggregate financial data and produce statements in two distinct formats simultaneously: a traditional plain-text report suitable for legacy printing or archiving, and a structured HTML document designed for digital distribution, email delivery, or web-based customer portals.

To compile these statements, the program orchestrates the retrieval of data from multiple foundational business entities. It interfaces with a centralized data access subroutine to sequentially process cardholder cross-reference records, which link credit cards to specific customer profiles and account identifiers. For each valid link, the program retrieves detailed customer demographics (such as names and addresses), credit risk metrics (like FICO scores), and account financial summaries (including current balances).

A key efficiency of this program is its handling of transaction history. Before generating individual statements, the program pre-loads and groups transaction records in memory by card number. As it processes each customer account, it performs an in-memory lookup to match and append the corresponding transaction ledger to the statement. It dynamically calculates the total expenditure for the billing cycle, formatting and writing this financial summary to both the text and HTML outputs.

In addition to its reporting duties, the program performs low-level system diagnostics. Upon startup, it queries mainframe system control blocks to identify and log the active job name and step execution details, ensuring operational traceability. This combination of system-level integration, structured in-memory data aggregation, and dual-format document generation makes the program a critical component for customer communications and a prime candidate for cloud-based document generation modernization.

Business Logic Overview

The CBSTM03A program is a batch COBOL application designed to generate account statements in two distinct formats: plain text ( STMT-FILE ) and HTML ( HTML-FILE ). The program integrates customer demographic data, account balances, credit scores, and transaction histories to produce comprehensive, customer-facing statements.

The program executes its business and system logic through the following phases:

System Diagnostics & Control Block Traversal

Before processing any business files, the program accesses low-level MVS system control blocks to perform environment diagnostics. Starting from the Prefixed Save Area (PSA) pointer, it navigates to the Task Control Block (TCB) and then to the Task Input/Output Table (TIOT). It extracts and displays the JCL Job Name and Step Name, then loops through the TIOT entries to identify active DD names and validate their associated Unit Control Blocks (UCBs).

State-Driven File Initialization

The program utilizes a state-machine pattern controlled by the variable WS-FL-DD and dynamic ALTER ... TO PROCEED TO statements to open its required files. It sequentially invokes the I/O subroutine CBSTM03B to open:

  • The Transaction File ( TRNXFILE )
  • The Cross-Reference File ( XREFFILE )
  • The Customer File ( CUSTFILE )
  • The Account File ( ACCTFILE )

In-Memory Transaction Caching

Immediately after opening the transaction file, the program reads all transaction records sequentially and loads them into a two-dimensional in-memory table ( WS-TRNX-TABLE ). This table groups transactions by card number, allowing up to 51 unique cards and up to 10 transactions per card. This caching mechanism eliminates the need for repetitive disk I/O during statement generation.

Sequential Statement Generation Loop

Once initialization and caching are complete, the program enters its main processing loop, reading the Card-to-Customer Cross-Reference File ( XREFFILE ) sequentially from beginning to end. For each cross-reference record retrieved:

  • Customer Lookup : The program performs a random, key-based read on the Customer File ( CUSTFILE ) using the Customer ID ( XREF-CUST-ID ) to retrieve the customer's name and address.
  • Account Lookup : It performs a random, key-based read on the Account File ( ACCTFILE ) using the Account ID ( XREF-ACCT-ID ) to retrieve the current balance.
  • Header Generation : It formats and writes the statement headers, customer address blocks, and basic account details (including the FICO score) to both the plain text and HTML output files.
  • Transaction Matching & Detail Writing : It searches the in-memory transaction cache for card numbers matching the current cross-reference card number ( XREF-CARD-NUM ). For every match found, it writes the individual transaction details (ID, description, and amount) to both output files and accumulates the transaction amounts into a running total.
  • Footer Generation : It writes the accumulated transaction total (Total Expenses) and the statement closing footers to both output files, completing the statement for that account.

Cleanup and Termination

After reaching the end of the cross-reference file, the program calls CBSTM03B to close all four input files, closes the two output statement files, and terminates execution.

Important Constants
  • WS-FL-DD State Constants :
  • 'TRNXFILE' : Initiates the opening of the transaction file.
  • 'XREFFILE' : Initiates the opening of the cross-reference file.
  • 'CUSTFILE' : Initiates the opening of the customer file.
  • 'ACCTFILE' : Initiates the opening of the account file.
  • 'READTRNX' : Triggers the sequential reading and caching of transaction records.
  • WS-M03B-OPER Subroutine Operations :
  • 'O' ( M03B-OPEN ): Open file.
  • 'C' ( M03B-CLOSE ): Close file.
  • 'R' ( M03B-READ ): Sequential read.
  • 'K' ( M03B-READ-K ): Random read by key.
  • HTML Template Markers ( HTML-FIXED-LN 88-levels) :
  • HTML-L01 through HTML-L80 : Predefined HTML tags, document structures, and inline CSS styles used to construct the HTML statement layout.
  • Array Dimensions :
  • Card Table Limit: 51 (Maximum number of unique cards cached in memory).
  • Transaction Table Limit: 10 (Maximum number of transactions cached per card).
Validation Logic

Prior to and during data processing, the program enforces several validation checks and status verifications:

  • Unit Control Block (UCB) Validation : During the startup diagnostic phase, the program inspects the UCB-ADDR field of each TIOT entry. If the address is equal to LOW-VALUES ( NULL-UCB ), it identifies and logs the entry as a null UCB; otherwise, it validates it as a active, valid UCB.
  • I/O Subroutine Return Code Verification : After every call to the centralized I/O module CBSTM03B , the program validates the returned status code ( WS-M03B-RC ):
  • File Open : Must return '00' (Success) or '04' (Success with warning/already open). Any other code triggers an immediate program abend.
  • Sequential Read : Must return '00' (Success) or '10' (End of File). Any other code triggers an abend.
  • Random Key Read : Must return '00' (Success). Any other code (such as '23' Record Not Found) triggers an abend.
  • Transaction Matching : During statement generation, the program validates that the card number associated with cached transactions ( WS-CARD-NUM ) exactly matches the card number from the active cross-reference record ( XREF-CARD-NUM ) before writing transaction lines.
Data Elements Processed

Input Elements (via Subroutine Buffers)

  • Cross-Reference Fields :
  • XREF-CARD-NUM : The 16-character card number used as the primary key to match transactions.
  • XREF-CUST-ID : The 9-digit customer identifier.
  • XREF-ACCT-ID : The 11-digit account identifier.
  • Customer Profile Fields :
  • CUST-FIRST-NAME , CUST-MIDDLE-NAME , CUST-LAST-NAME : Customer name components.
  • CUST-ADDR-LINE-1 , CUST-ADDR-LINE-2 , CUST-ADDR-LINE-3 : Customer street address lines.
  • CUST-ADDR-STATE-CD , CUST-ADDR-COUNTRY-CD , CUST-ADDR-ZIP : Customer regional address details.
  • CUST-FICO-CREDIT-SCORE : The 3-digit credit score.
  • Account Profile Fields :
  • ACCT-ID : The 11-digit account number.
  • ACCT-CURR-BAL : The current account balance (signed numeric S9(10)V99 ).
  • Transaction History Fields :
  • TRNX-CARD-NUM : The card number associated with the transaction.
  • TRNX-ID : The 16-character unique transaction identifier.
  • TRNX-DESC : The 100-character transaction description.
  • TRNX-AMT : The transaction amount (signed numeric S9(9)V99 ).

Transformed & Formatted Output Elements

  • ST-NAME : Formatted customer name, constructed by stringing together the first, middle, and last names delimited by spaces.
  • ST-ADD3 : Formatted city/state/zip line, constructed by stringing together address line 3, state code, country code, and zip code.
  • ST-CURR-BAL : Formatted account balance mapped to an edited mask ( 9(9).99- ).
  • ST-TRANAMT : Formatted individual transaction amount mapped to an edited mask ( Z(9).99- ).
  • ST-TOTAL-TRAMT : Formatted sum of all transaction amounts for the account, mapped to an edited mask ( Z(9).99- ).
  • HTML Output Records : Dynamic HTML strings constructed using STRING ... DELIMITED BY to embed customer names, addresses, account IDs, balances, and transaction details directly into HTML paragraph ( <p> ) and table row ( <tr> / <td> ) elements.
Exception and Error Handling
  • Subroutine Error Detection : The program does not handle file system errors directly. Instead, it relies on the return codes passed back from CBSTM03B in WS-M03B-RC .
  • Abnormal Program Termination (ABEND) : If any file operation (Open, Read, Key-Read, Close) returns an unexpected or unsuccessful status code, the program branches to the 9999-ABEND-PROGRAM paragraph. This paragraph:
  • Writes an error message to the standard display output indicating which file failed and the return code received.
  • Displays "ABENDING PROGRAM".
  • Calls the IBM Language Environment abend service CEE3ABD to terminate execution immediately and generate a system dump.
  • End-of-File Management : Sequential reads on the cross-reference file handle the '10' (EOF) status code gracefully by setting the END-OF-FILE switch to 'Y' , which terminates the mainline processing loop and initiates normal shutdown.
Security and Authorization Checks

No explicit security checks identified. The program does not perform any RACF, user authorization, or data masking checks. It assumes that the calling environment and dataset-level security rules govern access permissions.

Performance Considerations
  • In-Memory Caching of Transactions : Reading the entire transaction file sequentially at startup and caching it in the 2D array WS-TRNX-TABLE is a significant performance optimization. It avoids the high overhead of performing random VSAM reads or repeated sequential scans of the transaction file for every customer processed.
  • Array Boundary Vulnerability : The in-memory cache is statically dimensioned to support a maximum of 51 cards and 10 transactions per card. The program lacks boundary checks during the loading phase ( 8500-READTRNX-READ ). If the input transaction file contains more than 51 unique cards or more than 10 transactions for a single card, the program will experience index out-of-bounds conditions, leading to memory corruption or an execution failure.
  • Random Access for Master Data : The program utilizes random key-based access ( M03B-READ-K ) to retrieve customer and account records. This is highly efficient because it directly targets the required records using their unique identifiers, minimizing I/O operations compared to sequential scanning.

<h2

CBSTM03B

cbl/CBSTM03B.CBL
scanner162 code lines0 calls out13 called by0 copybooks4 files
MAT / Gemini

Centralized File I/O Handler for CardDemo Transaction Reporting

Centralized File I/O Handler for CardDemo Transaction Reporting

The CBSTM03B program is a specialized batch utility within the CardDemo application designed to centralize and standardize file access operations. Its primary business purpose is to act as a data access layer for transaction reporting processes, shielding calling programs from the complexities of direct file handling. By consolidating file operations into a single module, the application ensures consistent data retrieval and uniform error handling …

Full MAT analysis

Centralized File I/O Handler for CardDemo Transaction Reporting

The CBSTM03B program is a specialized batch utility within the CardDemo application designed to centralize and standardize file access operations. Its primary business purpose is to act as a data access layer for transaction reporting processes, shielding calling programs from the complexities of direct file handling. By consolidating file operations into a single module, the application ensures consistent data retrieval and uniform error handling across reporting workflows.

The program manages access to four critical data sources essential for generating transaction reports: transaction history, card-to-customer cross-references, customer profiles, and account details. Depending on the reporting requirements, the program accesses these files either sequentially—to process large volumes of transactions and cross-reference records—or randomly using specific lookup keys to retrieve individual customer and account details on demand.

To perform its tasks, the program receives instructions from a calling application specifying the target file, the requested operation, and any necessary search keys. It supports standard file operations, including opening files, closing files, reading records sequentially, and performing targeted lookups using unique identifiers like customer or account numbers. Once an operation is executed, the program returns the retrieved record data along with a standardized status code to indicate success or specific file conditions.

This modular architecture simplifies the development of business reports by allowing developers to focus on reporting logic rather than file management. It also provides a single point of maintenance, meaning any future changes to file structures, access methods, or storage technologies can be implemented within this single program without impacting the broader suite of reporting applications.

Business Logic Overview

The CBSTM03B program is a specialized, centralized batch COBOL I/O subroutine designed to manage file operations for four primary indexed files used in the CardDemo application's transaction reporting process. Instead of having the main reporting program perform direct file operations, it calls CBSTM03B and passes a control block ( LK-M03B-AREA ) containing the target file identifier, the requested operation, key information, and a data buffer.

The program acts as an I/O router. Upon invocation, it evaluates the requested DD name, routes the execution to the paragraph dedicated to that file, performs the requested operation (Open, Read, Read by Key, or Close), captures the resulting COBOL File Status, and returns control to the calling program.

The four files managed by this program are:

  • Transaction File ( TRNX-FILE ) : Accessed sequentially to read transaction records.
  • Cross-Reference File ( XREF-FILE ) : Accessed sequentially to read card-to-customer cross-reference records.
  • Customer File ( CUST-FILE ) : Accessed randomly to retrieve customer details using a specific Customer ID.
  • Account File ( ACCT-FILE ) : Accessed randomly to retrieve account details using a specific Account ID.
Important Constants

The program utilizes specific 88-level condition names defined in the Linkage Section to identify the requested file operations:

  • M03B-OPEN ( 'O' ) : Opens the designated file in INPUT mode.
  • M03B-CLOSE ( 'C' ) : Closes the designated file.
  • M03B-READ ( 'R' ) : Performs a sequential read on the designated file.
  • M03B-READ-K ( 'K' ) : Performs a random read on the designated file using a key.
  • M03B-WRITE ( 'W' ) : Defined for write operations (not implemented in the current Procedure Division).
  • M03B-REWRITE ( 'Z' ) : Defined for rewrite operations (not implemented in the current Procedure Division).

The program also evaluates specific DD name constants to route processing:

  • 'TRNXFILE' : Routes processing to the Transaction File paragraph.
  • 'XREFFILE' : Routes processing to the Cross-Reference File paragraph.
  • 'CUSTFILE' : Routes processing to the Customer File paragraph.
  • 'ACCTFILE' : Routes processing to the Account File paragraph.
Validation Logic

Before executing any file operations, the program performs the following validation and routing checks:

  • DD Name Validation : The program evaluates the input field LK-M03B-DD . If the value does not match one of the four supported constants ( 'TRNXFILE' , 'XREFFILE' , 'CUSTFILE' , or 'ACCTFILE' ), the program bypasses all processing and branches directly to 9999-GOBACK to exit.
  • Operation Code Validation : Within each file-specific paragraph, the program checks the operation code ( LK-M03B-OPER ) using the 88-level condition names. If an operation is requested that is not supported for that specific file (for example, requesting a sequential read 'R' on a randomly accessed file like CUSTFILE , or a key-based read 'K' on a sequentially accessed file like TRNXFILE ), the program bypasses the file operation entirely, moves the current file status to the return code, and exits.
  • Key Length Reference Modification : For key-based reads ( M03B-READ-K ), the program validates and extracts the key from the linkage buffer using reference modification: LK-M03B-KEY (1:LK-M03B-KEY-LN) . This ensures that only the active portion of the key buffer, as specified by the length parameter LK-M03B-KEY-LN , is moved to the file record key, preventing trailing spaces or garbage data from corrupting the search key.
Data Elements Processed

The program processes the following data elements passed via the LK-M03B-AREA linkage structure:

  • LK-M03B-DD (Input, PIC X(08)) : The DD name of the target file to be operated upon.
  • LK-M03B-OPER (Input, PIC X(01)) : The operation code indicating the action to perform (Open, Close, Read, Read-Key).
  • LK-M03B-RC (Output, PIC X(02)) : The 2-character return code returned to the caller, populated with the standard COBOL File Status.
  • LK-M03B-KEY (Input, PIC X(25)) : The key buffer containing the search key for random reads.
  • LK-M03B-KEY-LN (Input, S9(4) COMP) : The length of the active key within the key buffer.
  • LK-M03B-FLDT (Output, PIC X(1000)) : The data buffer where the retrieved file record is placed during a read operation.
  • FD-TRNXS-ID (Key, PIC X(32)) : The composite primary key for the Transaction File, consisting of:
  • FD-TRNX-CARD (PIC X(16))
  • FD-TRNX-ID (PIC X(16))
  • FD-XREF-CARD-NUM (Key, PIC X(16)) : The primary key for the Cross-Reference File.
  • FD-CUST-ID (Key, PIC X(09)) : The primary key for the Customer File.
  • FD-ACCT-ID (Key, PIC 9(11)) : The primary key for the Account File.
Exception and Error Handling
  • File Status Capture : The program does not use DECLARATIVES or explicit INVALID KEY / AT END clauses. Instead, it relies on standard COBOL File Status tracking. After every file operation, the 2-character file status variable ( TRNXFILE-STATUS , XREFFILE-STATUS , CUSTFILE-STATUS , or ACCTFILE-STATUS ) is captured and moved to the linkage return code field LK-M03B-RC .
  • Caller Responsibility : It is the responsibility of the calling program to inspect the returned LK-M03B-RC value to detect conditions such as:
  • '00' : Successful operation.
  • '10' : End of file (EOF) reached during sequential reads.
  • '23' : Record not found during key-based random reads.
  • Invalid DD Routing : If an invalid DD name is passed, the program exits immediately without modifying LK-M03B-RC , which may leave the return code in an undefined state or containing its previous value.
Security and Authorization Checks

No explicit security checks identified. The program does not perform any RACF, user authorization, or data masking checks. It assumes that the calling environment and dataset-level security rules (e.g., access control lists on the physical VSAM datasets) govern access permissions.

Performance Considerations
  • Access Mode Optimization :
  • TRNX-FILE and XREF-FILE are defined with ACCESS IS SEQUENTIAL . This is highly efficient for batch reporting runs that process the entire dataset from beginning to end.
  • CUST-FILE and ACCT-FILE are defined with ACCESS IS RANDOM . This is optimal for direct, single-record lookups using keys, avoiding the overhead of scanning the entire file.
  • Input-Only Mode : All files are opened exclusively as INPUT . This prevents lock contention on the VSAM datasets, allowing multiple concurrent batch jobs or online transactions to read the files simultaneously without performance degradation.
  • Reference Modification Overhead : The use of reference modification LK-M03B-KEY (1:LK-M03B-KEY-LN) is a CPU-efficient way to handle variable-length keys without requiring complex string parsing or padding loops.

<h2

CBTRN01C

cbl/CBTRN01C.cbl
scanner415 code lines1 calls out0 called by6 copybooks6 files
MAT / Gemini

Daily Transaction Validation and Account Verification Batch Process

Daily Transaction Validation and Account Verification Batch Process

The Daily Transaction Validation and Account Verification program is a vital batch processing component within the CardDemo credit card application. Its primary business purpose is to read, verify, and validate daily financial transactions against the system's master records. By ensuring that every transaction is linked to a legitimate card and account, the program acts as an essential quality control gatekeeper before any financial updates are …

Full MAT analysis

Daily Transaction Validation and Account Verification Batch Process

The Daily Transaction Validation and Account Verification program is a vital batch processing component within the CardDemo credit card application. Its primary business purpose is to read, verify, and validate daily financial transactions against the system's master records. By ensuring that every transaction is linked to a legitimate card and account, the program acts as an essential quality control gatekeeper before any financial updates are finalized.

During its execution, the program sequentially processes a file containing the day's transaction records. For each transaction, it extracts the card number used in the purchase and performs a lookup against a cross-reference database. This step is crucial for security and integrity, as it verifies that the card number exists and retrieves the associated customer and account identifiers.

After successfully linking the card to an account identifier, the program performs a secondary validation by querying the master account database. This step ensures that the account associated with the transaction is valid and active in the system. If the account lookup fails, the program logs an error indicating that the account could not be found, preventing unauthorized or orphaned transactions from proceeding.

The program features robust error handling and logging capabilities. If a card number cannot be verified in the cross-reference database, the transaction is skipped, and a warning is logged. Furthermore, the program closely monitors all file operations; any critical issues encountered while opening, reading, or closing files will trigger an immediate, controlled system shutdown to protect data integrity.

Functional Overview

CBTRN01C is a batch COBOL program within the CardDemo application. Its primary function is to read and validate daily transaction records from a sequential input file against indexed master files.

For each transaction record processed, the program performs the following operations:

  • Reads a transaction record sequentially from the daily transaction file.
  • Extracts the card number from the transaction and performs a random read (key lookup) on the Card Cross-Reference indexed file to retrieve the associated Account ID and Customer ID.
  • If the card number is successfully verified, the program uses the retrieved Account ID to perform a random read on the Account Master indexed file to verify the account's existence.
  • If any lookup fails, the program logs the failure to the system display and skips further processing for that transaction.
  • Although the program opens and closes the Customer Master, Card Master, and Transaction History files, it does not perform any read or write operations on them in this version.
Important Constants
  • APPL-AOK (Value 0 ) : Condition code indicating successful execution of a file operation.
  • APPL-EOF (Value 16 ) : Condition code indicating that the End-of-File has been reached on the sequential daily transaction file.
  • 12 : General error return code assigned to APPL-RESULT when a file I/O operation fails.
  • 4 : Status code assigned to WS-XREF-READ-STATUS or WS-ACCT-READ-STATUS indicating that a record was not found (Invalid Key) during an indexed file read.
  • 999 : The abnormal termination (ABEND) code passed to the IBM Language Environment service CEE3ABD .
Validation Logic

Before processing transaction data, the program performs several layers of validation:

  • File Status Validation : After every OPEN , CLOSE , and sequential READ operation, the program validates the file status. Only a status of '00' (or '10' for End-of-File on reads) is considered valid. Any other status code triggers an immediate program abend.
  • Card Number Verification : The program validates the transaction's card number ( DALYTRAN-CARD-NUM ) by attempting to retrieve its corresponding record from the XREF-FILE . If the key does not exist (triggering the INVALID KEY condition), the transaction is flagged as unverified and skipped.
  • Account ID Verification : The Account ID ( XREF-ACCT-ID ) retrieved from the cross-reference file is validated by attempting to read the ACCOUNT-FILE . If the account record does not exist, the program displays an "ACCOUNT NOT FOUND" warning.
Data Elements Processed
  • DALYTRAN-RECORD : The input sequential record containing daily transaction details. Key fields processed include:
  • DALYTRAN-ID : Unique transaction identifier.
  • DALYTRAN-CARD-NUM : The 16-character card number used to link the transaction to an account.
  • CARD-XREF-RECORD : The cross-reference record retrieved from XREF-FILE using DALYTRAN-CARD-NUM as the key. Key fields processed include:
  • XREF-CARD-NUM : The indexed lookup key.
  • XREF-ACCT-ID : The 11-digit account identifier used to retrieve account details.
  • XREF-CUST-ID : The 9-digit customer identifier.
  • ACCOUNT-RECORD : The account master record retrieved from ACCOUNT-FILE using XREF-ACCT-ID as the key.
  • ACCT-ID : The indexed lookup key.
  • IO-STATUS / IO-STATUS-04 : Working-storage fields used to capture, format, and display file status codes (including binary VSAM status codes) during error handling.
Exception and Error Handling
  • Indexed Record Not Found (Invalid Key) :
  • If a card number is not found in the XREF-FILE , the program displays: INVALID CARD NUMBER FOR XREF followed by CARD NUMBER [num] COULD NOT BE VERIFIED. SKIPPING TRANSACTION ID-[id] . It sets WS-XREF-READ-STATUS to 4 to gracefully bypass account validation for that record.
  • If an account is not found in the ACCOUNT-FILE , the program displays: INVALID ACCOUNT NUMBER FOUND followed by ACCOUNT [id] NOT FOUND . It sets WS-ACCT-READ-STATUS to 4 and continues processing the next transaction.
  • Critical I/O Failures : Any unexpected file status during OPEN , CLOSE , or sequential READ operations is treated as a critical failure. The program:
  • Displays a specific error message indicating which file operation failed.
  • Calls Z-DISPLAY-IO-STATUS to format and print the file status.
  • Calls Z-ABEND-PROGRAM , which invokes the IBM system utility CEE3ABD with abend code 999 to terminate execution and generate a dump.
  • Logic Bug in Close Error Handling : In paragraph 9000-DALYTRAN-CLOSE , if the close of DALYTRAN-FILE fails, the program incorrectly checks CUSTFILE-STATUS and displays "ERROR CLOSING CUSTOMER FILE" instead of checking DALYTRAN-STATUS and displaying a daily transaction file error.
Security and Authorization Checks

No explicit security checks identified. The program relies entirely on mainframe operating system-level security (such as RACF) to control dataset access permissions for the execution JCL.

Performance Considerations
  • Unused File Resources : The program opens and closes CUSTOMER-FILE , CARD-FILE , and TRANSACT-FILE in INPUT mode but never reads from them. This incurs unnecessary system overhead during job step initialization and termination, and unnecessarily holds shared locks on these VSAM datasets.
  • Random I/O Overhead : For every sequential transaction record read, the program performs up to two random reads (one on XREF-FILE and one on ACCOUNT-FILE ). In a high-volume production environment, this hybrid sequential-random processing pattern can cause significant I/O bottlenecks. Performance could be improved by ensuring appropriate VSAM buffer allocations (BUFND/BUFNI) are defined in the execution JCL.
  • Read-Only Processing : Since all files are opened as INPUT and no updates or writes are performed, there is no database modification or write activity. Consequently, checkpointing and commit frequencies are not required for data integrity.

<h2

CBTRN02C

cbl/CBTRN02C.cbl
scanner619 code lines1 calls out0 called by5 copybooks6 files
MAT / Gemini

Daily Credit Card Transaction Posting and Validation Batch Process

Daily Credit Card Transaction Posting and Validation Batch Process

This batch program is a core processing component of the CardDemo credit card application. Its primary business purpose is to process and post daily credit card transactions from an incoming sequential file into the system's master databases. By automating this daily reconciliation, the program ensures that customer account balances, transaction histories, and category-specific balances are kept accurate and up to date.

Before any transaction is …

Full MAT analysis

Daily Credit Card Transaction Posting and Validation Batch Process

This batch program is a core processing component of the CardDemo credit card application. Its primary business purpose is to process and post daily credit card transactions from an incoming sequential file into the system's master databases. By automating this daily reconciliation, the program ensures that customer account balances, transaction histories, and category-specific balances are kept accurate and up to date.

Before any transaction is posted, the program performs a series of critical business validations to protect the financial integrity of the system. It first cross-references the transaction's card number to identify the associated customer account. Once the account is identified, the program verifies that the account is active, checks that the transaction amount will not push the account over its assigned credit limit, and ensures the transaction date does not exceed the card's expiration date.

For transactions that pass all validation checks, the program performs real-time financial updates. It adjusts the customer's current account balance and updates the cycle's credit or debit totals depending on whether the transaction is a charge or a payment. Additionally, it updates or creates category-specific transaction balances (such as retail, travel, or cash advances) to track spending habits, and writes a permanent record of the approved transaction to the master transaction history file.

Transactions that fail validation are rejected and written to a daily rejects file, accompanied by a specific error code and description explaining the failure (such as an invalid card number, an expired card, or an over-limit transaction). Upon completing the file processing, the program displays summary statistics detailing the total number of transactions processed and rejected, and issues a warning return code if any rejected transactions require operational review.

Business Logic Overview

The CBTRN02C program is a batch COBOL program designed to process and post daily transaction records from a sequential input file ( DALYTRAN ) into the core system. The program performs validation checks against a card cross-reference file and an account master file.

For each valid transaction, the program:

  • Updates the transaction category balance file ( TCATBAL ).
  • Updates the account master file ( ACCOUNT ) with the transaction amount and cycle accumulators.
  • Writes the posted transaction to the master transaction file ( TRANSACT ).

If a transaction fails any validation check, it is rejected. The program writes the rejected transaction along with a validation trailer containing the error code and description to a sequential rejects file ( DALYREJS ).

Detailed Process Flow

Initialization :

  • Opens all required files:
  • DALYTRAN-FILE (Sequential Input)
  • TRANSACT-FILE (Indexed Output)
  • XREF-FILE (Indexed Input)
  • DALYREJS-FILE (Sequential Output)
  • ACCOUNT-FILE (Indexed I-O)
  • TCATBAL-FILE (Indexed I-O)
  • If any file fails to open successfully (status other than 00 ), the program displays an error message, formats the status, and terminates abnormally (ABEND).

Main Processing Loop :

  • Reads the DALYTRAN-FILE sequentially until the end of the file is reached.
  • For each record read:
  • Increments the total transaction counter ( WS-TRANSACTION-COUNT ).
  • Initializes the validation failure reason and description.
  • Executes the validation logic.
  • If Validation Succeeds :
  • Formats the transaction record and generates a DB2-style processing timestamp.
  • Updates the transaction category balance (either updates an existing record or creates a new one if it does not exist).
  • Updates the account master record's current balance and cycle credit/debit accumulators.
  • Writes the transaction record to the master transaction file.
  • If Validation Fails :
  • Increments the reject counter ( WS-REJECT-COUNT ).
  • Writes the original transaction data along with the validation failure reason and description to the rejects file.

Termination :

  • Closes all open files.
  • Displays the total number of transactions processed and rejected.
  • If any transactions were rejected during the run, the program sets the job step return code ( RETURN-CODE ) to 4 .
  • Terminates execution normally.
Important Constants
  • Validation Error Codes :
  • 100 : Invalid Card Number Found (Cross-reference lookup failed).
  • 101 : Account Record Not Found (Account lookup failed).
  • 102 : Overlimit Transaction (New balance exceeds the credit limit).
  • 103 : Transaction Received After Account Expiration (Transaction date is past the account expiration date).
  • 109 : Account Record Not Found during rewrite (Account update failed).
  • File Status Codes :
  • '00' : Successful I/O operation.
  • '10' : End of file reached.
  • '23' : Record not found (Key mismatch on indexed files).
  • Abend Code :
  • 999 : Passed to the IBM Language Environment abend service CEE3ABD during critical I/O failures.
Validation Logic

Before any transaction is posted, it must pass the following sequential validation checks:

Card Cross-Reference Lookup :

  • The program searches the XREF-FILE using the transaction's card number ( DALYTRAN-CARD-NUM ) as the key.
  • If the card number is not found (triggering an INVALID KEY condition), validation fails with error code 100 ("INVALID CARD NUMBER FOUND").

Account Master Lookup :

  • If the card is valid, the program retrieves the associated account ID ( XREF-ACCT-ID ) from the cross-reference record and searches the ACCOUNT-FILE .
  • If the account record is not found (triggering an INVALID KEY condition), validation fails with error code 101 ("ACCOUNT RECORD NOT FOUND").

Credit Limit Verification :

  • If the account is found, the program calculates a temporary balance:

$$\text{Temporary Balance} = \text{Current Cycle Credit} - \text{Current Cycle Debit} + \text{Transaction Amount}$$

  • If the calculated temporary balance exceeds the account's credit limit ( ACCT-CREDIT-LIMIT ), validation fails with error code 102 ("OVERLIMIT TRANSACTION").

Account Expiration Verification :

  • The program compares the account's expiration date ( ACCT-EXPIRAION-DATE ) with the transaction's origin date (extracted from the first 10 characters of DALYTRAN-ORIG-TS ).
  • If the transaction origin date is strictly greater than the account expiration date, validation fails with error code 103 ("TRANSACTION RECEIVED AFTER ACCT EXPIRATION").
Data Elements Processed

Input Transaction Fields ( DALYTRAN-RECORD ) :

  • DALYTRAN-ID : Unique transaction identifier.
  • DALYTRAN-CARD-NUM : Card number used for cross-reference lookup.
  • DALYTRAN-AMT : Signed numeric transaction amount.
  • DALYTRAN-TYPE-CD & DALYTRAN-CAT-CD : Transaction type and category codes used for balance tracking.
  • DALYTRAN-ORIG-TS : Timestamp of when the transaction originated.
  • Merchant details: DALYTRAN-MERCHANT-ID , DALYTRAN-MERCHANT-NAME , DALYTRAN-MERCHANT-CITY , and DALYTRAN-MERCHANT-ZIP .

Account Master Fields ( ACCOUNT-RECORD ) :

  • ACCT-ID : Unique account identifier.
  • ACCT-CREDIT-LIMIT : Maximum credit limit allowed.
  • ACCT-EXPIRAION-DATE : Expiration date of the account.
  • ACCT-CURR-BAL : Current outstanding balance.
  • ACCT-CURR-CYC-CREDIT : Accumulated credit amount for the current billing cycle.
  • ACCT-CURR-CYC-DEBIT : Accumulated debit amount for the current billing cycle.

Transaction Category Balance Fields ( TRAN-CAT-BAL-RECORD ) :

  • TRAN-CAT-KEY : Composite key consisting of Account ID, Transaction Type Code, and Transaction Category Code.
  • TRAN-CAT-BAL : Accumulated balance for this specific transaction category.

Output/Generated Fields :

  • TRAN-PROC-TS : Processing timestamp generated in DB2 format ( YYYY-MM-DD-HH.MM.SS.MIL0000 ).
  • WS-VALIDATION-FAIL-REASON & WS-VALIDATION-FAIL-REASON-DESC : Error details written to the rejects file trailer.
Exception and Error Handling

Critical File I/O Failures :

  • Every file operation (Open, Read, Write, Rewrite, Close) is monitored via its file status variable.
  • If an unexpected file status is returned (any status other than '00' , '10' for EOF, or '23' where handled), the program:
  • Displays a descriptive error message.
  • Formats the file status using 9910-DISPLAY-IO-STATUS (handling both standard and VSAM-specific status codes).
  • Calls 9999-ABEND-PROGRAM , which invokes the IBM system service CEE3ABD with abend code 999 to terminate the job step immediately.

Non-Critical Validation Failures :

  • Mismatches during random reads on XREF-FILE and ACCOUNT-FILE are handled gracefully via INVALID KEY clauses. Instead of crashing, the program flags the record as rejected, writes it to the rejects file, and continues processing the next transaction.

Account Update Failures :

  • If a rewrite operation on the ACCOUNT-FILE fails with an INVALID KEY condition, the program assigns error code 109 to the validation trailer but does not abend, allowing subsequent records to process.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations

Random I/O Bottlenecks :

  • The program processes the input file sequentially but performs multiple random reads and writes ( READ , WRITE , REWRITE ) against indexed VSAM files ( XREF-FILE , ACCOUNT-FILE , TCATBAL-FILE ) for every transaction. In high-volume environments, this pattern can cause significant I/O overhead.

Lack of Commit/Checkpointing :

  • The program does not implement database commits or checkpoint-restart logic. If an abend occurs mid-run, the indexed files will be left in a partially updated state. This requires restoring the files from backups or performing manual reconciliation before restarting the batch job.

<h2

CBTRN03C

cbl/CBTRN03C.cbl
scanner545 code lines1 calls out0 called by5 copybooks6 files
MAT / Gemini

Daily Transaction Detail Reporting and Reconciliation Program

Daily Transaction Detail Reporting and Reconciliation Program

The CBTRN03C program is a batch processing component of the CardDemo credit card management system. Its primary business purpose is to generate a structured, formatted Daily Transaction Report that details financial activities within a specified timeframe. This report serves as a critical tool for financial auditing, account reconciliation, and operational oversight.

To initiate the reporting process, the program reads a date parameter file to …

Full MAT analysis

Daily Transaction Detail Reporting and Reconciliation Program

The CBTRN03C program is a batch processing component of the CardDemo credit card management system. Its primary business purpose is to generate a structured, formatted Daily Transaction Report that details financial activities within a specified timeframe. This report serves as a critical tool for financial auditing, account reconciliation, and operational oversight.

To initiate the reporting process, the program reads a date parameter file to establish the start and end dates for the reporting window. It then sequentially processes the main transaction ledger, filtering out any transactions that fall outside this specified date range. This ensures that the resulting report is strictly focused on the requested accounting period.

For each transaction within the date range, the program performs automated lookups against multiple master reference files to enrich the raw transaction data. It translates the card number into the associated customer account identifier and retrieves descriptive, human-readable names for both the transaction type and the transaction category. This enrichment process converts raw system codes into clear, actionable business information for report readers.

The program formats the compiled data into a professional multi-page report. It groups transactions by cardholder account, automatically calculating and printing sub-totals when transitioning between different accounts. Additionally, the program manages page layouts by inserting standardized headers and calculating page-level totals at regular intervals, concluding the entire run with a grand total of all processed transaction amounts to ensure complete financial balancing.

Business Logic

The program CBTRN03C is a batch COBOL program designed to process a sequential transaction file and generate a formatted "Daily Transaction Report" ( TRANREPT ). The report includes transaction details, page-level totals, account-level totals (triggered by a control break on the card number), and a final grand total.

1. Initialization and Setup

  • File Operations : The program opens six files:
  • TRANSACT-FILE (Input, Sequential): Contains the transaction records to be processed.
  • REPORT-FILE (Output, Sequential): The destination for the formatted report.
  • XREF-FILE (Input, Indexed VSAM): Cross-reference file linking card numbers to account IDs.
  • TRANTYPE-FILE (Input, Indexed VSAM): Contains transaction type descriptions.
  • TRANCATG-FILE (Input, Indexed VSAM): Contains transaction category descriptions.
  • DATE-PARMS-FILE (Input, Sequential): Contains the start and end dates for filtering transactions.
  • Parameter Retrieval : The program reads a single record from the DATE-PARMS-FILE to populate WS-START-DATE and WS-END-DATE . If successful, it displays the reporting date range.

2. Main Processing Loop

The program reads the TRANSACT-FILE sequentially and processes each record within a loop until the end of the file ( END-OF-FILE = 'Y' ) is reached.

Date Filtering and Logical Flow :

  • For each transaction, the program extracts the first 10 characters of the processing timestamp ( TRAN-PROC-TS ).
  • It compares this date against the parameter range ( WS-START-DATE and WS-END-DATE ).
  • Logical Anomaly : If the transaction date is within the range, the program executes CONTINUE and proceeds. If the date is outside the range, it executes NEXT SENTENCE . In this program's structure, because there are no periods inside the PERFORM UNTIL loop, NEXT SENTENCE transfers control to the statement immediately following the next period (which is after END-PERFORM ). This causes the program to prematurely exit the processing loop and terminate as soon as any transaction falls outside the date range.

Control Break on Card Number :

  • The program tracks the card number of the current transaction using WS-CURR-CARD-NUM .
  • When the card number changes (and it is not the first record processed), an account control break is triggered:
  • The accumulated account total ( WS-ACCOUNT-TOTAL ) is formatted and written to the report.
  • The account total accumulator is reset to zero.
  • A separator line is written to the report.
  • The program then updates WS-CURR-CARD-NUM with the new transaction's card number and performs a random read on the XREF-FILE to retrieve the associated Account ID ( XREF-ACCT-ID ).

Master Data Lookups :

  • Transaction Type : The program uses TRAN-TYPE-CD to perform a random read on TRANTYPE-FILE to retrieve the transaction type description ( TRAN-TYPE-DESC ).
  • Transaction Category : The program constructs a composite key using TRAN-TYPE-CD and TRAN-CAT-CD to perform a random read on TRANCATG-FILE to retrieve the category description ( TRAN-CAT-TYPE-DESC ).

Report Formatting and Pagination :

  • First-Time Execution : On the very first detail record, the program writes the main report header (including the date range parameters) and sets WS-FIRST-TIME to 'N'.
  • Pagination : The program monitors the line count ( WS-LINE-COUNTER ) against the page size ( WS-PAGE-SIZE = 20) using a modulo operation ( FUNCTION MOD ). When the line limit is reached:
  • The current page total ( WS-PAGE-TOTAL ) is written to the report.
  • The page total is added to the grand total ( WS-GRAND-TOTAL ), and the page accumulator is reset to zero.
  • A new page header is written.
  • Accumulation : The transaction amount ( TRAN-AMT ) is added to both WS-PAGE-TOTAL and WS-ACCOUNT-TOTAL .
  • Detail Writing : The transaction details (ID, Account ID, Type, Category, Source, and Amount) are formatted into TRANSACTION-DETAIL-REPORT and written to the report file.

3. End-of-File Processing

When the sequential transaction file reaches EOF:

  • Logical Anomaly : The program enters the ELSE block of the EOF check. It displays the last transaction amount and page total, and adds TRAN-AMT (which is now invalid or contains stale data from the last record) to the page and account accumulators.
  • The final page totals are written to the report (which also adds the final page total to the grand total).
  • The final grand total ( WS-GRAND-TOTAL ) is formatted and written to the report.
  • All open files are closed, and the program terminates.
Important Constants
  • REPT-SHORT-NAME : 'DALYREPT' (The short identifier printed in the report header).
  • REPT-LONG-NAME : 'Daily Transaction Report' (The main title printed in the report header).
  • WS-PAGE-SIZE : 20 (The maximum number of detail lines printed per page before triggering a page break).
  • ABCODE : 999 (The abnormal termination code passed to the system dump routine).
Validation Logic
  • File Status Code Verification : After every file I/O operation (OPEN, READ, WRITE, CLOSE), the program evaluates the corresponding file status variable (e.g., TRANFILE-STATUS , CARDXREF-STATUS ).
  • A status of '00' indicates success.
  • For read operations, a status of '10' indicates End of File (EOF).
  • Any other status code is treated as a critical error, triggering an error message display, a formatted status dump, and an immediate program ABEND.
  • Date Range Validation : The program validates that the transaction processing date ( TRAN-PROC-TS positions 1-10) is chronologically greater than or equal to WS-START-DATE and less than or equal to WS-END-DATE .
  • Referential Integrity / Key Lookups :
  • Card Cross-Reference : The transaction card number ( TRAN-CARD-NUM ) is used as a key to read XREF-FILE . If the card number does not exist, the INVALID KEY routine is triggered, displaying an error message and abending the program.
  • Transaction Type : The transaction type code ( TRAN-TYPE-CD ) must exist in TRANTYPE-FILE . An invalid key triggers an immediate program ABEND.
  • Transaction Category : The composite key of type and category must exist in TRANCATG-FILE . An invalid key triggers an immediate program ABEND.
Data Elements Processed

Input Parameters

  • WS-START-DATE (PIC X(10)): The starting date of the reporting window.
  • WS-END-DATE (PIC X(10)): The ending date of the reporting window.

Transaction Record Fields

  • TRAN-ID (PIC X(16)): Unique identifier for the transaction.
  • TRAN-CARD-NUM (PIC X(16)): The card number used to perform the account lookup.
  • TRAN-TYPE-CD (PIC X(02)): Code representing the type of transaction.
  • TRAN-CAT-CD (PIC 9(04)): Code representing the category of transaction.
  • TRAN-SOURCE (PIC X(10)): The origin channel of the transaction.
  • TRAN-AMT (PIC S9(09)V99): The signed monetary value of the transaction.
  • TRAN-PROC-TS (PIC X(26)): The timestamp when the transaction was processed.

Lookup and Reference Fields

  • XREF-ACCT-ID (PIC 9(11)): The account number retrieved from the cross-reference file.
  • TRAN-TYPE-DESC (PIC X(50)): Text description of the transaction type.
  • TRAN-CAT-TYPE-DESC (PIC X(50)): Text description of the transaction category.

Accumulators and Counters

  • WS-LINE-COUNTER (PIC 9(09) COMP-3): Tracks the number of lines written to the current page.
  • WS-PAGE-TOTAL (PIC S9(09)V99): Accumulates transaction amounts for the current page.
  • WS-ACCOUNT-TOTAL (PIC S9(09)V99): Accumulates transaction amounts for the current card/account.
  • WS-GRAND-TOTAL (PIC S9(09)V99): Accumulates transaction amounts across the entire run.

Output Fields

  • FD-REPTFILE-REC (PIC X(133)): The 133-character output buffer written to the sequential report file.
Exception and Error Handling
  • I/O Error Detection : The program maps file status codes to a standardized application result ( APPL-RESULT ). If an operation fails (status other than '00' or '10' ), the program branches to error-handling routines.
  • ABEND Management : When a critical error is encountered (such as a file open failure, write failure, or an invalid key on a VSAM lookup), the program executes 9999-ABEND-PROGRAM :
  • It displays a specific error message indicating which file or operation failed.
  • It calls 9910-DISPLAY-IO-STATUS to format and display the exact file status. For VSAM files (status starting with '9'), it extracts and displays the binary sub-codes.
  • It calls the IBM Language Environment dump and abend service CEE3ABD using an abend code of 999 and a timing parameter of 0 to terminate execution immediately.
  • Invalid Key Handling : Random reads on indexed VSAM files utilize the INVALID KEY imperative statement. If a lookup key is missing from the index, the program displays the invalid key value, sets the status to '23' (Record not found), and triggers the standard ABEND routine.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • Indexed VSAM Lookups : The program performs random reads ( ACCESS MODE IS RANDOM ) on three indexed files ( XREF-FILE , TRANTYPE-FILE , and TRANCATG-FILE ) for each transaction. While random access is efficient for individual lookups, processing large volumes of transactions sequentially will result in high I/O overhead.
  • Control Break Optimization : The program optimizes cross-reference lookups by only querying the XREF-FILE when the card number changes ( WS-CURR-CARD-NUM NOT= TRAN-CARD-NUM ). If the input transaction file is pre-sorted by card number, this significantly reduces the number of VSAM read operations.
  • Packed Decimal Usage : Accumulators ( WS-LINE-COUNTER , WS-PAGE-SIZE ) are defined as COMP-3 (packed decimal), which optimizes arithmetic operations and decimal alignment on IBM Mainframe processors.

<h2

COACCT01

app-vsam-mq/cbl/COACCT01.cbl
scanner500 code lines9 calls out0 called by7 copybooks1 files
MAT / Gemini

Mainframe Account Inquiry Message Queue Processor

Mainframe Account Inquiry Message Queue Processor

This program serves as an asynchronous business service that processes account inquiry requests within a CICS mainframe environment. By interfacing with IBM MQ messaging middleware, the program acts as a bridge between external requesting applications and the core mainframe account database, enabling high-throughput, message-driven account data retrieval.

Upon invocation, the program retrieves its startup configuration from CICS to identify the triggering input …

Full MAT analysis

Mainframe Account Inquiry Message Queue Processor

This program serves as an asynchronous business service that processes account inquiry requests within a CICS mainframe environment. By interfacing with IBM MQ messaging middleware, the program acts as a bridge between external requesting applications and the core mainframe account database, enabling high-throughput, message-driven account data retrieval.

Upon invocation, the program retrieves its startup configuration from CICS to identify the triggering input queue. It establishes connections to three critical message queues: the input queue containing incoming requests, a reply queue for sending back account details, and a dedicated error queue for logging system and processing failures. Once the queues are successfully opened, the program enters a processing loop to handle all available messages.

For each request retrieved from the input queue, the program extracts the requested transaction function and the unique account identifier. It validates the request and queries the primary account data store to retrieve comprehensive account details. The retrieved information includes the account's active status, current balance, credit and cash limits, key lifecycle dates (such as open, expiration, and reissue dates), and current cycle financial balances.

After successfully retrieving the account record, the program formats a structured response message and posts it to the designated reply queue, ensuring the original message identifiers are preserved for request-response correlation. If the requested account is not found or if the input parameters are invalid, the program generates a descriptive error response and sends it back to the requester. Any unexpected system or queue manager errors are routed to the centralized error queue for administrative monitoring.

To maintain data consistency and operational reliability, the program utilizes transactional syncpoints to commit message consumption and database reads. The processing loop continues until a predefined wait interval expires with no new messages, at which point the program safely closes all open queues, releases system resources, and terminates cleanly.

Business Case and User Interaction Report: COACCT01

Business Case Overview

COACCT01 is a backend, message-driven CICS-MQ service program designed to handle Account Inquiry ( INQA ) requests. It acts as an integration middleware service within a mainframe modernization architecture (such as CardDemo).

Instead of interacting directly with an end-user via CICS BMS maps (screens), this program processes asynchronous or synchronous MQ messages sent by upstream client applications (such as web portals, mobile apps, or API gateways).

The program performs the following business functions:

  • Triggered Execution : Started automatically by CICS when a message arrives on the monitored input queue.
  • Message Retrieval : Reads request messages containing account inquiry parameters.
  • Data Retrieval : Queries a VSAM Key-Sequenced Data Set (KSDS) named ACCTDAT using the provided Account ID.
  • Response Formatting : Formats the retrieved account details into a structured, readable text layout.
  • Reply Delivery : Sends the formatted response back to the designated reply queue.
  • Error Logging : Routes any processing or system errors to a centralized error queue for monitoring and troubleshooting.
User Interaction and Interface Representation

Because COACCT01 is a non-interactive service program, there are no physical screens. Instead, the "user interaction" is defined by the input request message payload and the output reply message payload.

Request Message Format (Input)

The upstream system must send a text message of 1000 bytes containing:

  • Function Code (4 characters): Must be INQA .
  • Account ID (11 characters): The numeric key of the account to query.
Reply Message Format (Output)

When an account is successfully found, the program returns a formatted string containing labeled account details:

ACCOUNT ID : [11-digit ID] ACCOUNT STATUS : [Status] BALANCE : [Amount] CREDIT LIMIT : [Amount] CASH LIMIT : [Amount] OPEN DATE : [Date] EXPR DATE : [Date] REIS DATE : [Date] CREDIT BAL : [Amount] DEBIT BAL : [Amount] GROUP ID : [Group ID]

System Interaction and Data Flow Diagram

The following ASCII diagram illustrates how the client application, MQ queues, CICS, the COACCT01 program, and the VSAM database interact.

+---------------------------------------------------------------------------------+

| UPSTREAM SYSTEM |

+---------------------------------------------------------------------------------+

| ^

| 1. Send Request Message | 8. Receive Reply

v |

+-----------------------+ +------------------+

| MQ Input Queue | | MQ Reply Queue |

| (e.g. CARD.DEMO.INP) | | (Dynamic/Static) |

+-----------------------+ +------------------+

| ^

| 2. Trigger | 7. MQPUT

v | Reply

+-----------------------+ 3. Start +------------------+ |

| CICS Trigger Monitor | ---------------> | COBOL Program | -----------+

| (CKTI) | | COACCT01 |

+-----------------------+ +------------------+

| ^

4. MQGET | | 6. Read Success/

Request v | Not Found

+------------------+

| VSAM KSDS |

| File: ACCTDAT |

+------------------+

|

| (On System Error)

v

+------------------+

| MQ Error Queue |

| CARD.DEMO.ERROR |

+------------------+

Data Flow Description
  • Initiation : An upstream client puts a request message onto the MQ Input Queue.
  • Triggering : The CICS Trigger Monitor ( CKTI ) detects the message and triggers the execution of transaction COACCT01 .
  • Queue Retrieval : COACCT01 starts and executes EXEC CICS RETRIEVE to obtain the name of the queue that triggered it.
  • Queue Opening : The program opens the Input Queue, the Default Reply Queue ( CARD.DEMO.REPLY.ACCT ), and the Error Queue ( CARD.DEMO.ERROR ).
  • Message Processing Loop :
  • The program performs an MQGET to retrieve the request message.
  • It extracts the Function Code ( WS-FUNC ) and Account ID ( WS-KEY ).
  • It performs a random read ( EXEC CICS READ ) on the ACCTDAT VSAM file using the Account ID as the key.
  • If found, it maps the VSAM record fields to the formatted output structure ( WS-ACCT-RESPONSE ) and puts it on the reply queue via MQPUT .
  • If not found or if the input is invalid, it formats an error text response and puts it on the reply queue.
  • Commitment : An EXEC CICS SYNCPOINT is issued after processing each message to commit the MQ and VSAM operations.
  • Termination : The loop continues until no more messages are available on the input queue (after a 5-second wait timeout), at which point the program closes all queues and terminates.
User Navigation

Since this is an automated service, there is no manual user navigation. The "navigation" is transaction-driven:

  • Request Submission : The client application connects to MQ and submits an inquiry payload.
  • Processing : The client application waits synchronously or asynchronously on its designated reply queue (using the CorrelId or MsgId for correlation).
  • Response Consumption : The client application receives the formatted text response, parses it, and displays the data on the end-user's screen (web/mobile/terminal).
Important Constants

The following constants are defined and utilized within the program:

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-ACCTFILENAME | 'ACCTDAT ' | The DD name of the VSAM KSDS file containing account records. |

| REPLY-QUEUE-NAME | 'CARD.DEMO.REPLY.ACCT' | The default MQ queue name used for sending successful or validation-failed replies. |

| ERROR-QUEUE-NAME | 'CARD.DEMO.ERROR' | The MQ queue name used for routing system and application error descriptors. |

| WS-FUNC (Expected) | 'INQA' | The required transaction function code for Account Inquiry. |

| MQGMO-WAITINTERVAL | 5000 | The MQGET wait time-out interval in milliseconds (5 seconds). |

| MQ-BUFFER-LENGTH | 1000 | The standard buffer size allocated for MQ messages. |

Validation Logic

The program performs several layers of validation before processing the business logic:

  • CICS Retrieve Validation :
  • Checks if the CICS start/retrieve process succeeded ( WS-CICS-RESP1-CD = DFHRESP(NORMAL) ). If it fails, the program logs the error and terminates immediately.
  • Function Code Validation :
  • The input field WS-FUNC is checked. It must be exactly 'INQA' . If it is not, the request is rejected as invalid.
  • Key Validation :
  • The input field WS-KEY (Account ID) is checked. It must be greater than zero ( WS-KEY > ZEROES ). If it is zero or spaces, the request is rejected.
  • VSAM Record Existence Check :
  • When reading the ACCTDAT file, the program checks the CICS response code ( WS-RESP-CD ).
  • If DFHRESP(NORMAL) , validation succeeds and processing continues.
  • If DFHRESP(NOTFND) , the validation fails because the account does not exist.
Data Elements Processed
Input Request Fields
  • WS-FUNC : Function code requested (4 characters).
  • WS-KEY : Account ID key requested (11 digits).
Backend Database Fields (VSAM ACCOUNT-RECORD )
  • ACCT-ID : Unique account identifier (11 digits).
  • ACCT-ACTIVE-STATUS : Status of the account (1 character, e.g., Active/Inactive).
  • ACCT-CURR-BAL : Current balance of the account (Signed numeric, 10v92).
  • ACCT-CREDIT-LIMIT : Maximum credit limit (Signed numeric, 10v92).
  • ACCT-CASH-CREDIT-LIMIT : Cash advance limit (Signed numeric, 10v92).
  • ACCT-OPEN-DATE : Date the account was opened (10 characters).
  • ACCT-EXPIRAION-DATE : Expiration date of the account card (10 characters).
  • ACCT-REISSUE-DATE : Last reissue date of the card (10 characters).
  • ACCT-CURR-CYC-CREDIT : Total credits in the current cycle (Signed numeric, 10v92).
  • ACCT-CURR-CYC-DEBIT : Total debits in the current cycle (Signed numeric, 10v92).
  • ACCT-GROUP-ID : Group identifier associated with the account (10 characters).
Exception and Error Handling

The program features robust error handling designed to prevent message loss and report system failures:

1. Application-Level Errors (Returned to Reply Queue)

When a request fails validation or the account is not found, the program formats a descriptive error message and sends it back to the client via the Reply Queue :

  • Account Not Found :

INVALID REQUEST PARAMETERS ACCT ID : [WS-KEY]

  • Invalid Function/Parameters :

INVALID REQUEST PARAMETERS ACCT ID : [WS-KEY] FUNCTION : [WS-FUNC]

2. System-Level Errors (Routed to Error Queue)

If a severe system error occurs (such as an MQ call failure or a VSAM read error other than NOTFND ), the program:

  • Formats an error block ( MQ-ERR-DISPLAY ) containing:
  • The paragraph where the error occurred ( MQ-ERROR-PARA ).
  • A descriptive return message ( MQ-APPL-RETURN-MESSAGE ).
  • The MQ/CICS Condition Code ( MQ-APPL-CONDITION-CODE ).
  • The MQ/CICS Reason Code ( MQ-APPL-REASON-CODE ).
  • The target Queue Name ( MQ-APPL-QUEUE-NAME ).
  • Executes MQPUT to write this error block to the Error Queue ( CARD.DEMO.ERROR ).
  • Calls the termination routine ( 8000-TERMINATION ) to close open queues and exit.
3. CICS Response Codes Checked
  • DFHRESP(NORMAL) : Proceed with normal processing.
  • DFHRESP(NOTFND) : Handle gracefully by returning an "Invalid Request Parameters" message to the reply queue.
  • Other CICS Responses : Treated as severe system errors; routed to the error queue, followed by program termination.
Security and Authorization Checks
  • No explicit security checks identified within the source code.
  • There are no RACF calls ( EXEC SECURE or AUTH ), transaction security checks, or sign-on validations ( CESN / CESF ) implemented inside COACCT01 . Security is assumed to be managed externally at the CICS transaction definition level or via MQ queue access control lists (ACLs).
Performance Considerations
  • Syncpoint Control :

The program utilizes CICS Syncpoint ( EXEC CICS SYNCPOINT ) at the start of each message processing cycle ( 4000-MAIN-PROCESS ). This ensures that the MQ message consumption and any associated resource updates are committed safely under a single Unit of Work (UOW).

  • MQ Wait Interval :

The MQGET call uses a wait interval of 5000ms (5 seconds) with the MQGMO-WAIT option. This prevents the program from consuming CPU cycles in a tight loop when the queue is empty, allowing it to terminate gracefully when work is complete.

  • Shared Input Queue :

The input queue is opened with MQOO-INPUT-SHARED , allowing multiple instances of this program to run concurrently in CICS to handle high-volume message spikes.

  • Fail-If-Quiescing :

All MQ operations use the FAIL-IF-QUIESCING option, ensuring that the program shuts down cleanly if the MQ Queue Manager is shutting down.

<h2

COACTUPC

cbl/COACTUPC.cbl
scanner3368 code lines1 calls out0 called by54 copybooks7 filesyes dynamic dispatch
MAT / Gemini

Online Account and Customer Profile Update Management System

Online Account and Customer Profile Update Management System

The COACTUPC program is an interactive business-logic application designed to facilitate the secure retrieval, validation, and modification of credit card accounts and associated customer profiles. Operating within the CardDemo credit card processing suite, this program serves as a critical administrative tool that allows customer service representatives and credit managers to maintain up-to-date financial and personal data. By consolidating …

Full MAT analysis

Online Account and Customer Profile Update Management System

The COACTUPC program is an interactive business-logic application designed to facilitate the secure retrieval, validation, and modification of credit card accounts and associated customer profiles. Operating within the CardDemo credit card processing suite, this program serves as a critical administrative tool that allows customer service representatives and credit managers to maintain up-to-date financial and personal data. By consolidating account-level financial parameters and customer-level demographic details into a single operational flow, the program ensures data consistency across the enterprise's core databases.

When a user initiates an update, the program prompts for a unique eleven-digit account number. Upon entry, it performs a multi-file lookup, first querying a card cross-reference index to identify the associated customer ID and card number, and then retrieving the complete records from the Account Master and Customer Master databases. The system displays a comprehensive view of the current state, including credit limits, cash advance limits, outstanding balances, cycle credits/debits, and the customer's personal details such as name, address, phone numbers, Social Security Number, date of birth, and FICO credit score.

Before any modification is committed to the database, the program executes a rigorous suite of business and validation rules to protect data integrity. It verifies that financial limits are valid numeric amounts, ensures that dates (such as account opening, expiration, reissue, and birth dates) are calendar-compliant and logical, and validates that the customer's FICO score falls within the standard credit bureau range of 300 to 850. Furthermore, it performs regional checks, such as verifying that the state code is valid and matches the first digits of the provided ZIP code, and ensures that phone numbers and Social Security Numbers conform to standard North American formats.

To prevent data conflicts in a high-volume, multi-user environment, the program implements a secure double-lock update process with optimistic concurrency control. Once the user reviews and confirms the validated changes, the program temporarily locks both the account and customer records for update. It then compares the database's current state with the original values fetched at the start of the session; if another user has modified the records in the interim, the transaction is safely aborted to prevent overwriting. If the records are unchanged, the program rewrites both files in a coordinated transaction, rolling back changes if either update fails.

The program is designed to support seamless navigation and session preservation within the larger CardDemo ecosystem. It integrates directly with the application's main menu and other card management modules, passing critical session metadata—such as user identity, security roles, and transaction history—via a shared communication area. This pseudo-conversational design ensures that mainframe system resources are released while waiting for user input, optimizing system performance and supporting high concurrent user activity.

Business Case and User Interaction

Business Case Overview

The COACTUPC program is a core business logic and presentation controller within the CardDemo application. It provides online terminal users with the ability to search, retrieve, validate, and update comprehensive Account and Customer Master records.

By integrating data from three distinct files—the Card Cross-Reference file ( CXACAIX ), the Account Master file ( ACCTDAT ), and the Customer Master file ( CUSTDAT )—the program presents a unified view of a customer's financial account limits, status, and personal demographic details.

The primary business objectives of this program are:

  • Data Integrity : Enforcing strict validation rules on all editable fields (such as credit limits, dates, Social Security Numbers, FICO scores, and address details) before committing changes.
  • Concurrency Control : Implementing optimistic locking checks to ensure that no two operators overwrite each other's changes simultaneously.
  • User-Friendly Workflow : Guiding the operator through a multi-stage process of searching, editing, reviewing, and confirming updates.
User Interaction and Screen Flow
1. Search Stage (Initial Entry)
  • Action : The user enters the program (either directly or via the Main Menu COMEN01C ).
  • Screen State : All detail fields are protected and blank. Only the Account ID search field is unprotected and ready for input.
  • User Input : The user types an 11-digit Account ID and presses ENTER .
  • System Response :
  • The program reads the Card Cross-Reference file using the Account ID to find the associated Customer ID and Card Number.
  • It then retrieves the corresponding records from the Account Master and Customer Master files.
  • If found, the screen is populated with the retrieved data, detail fields are unprotected for editing, and the program prompts: "Update account details presented above."
  • If not found, an appropriate error message is displayed in red at the bottom of the screen.
2. Edit and Validation Stage
  • Action : The user modifies any of the unprotected fields (e.g., changing the Credit Limit, updating an address, or correcting a phone number).
  • User Input : The user presses ENTER to submit the changes.
  • System Response :
  • The program compares the new screen inputs against the originally fetched values.
  • If no changes are detected, it displays: "No change detected with respect to values fetched."
  • If changes are detected, it performs extensive validation on every modified field.
  • Validation Failure : If any field fails validation, the program marks the field in error, changes its attribute to red, positions the cursor at the first invalid field, and displays a specific error message.
  • Validation Success : If all fields pass validation, the program transitions to a "pending confirmation" state, protects the input fields, and prompts: "Changes validated. Press F5 to save" .
3. Confirmation and Commit Stage
  • Action : The user reviews the validated changes.
  • User Input :
  • Press PF5 to confirm and save.
  • Press PF12 to cancel and revert to the original values.
  • System Response (PF5 - Save) :
  • The program re-reads both the Account and Customer records with an update lock ( READ UPDATE ).
  • It performs a concurrency check to verify that the records have not been modified by another transaction since they were initially fetched.
  • If the records are unchanged, the program rewrites both files, commits the transaction, clears the screen, and displays: "Changes committed to database" .
  • If a concurrency conflict is detected, the update is aborted, and the user is prompted to review the updated record.
  • System Response (PF12 - Cancel) :
  • The program discards the pending changes, re-reads the original records from the database, and redisplays them.
4. Exit Stage
  • User Input : The user presses PF3 at any time.
  • System Response : The program performs a CICS syncpoint and transfers control ( EXEC CICS XCTL ) back to the calling program or the Main Menu ( COMEN01C ).

Screen Layout and Flow Diagrams

Screen Layout (CACTUPA)

+-----------------------------------------------------------------------------+

| Tran: CAUP AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COACTUPC CardDemo Time: HH:MM:SS |

| |

| UPDATE ACCOUNT & CUSTOMER DETAILS |

| |

| Account ID: [12345678901] Account Status: [Y] |

| Open Date : [2020]-[01]-[15] Credit Limit : [$ 10,000.00] |

| Exp Date : [2025]-[01]-[15] Cash Limit : [$ 2,000.00] |

| Reissue Dt: [2020]-[01]-[15] Group ID : [GROUP01 ] |

| Curr Bal : [$ 50.00] Cycle Credit : [$ 0.00] |

| Cycle Deb : [$ 50.00] |

| --------------------------------------------------------------------------- |

| Cust ID : 000000123 SSN : [123]-[45]-[6789] |

| First Name: [JOHN ] Middle Name : [ALAN ]

| Last Name : [DOE ] DOB : [1980]-[05]-[20] |

| FICO Score: [750] Govt ID : [AB123456C ]|

| Address L1: [123 MAIN STREET ]|

| Address L2: [APARTMENT 4B ]|

| City : [NEW YORK ]|

| State : [NY] Zip Code : [10001] |

| Country : USA EFT Acct ID : [1234567890] |

| Phone 1 : ([212])-[555]-[1234] Phone 2 : ([ ])-[ ]-[ ] |

| Pri Holder: [Y] |

| |

| Info: <WS-INFO-MSG: Prompt messages appear here > |

| Error: <WS-RETURN-MSG: Validation/System errors appear here in red > |

| |

| ENTER=Validate F5=Save F12=Cancel F3=Exit |

+-----------------------------------------------------------------------------+

Screen Navigation and State Transitions

+------------------------+

| Start / Main Menu |

| (COMEN01C) |

+-----------+------------+

|

| (Select Option 2 / Tran: CAUP)

v

+------------------------+

| State: NOT FETCHED | <----------------------------+

| - Prompt for Acct ID | |

+-----------+------------+ |

| |

| (Enter Acct ID & Press ENTER) |

v |

+------------------------+ |

| State: SHOW DETAILS | |

| - Display fetched data | |

+-----------+------------+ |

| |

| (Modify Fields & Press ENTER) |

v |

/----------------------\ |

/ Are Changes Valid? \ |

\ / |

\----------+-----------/ |

| |

No | Yes |

+-------------------------+-------------------------+ |

| | |

v v |

+------------------------+ +------------------------+ |

| State: CHANGES NOT OK | | State: OK NOT CONFIRMED| |

| - Highlight errors | | - Prompt PF5 to Save | |

| - Redisplay screen | +------------+-----------+ |

+-----------+------------+ | |

| | |

| (Re-edit & Press ENTER) | |

+---------------------------------------------------|-(PF12) |

| |

| (PF5) |

v |

+------------------------+ |

| State: OKAYED & DONE | |

| - Commit to Database | |

| - Clear Screen | |

+------------+-----------+ |

| |

+-------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COACTUPC' | Program ID of this module |

| LIT-THISTRANID | 'CAUP' | CICS Transaction ID for Account Update |

| LIT-THISMAPSET | 'COACTUP ' | BMS Mapset name |

| LIT-THISMAP | 'CACTUPA' | BMS Map name |

| LIT-MENUPGM | 'COMEN01C' | Program ID of the Main Menu |

| LIT-MENUTRANID | 'CM00' | CICS Transaction ID of the Main Menu |

| LIT-ACCTFILENAME | 'ACCTDAT ' | Account Master VSAM KSDS dataset name |

| LIT-CUSTFILENAME | 'CUSTDAT ' | Customer Master VSAM KSDS dataset name |

| LIT-CARDXREFNAME-ACCT-PATH | 'CXACAIX ' | Card Cross-Reference Alternate Index Path |

| DFHBMFSE | CICS Constant | Attribute byte: Unprotected, Normal Intensity, MDT On |

| DFHBMPRF | CICS Constant | Attribute byte: Protected, Normal Intensity |

| DFHRED | CICS Constant | Color attribute: Red |

| DFHGREEN | CICS Constant | Color attribute: Green |

| DFHBMASB | CICS Constant | Attribute byte: Bright Intensity |

| DFHBMDAR | CICS Constant | Attribute byte: Dark/Invisible |

Validation Logic

Input Field Validations
Account ID ( ACCTSIDI )
  • Mandatory : Must be supplied. Cannot be spaces, low-values, or asterisks ( * ).
  • Format : Must be strictly numeric and exactly 11 digits.
  • Value : Must be a non-zero positive number.
Account Status ( ACSTTUSI )
  • Mandatory : Must be supplied.
  • Value : Must be exactly 'Y' (Active) or 'N' (Inactive).
Financial Amounts (Credit Limit, Cash Limit, Current Balance, Cycle Credit, Cycle Debit)
  • Mandatory : Must be supplied.
  • Format : Must be a valid signed numeric format. Checked using FUNCTION TEST-NUMVAL-C .
  • Conversion : Converted to numeric using FUNCTION NUMVAL-C before database storage.
Dates (Open Date, Expiry Date, Reissue Date, Date of Birth)
  • Mandatory : Year, Month, and Day components must be supplied.
  • Year Validation :
  • Must be a 4-digit numeric value.
  • Century must be 19 or 20 .
  • Month Validation : Must be numeric and between 1 and 12 .
  • Day Validation :
  • Must be numeric and between 1 and 31 .
  • Cannot be 31 for 30-day months (April, June, September, November).
  • Cannot be 30 or 31 for February.
  • Leap Year Check: For February 29th, the year must be divisible by 4 (or 400 for century years).
  • Logical Checks :
  • Date of Birth : Must be in the past. Verified by comparing the Lilian date of birth against the current system date.
  • System Validation : All dates are passed to the utility program CSUTLDTC for final calendar validation.
Social Security Number ( ACTSSN1I , ACTSSN2I , ACTSSN3I )
  • Mandatory : All three parts must be supplied.
  • Format : Must be numeric (Part 1: 3 digits, Part 2: 2 digits, Part 3: 4 digits).
  • Part 1 Restrictions : Cannot be 000 , 666 , or in the range 900 through 999 .
FICO Score ( ACSTFCOI )
  • Mandatory : Must be supplied.
  • Format : Must be a 3-digit numeric value.
  • Range : Must be between 300 and 850 inclusive.
Customer Names (First Name, Last Name, Middle Name)
  • Mandatory : First Name and Last Name are mandatory. Middle Name is optional.
  • Format : Must contain only alphabetic characters ( A-Z , a-z ) and spaces.
Address Fields (Address Line 1, City, State, Zip Code, Country)
  • Address Line 1 : Mandatory. Cannot be blank.
  • City : Mandatory. Must contain only alphabetic characters and spaces.
  • State : Mandatory. Must be a valid 2-character US State code (validated against a list of 56 valid codes, e.g., AL , NY , WY ).
  • Zip Code : Mandatory. Must be a 5-digit numeric value.
  • Country : Mandatory. Must be a 3-character alphabetic value (typically USA ).
Phone Numbers (Phone 1 and Phone 2)
  • Optional : Phone numbers are not mandatory.
  • Format : If any part of a phone number is entered, all parts (Area Code, Prefix, Line Number) must be supplied.
  • Area Code : Must be a 3-digit numeric value. Must be a valid North American Numbering Plan (NANPA) general-purpose area code.
  • Prefix : Must be a 3-digit numeric value greater than zero.
  • Line Number : Must be a 4-digit numeric value greater than zero.
EFT Account ID ( ACSEFTCI )
  • Mandatory : Must be supplied.
  • Format : Must be a 10-digit numeric value. Cannot be zero.
Primary Card Holder Indicator ( ACSPFLGI )
  • Mandatory : Must be supplied.
  • Value : Must be exactly 'Y' or 'N' .
Screen-Level and Cross-Field Validations
State and Zip Code Combination
  • The program performs a cross-field validation check by concatenating the 2-character State code with the first 2 digits of the Zip Code.
  • This 4-character combination is validated against a predefined list of valid US State/Zip prefix combinations (e.g., NY10 , CA90 , FL32 ). If the combination is invalid, both fields are flagged in error.
Attention Identifier (AID) Key Validation
  • Valid Keys : ENTER , PF3 (Exit), PF5 (Save - only when changes are validated), and PF12 (Cancel - only when details are fetched).
  • Invalid Keys : Any other key press is intercepted, treated as an invalid key, and defaults to redisplaying the screen with an error message.

Data Elements Processed

Screen Map Fields ( CACTUPAI / CACTUPAO )

| Map Field Name | Type | Length | Description |

| :--- | :--- | :--- | :--- |

| ACCTSIDI / ACCTSIDO | Alphanumeric | 11 | Account ID (Search Key) |

| ACSTTUSI / ACSTTUSO | Alphanumeric | 1 | Account Active Status ( Y / N ) |

| OPNYEARI / OPNMONI / OPNDAYI | Alphanumeric | 4 / 2 / 2 | Account Open Date (CCYY-MM-DD) |

| ACRDLIMI / ACRDLIMO | Alphanumeric | 15 | Credit Limit (Formatted Currency) |

| EXPYEARI / EXPMONI / EXPDAYI | Alphanumeric | 4 / 2 / 2 | Account Expiration Date (CCYY-MM-DD) |

| ACSHLIMI / ACSHLIMO | Alphanumeric | 15 | Cash Credit Limit (Formatted Currency) |

| RISYEARI / RISMONI / RISDAYI | Alphanumeric | 4 / 2 / 2 | Account Reissue Date (CCYY-MM-DD) |

| ACURBALI / ACURBALO | Alphanumeric | 15 | Current Balance (Formatted Currency) |

| ACRCYCRI / ACRCYCRO | Alphanumeric | 15 | Current Cycle Credit Limit (Formatted Currency) |

| ACRCYDBI / ACRCYDBO | Alphanumeric | 15 | Current Cycle Debit Limit (Formatted Currency) |

| AADDGRPI / AADDGRPO | Alphanumeric | 10 | Account Group ID |

| ACSTNUMI / ACSTNUMO | Alphanumeric | 9 | Customer ID (Protected) |

| ACTSSN1I / ACTSSN2I / ACTSSN3I | Alphanumeric | 3 / 2 / 4 | Customer Social Security Number |

| DOBYEARI / DOBMONI / DOBDAYI | Alphanumeric | 4 / 2 / 2 | Customer Date of Birth (CCYY-MM-DD) |

| ACSTFCOI / ACSTFCOO | Alphanumeric | 3 | Customer FICO Credit Score |

| ACSFNAMI / ACSFNAMO | Alphanumeric | 25 | Customer First Name |

| ACSMNAMI / ACSMNAMO | Alphanumeric | 25 | Customer Middle Name |

| ACSLNAMI / ACSLNAMO | Alphanumeric | 25 | Customer Last Name |

| ACSADL1I / ACSADL1O | Alphanumeric | 50 | Customer Address Line 1 |

| ACSADL2I / ACSADL2O | Alphanumeric | 50 | Customer Address Line 2 |

| ACSCITYI / ACSCITYO | Alphanumeric | 50 | Customer City (Address Line 3) |

| ACSSTTEI / ACSSTTEO | Alphanumeric | 2 | Customer State Code |

| ACSZIPCI / ACSZIPCO | Alphanumeric | 5 | Customer Zip Code |

| ACSCTRYI / ACSCTRYO | Alphanumeric | 3 | Customer Country Code |

| ACSPH1AI / ACSPH1BI / ACSPH1CI | Alphanumeric | 3 / 3 / 4 | Customer Phone Number 1 |

| ACSPH2AI / ACSPH2BI / ACSPH2CI | Alphanumeric | 3 / 3 / 4 | Customer Phone Number 2 |

| ACSGOVTI / ACSGOVTO | Alphanumeric | 20 | Customer Government Issued ID |

| ACSEFTCI / ACSEFTCO | Alphanumeric | 10 | Customer EFT Account ID |

| ACSPFLGI / ACSPFLGO | Alphanumeric | 1 | Primary Card Holder Indicator ( Y / N ) |

| INFOMSGO | Alphanumeric | 45 | Informational Prompt Message |

| ERRMSGO | Alphanumeric | 78 | Error Message (Displayed in Red) |

Backend and Control Fields

| Field Name | Type | Length/Format | Description |

| :--- | :--- | :--- | :--- |

| CDEMO-ACCT-ID | Numeric | 9(11) | Account ID passed in CARDDEMO-COMMAREA |

| CDEMO-CUST-ID | Numeric | 9(09) | Customer ID passed in CARDDEMO-COMMAREA |

| ACCT-UPDATE-RECORD | Group | 300 bytes | Layout used to rewrite the Account Master file |

| CUST-UPDATE-RECORD | Group | 500 bytes | Layout used to rewrite the Customer Master file |

| ACUP-OLD-DETAILS | Group | Variable | Storage area for original values used in concurrency checks |

| ACUP-NEW-DETAILS | Group | Variable | Storage area for modified screen values during validation |

Exception and Error Handling

CICS Command Exception Handling

The program utilizes inline response checking ( RESP and RESP2 options) for all file control commands to handle exceptions gracefully without abending the CICS region.

EXEC CICS READ (Card Xref, Account Master, Customer Master)
  • DFHRESP(NORMAL) : Execution continues normally.
  • DFHRESP(NOTFND) :
  • If the Account ID is not found in the Card Xref file, the program flags the field in error and displays: "Account: [ID] not found in Cross ref file."
  • If the Account ID is not found in the Account Master, it displays: "Account: [ID] not found in Acct Master file."
  • If the Customer ID is not found in the Customer Master, it displays: "CustId: [ID] not found in customer master."
  • Other Responses : Any other database error (e.g., IOERR , DISABLED ) is formatted into a standard file error message containing the operation name, file name, RESP , and RESP2 codes, and displayed to the user.
EXEC CICS READ UPDATE (Locking for Rewrite)
  • If the program cannot lock the Account record, it sets the error flag and displays: "Could not lock account record for update" .
  • If it cannot lock the Customer record, it displays: "Could not lock customer record for update" .
  • In both cases, the update transaction is aborted, and no data is written.
EXEC CICS REWRITE (Commit Phase)
  • If the Account rewrite fails, the program aborts and displays: "Update of record failed" .
  • If the Customer rewrite fails after a successful Account rewrite, the program executes an explicit rollback command:

EXEC CICS SYNCPOINT ROLLBACK END-EXEC

This ensures database consistency by reverting the Account update, preventing orphaned or mismatched records.

Concurrency Conflict (Optimistic Locking)

Before performing any database writes, the program compares the current state of the records on disk with the original values fetched at the start of the user's session ( 9700-CHECK-CHANGE-IN-REC ).

  • Trigger : If any field in the Account Master or Customer Master record on disk does not match the original values stored in ACUP-OLD-DETAILS .
  • Handling : The program aborts the update, rolls back any locks, and displays: "Record changed by some one else. Please review" . This prevents the current operator from accidentally overwriting changes made by another user in the interim.
Global Abend Handling

The program registers a global abend handler at entry:

EXEC CICS HANDLE ABEND LABEL(ABEND-ROUTINE) END-EXEC

  • Trigger : Any unhandled CICS exception or program abend.
  • Handling :
  • The program intercepts the abend and transfers control to ABEND-ROUTINE .
  • It populates ABEND-DATA with the program name ( COACTUPC ) and a default message: "UNEXPECTED ABEND OCCURRED."
  • It sends this error screen to the terminal, cancels the active abend handler to prevent loops, and terminates the transaction with abend code '9999' .

Security and Authorization Checks

  • No Explicit External Security : The program does not directly interface with external security managers such as IBM RACF, nor does it execute standard CICS Sign-on ( CESN / CESF ) commands.
  • Application-Managed Session Context : Security is managed entirely at the application level via the shared communication area ( CARDDEMO-COMMAREA ). The program verifies that a valid user session exists by checking that CDEMO-USER-ID is populated and that the transaction context is preserved across pseudo-conversational boundaries.

Performance Considerations

Pseudo-Conversational Design

The program is strictly designed as a pseudo-conversational transaction. It does not remain active in memory or hold database locks while waiting for user terminal input.

  • After sending a map to the screen, it releases all resources and terminates using:

EXEC CICS RETURN TRANSID('CAUP') COMMAREA(WS-COMMAREA) END-EXEC

  • The entire state of the transaction (including original and modified record details) is saved in the COMMAREA and passed back to CICS, ensuring high concurrency and minimal memory footprint on the mainframe.
Optimistic Locking vs. Pessimistic Locking
  • To maximize throughput and minimize lock contention on the VSAM datasets, the program does not hold locks on records while the user is editing them on the screen.
  • Instead, it reads the records without locks, allows the user to make changes, and only acquires exclusive update locks ( READ UPDATE ) for a fraction of a second during the final commit phase. This pattern significantly reduces database deadlocks in high-volume environments.
Dynamic Program Calls
  • The program dynamically calls the date validation utility CSUTLDTC using:

CALL 'CSUTLDTC' USING ...

  • While dynamic calls introduce a minor CPU overhead compared to static linking, they allow the date validation logic to be centrally maintained and updated without requiring the recompilation of COACTUPC .

<h2

COACTVWC

cbl/COACTVWC.cbl
scanner703 code lines1 calls out0 called by14 copybooks3 filesyes dynamic dispatch
MAT / Gemini

CardDemo Account View Inquiry Program

CardDemo Account View Inquiry Program

The CardDemo Account View Inquiry Program is a core business service designed to provide customer service representatives and authorized personnel with a comprehensive, read-only view of credit card accounts. By entering a specific account number, users can instantly access critical financial metrics and customer demographics. This program plays a vital role in daily operations, enabling staff to quickly resolve customer inquiries, verify account statuses, and review credit …

Full MAT analysis

CardDemo Account View Inquiry Program

The CardDemo Account View Inquiry Program is a core business service designed to provide customer service representatives and authorized personnel with a comprehensive, read-only view of credit card accounts. By entering a specific account number, users can instantly access critical financial metrics and customer demographics. This program plays a vital role in daily operations, enabling staff to quickly resolve customer inquiries, verify account statuses, and review credit limits.

When interacting with the system, the user is presented with a clean, structured interface where they can input an 11-digit account number. The program immediately validates this input to ensure it is formatted correctly. Once verified, the screen dynamically populates with detailed account information, including active status, current balance, credit and cash limits, open and expiration dates, and recent cycle activity.

Behind the scenes, the program coordinates a multi-step data retrieval process across several core databases. It first accesses a cross-reference registry to link the account number to its associated customer ID and card number. Using these identifiers, it simultaneously queries the account master database for financial details and the customer master database to retrieve personal information, such as the cardholder's full name, address, masked Social Security Number, and FICO credit score.

This program is fully integrated into the CardDemo application's navigation flow. It is typically invoked from the main menu and allows users to seamlessly return to their previous context or the main menu by pressing a designated exit key. Throughout this process, the program securely preserves the user's session context, ensuring that security roles and transaction histories are maintained as they navigate between different modules.

To ensure high performance and a smooth user experience, the program features robust error handling and an optimized design. If an account is not found or if database errors occur, the system displays clear, color-coded feedback directly on the screen rather than interrupting the user session. Additionally, its efficient design releases system resources while waiting for user input, allowing the mainframe to support a high volume of concurrent customer service inquiries.

Business Case and User Interaction

Business Case Overview

The COACTVWC program is a core business logic and presentation component of the CardDemo application. Its primary business purpose is to provide customer service representatives, credit officers, and back-office administrators with a comprehensive, read-only view of a specific credit card account and its associated customer details.

By entering a single 11-digit Account ID, the program orchestrates the retrieval of data across three distinct physical data stores:

  • Cross-Reference Store ( CXACAIX ) : Maps the Account ID to its associated Customer ID and Card Number.
  • Account Master Store ( ACCTDAT ) : Retrieves financial metrics, credit limits, balances, and account lifecycle dates.
  • Customer Master Store ( CUSTDAT ) : Retrieves personal demographic details, contact information, government identifiers, and credit scores.

This consolidated view enables rapid inquiry handling, credit assessment, and customer verification from a single interface.

User Interaction and Screen Flow
  • Inquiry Initiation : The user navigates to the Account View screen (typically via Option 1 on the Main Menu, COMEN01C ).
  • Initial Screen Presentation : The program displays the CACTVWA map. On initial entry, all data fields are blank, and the system prompts the user with the message: "Enter or update id of account to display" .
  • Account Selection : The user types an 11-digit Account ID into the protected/unprotected input field and presses ENTER .
  • Data Retrieval & Display :
  • If the Account ID passes validation and exists in the database, the program populates the screen with the account's financial status and the customer's personal details. An informational message "Displaying details of given Account" is displayed.
  • If validation fails or the account is not found, the input field is highlighted in red, the cursor is positioned at the input field, and a descriptive error message is displayed at the bottom of the screen.
  • Subsequent Inquiries : The user can overwrite the Account ID field with a new account number and press ENTER to perform another search.
  • Exit : The user presses PF3 to exit the screen and return to the calling program (usually the Main Menu).
Screen Layout (CACTVWA)

+-----------------------------------------------------------------------------+

| Tran: CAVW AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COACTVWC CardDemo Time: HH:MM:SS |

| |

| CUSTOMER ACCOUNT VIEW |

| |

| Account ID: [11-Digit Acct ID] Status: [ ] |

| |

| Open Date : [10-Chars] Exp Date : [10-Chars] Reissue Date: [10-Chars] |

| Credit Lim: [ Formatted ] Cash Limit: [ Formatted ] Group ID : [10-Ch] |

| Curr Bal : [ Formatted ] Cycle Cred: [ Formatted ] Cycle Deb : [ For] |

| --------------------------------------------------------------------------- |

| Customer ID: [9-Digits] SSN: [XXX-XX-XXXX] FICO: [3-D] DOB: [10-Chars] |

| First Name : [25-Chars ] Middle Name: [25-Chars ] |

| Last Name : [25-Chars ] Primary Ind: [ ] |

| Addr Line 1: [50-Chars ] |

| Addr Line 2: [50-Chars ] |

| City : [50-Chars ] |

| State : [ ] Zip: [5-Ch] Country : [3-D] |

| Phone 1 : [13-Chars ] Phone 2 : [13-Chars ] |

| Govt ID : [20-Chars ] EFT Acct : [10-Chars ] |

| |

| <INFOMSG: Informational messages appear here > |

| <ERRMSG: Error messages appear here in red > |

| |

| ENTER=Fetch Details F3=Exit |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu Screen |

| (COMEN01C) |

+-----------------------+--------------------------+

|

| (Select Option 1 / XCTL)

v

+--------------------------------------------------+

| Account View Screen | <-----------------+

| (COACTVWC) | |

+-----------------------+--------------------------+ |

| |

+------------------+------------------+ |

| [PF3] (Exit) | [ENTER] (Fetch Details) | (Re-enter /

v v | New Search)

+-----------------------+ +------------------+ |

| Main Menu Screen | | Validate Input & | |

| (COMEN01C) | | Read VSAM Files | -----------------+

+-----------------------+ +------------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COACTVWC' | Program identifier |

| LIT-THISTRANID | 'CAVW' | CICS Transaction ID associated with this program |

| LIT-THISMAPSET | 'COACTVW ' | BMS Mapset name |

| LIT-THISMAP | 'CACTVWA' | BMS Map name |

| LIT-MENUPGM | 'COMEN01C' | Target program name for Main Menu |

| LIT-MENUTRANID | 'CM00' | Target transaction ID for Main Menu |

| LIT-ACCTFILENAME | 'ACCTDAT ' | Account Master VSAM dataset name |

| LIT-CUSTFILENAME | 'CUSTDAT ' | Customer Master VSAM dataset name |

| LIT-CARDXREFNAME-ACCT-PATH | 'CXACAIX ' | Card Cross-Reference Alternate Index Path |

Validation Logic

Input Field Validations
  • Account ID ( ACCTSIDI ) :
  • If the input is * or spaces, it is treated as low-values (blank).
  • Presence Check : If the field is blank, the program flags an input error and sets the message "Account number not provided" .
  • Numeric Check : The input must be strictly numeric. If it contains non-numeric characters or is equal to zero, the program flags an input error and sets the message "Account Filter must be a non-zero 11 digit number" .
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers map receipt, input validation, and database read operations.
  • PF3 : Triggers exit processing, transferring control back to the calling program (or Main Menu).
  • Other Keys : Any other key (e.g., PF1, PF2, PF4, Clear) is mapped to ENTER behavior by default, but the program flags the key as invalid and re-processes the screen.
Condition Checks
  • Program Context Check :
  • Evaluates CDEMO-PGM-CONTEXT to determine if the transaction is a fresh entry ( CDEMO-PGM-ENTER ) or a conversational re-entry ( CDEMO-PGM-REENTER ).
  • On fresh entry, it bypasses input processing and directly displays the initial empty screen.
  • On re-entry, it processes the submitted map inputs.

Data Elements Processed

Screen Input/Output Fields
  • ACCTSIDI / ACCTSIDO : 11-digit Account ID used as the primary search key.
  • ACSTTUSO : 1-character Account Active Status.
  • ADTOPENO : 10-character Account Open Date.
  • AEXPDTO : 10-character Account Expiration Date.
  • AREISDTO : 10-character Account Reissue Date.
  • AADDGRPO : 10-character Account Group ID.
  • ACSTNUMO : 9-digit Customer ID.
  • ACSTSSNO : 12-character formatted Social Security Number ( XXX-XX-XXXX ).
  • ACSTFCOO : 3-digit FICO Credit Score.
  • ACSTDOBO : 10-character Customer Date of Birth.
  • ACSFNAMO / ACSMNAMO / ACSLNAMO : Customer First, Middle, and Last Names.
  • ACSADL1O / ACSADL2O / ACSCITYO : Customer Address Lines and City.
  • ACSSTTEO / ACSZIPCO / ACSCTRYO : Customer State, Zip Code, and Country.
  • ACSPHN1O / ACSPHN2O : Customer Primary and Secondary Phone Numbers.
  • ACSGOVTO : 20-character Government Issued ID.
  • ACSEFTCO : 10-character EFT Account ID.
  • ACSPFLGO : 1-character Primary Card Holder Indicator.
Financial Amounts (Formatted Output)
  • ACURBALO : Current Balance (formatted as +ZZZ,ZZZ,ZZZ.99 ).
  • ACRDLIMO : Credit Limit (formatted as +ZZZ,ZZZ,ZZZ.99 ).
  • ACSHLIMO : Cash Credit Limit (formatted as +ZZZ,ZZZ,ZZZ.99 ).
  • ACRCYCRO : Current Cycle Credit (formatted as +ZZZ,ZZZ,ZZZ.99 ).
  • ACRCYDBO : Current Cycle Debit (formatted as +ZZZ,ZZZ,ZZZ.99 ).

Exception and Error Handling

Error Messages Displayed

| Message Text | Color | Trigger Condition |

| :--- | :--- | :--- |

| Account number not provided | Red | User pressed ENTER with a blank Account ID field. |

| Account Filter must be a non-zero 11 digit number | Red | User entered non-numeric characters or zeroes in the Account ID field. |

| Account: [AcctID] not found in Cross ref file. Resp: [R] Reas: [R2] | Red | The Account ID does not exist in the CXACAIX cross-reference file. |

| Account: [AcctID] not found in Acct Master file. Resp: [R] Reas: [R2] | Red | The Account ID exists in cross-reference but is missing from ACCTDAT . |

| CustId: [CustID] not found in customer master. Resp: [R] REAS: [R2] | Red | The associated Customer ID is missing from CUSTDAT . |

| File Error: [OP] on [FILE] returned RESP [R], RESP2 [R2] | Red | Any unexpected VSAM/CICS error during file read operations. |

CICS HANDLE CONDITION and ABEND Logic
  • EXEC CICS HANDLE ABEND :
  • Establishes an exit label ABEND-ROUTINE . If an unhandled program abend occurs, control is transferred to this routine.
  • The program populates ABEND-DATA with the program name ( COACTVWC ) and a default message "UNEXPECTED ABEND OCCURRED." , sends this plain text to the terminal, and terminates via EXEC CICS ABEND ABCODE('9999') .
  • Inline Response Code Handling :
  • The program avoids global HANDLE CONDITION statements for file operations. Instead, it utilizes the RESP and RESP2 options on all EXEC CICS READ commands.
  • It explicitly evaluates WS-RESP-CD for DFHRESP(NORMAL) and DFHRESP(NOTFND) to handle missing records gracefully without crashing the transaction.

Security and Authorization Checks

  • Preservation of Session Context :
  • The program does not perform explicit external security manager (e.g., IBM RACF) checks or standard CICS Signon ( CESN / CESF ) integrations.
  • Security and user tracking are managed at the application level via the CARDDEMO-COMMAREA . The program preserves the logged-in user's identity ( CDEMO-USER-ID ) and role ( CDEMO-USER-TYPE ) across program transfers.
  • Transaction Security :
  • When exiting to the Main Menu, the program explicitly sets the user type to standard user ( SET CDEMO-USRTYP-USER TO TRUE ) to prevent privilege escalation.

Performance Considerations

  • Pseudo-Conversational Design :
  • The program is designed to be pseudo-conversational. After sending the map ( EXEC CICS SEND MAP ), it issues an EXEC CICS RETURN specifying the transaction ID CAVW and passing the communication area. This releases CICS thread resources and memory while waiting for user input, maximizing concurrent user capacity.
  • VSAM Alternate Index (AIX) Access :
  • The program reads the Card Cross-Reference file ( CXACAIX ) using an alternate index path ( LIT-CARDXREFNAME-ACCT-PATH ) keyed by Account ID. This allows direct, single-record retrieval of the Customer ID and Card Number without performing resource-intensive sequential file browses ( STARTBR / READNEXT ).
  • Direct Key Reads :
  • All database retrievals ( ACCTDAT and CUSTDAT ) are performed via direct key reads ( READ with RIDFLD ), which is the most efficient access pattern for VSAM datasets.

<h2

COADM01C

cbl/COADM01C.cbl
scanner189 code lines1 calls out1 called by9 copybooks0 filesyes dynamic dispatch
MAT / Gemini

CardDemo Administration Menu Program

CardDemo Administration Menu Program

The COADM01C program serves as the centralized administrative hub for the CardDemo credit card management application. Designed exclusively for users with administrator-level privileges, this program acts as a secure gateway to critical system configuration and security management functions. By providing a structured, menu-driven interface, it ensures that authorized personnel can efficiently oversee user access and maintain core application lookup tables.

Upon entering the …

Full MAT analysis

CardDemo Administration Menu Program

The COADM01C program serves as the centralized administrative hub for the CardDemo credit card management application. Designed exclusively for users with administrator-level privileges, this program acts as a secure gateway to critical system configuration and security management functions. By providing a structured, menu-driven interface, it ensures that authorized personnel can efficiently oversee user access and maintain core application lookup tables.

Upon entering the administration portal, users are presented with a clean, professional menu screen displaying a list of available administrative tasks. These tasks are categorized into two primary functional areas: security administration and database maintenance. Security options allow administrators to list, add, update, and delete application users, while database maintenance options facilitate the listing and updating of transaction types. The screen also displays real-time system metadata, including the current date, time, and active transaction identifier, to maintain situational awareness.

User interaction is designed to be simple and intuitive. To execute a task, the administrator enters the corresponding option number and presses the enter key. The program immediately validates the input to ensure it is a valid, active option. If the validation succeeds, the program transfers control to the appropriate sub-program to perform the requested action, passing along the user's session context. If the input is invalid or represents an uninstalled feature, the program displays a clear, contextual error message at the bottom of the screen and prompts the user for a correct entry.

To optimize mainframe resource utilization, the program is built using a pseudo-conversational design. It does not remain active in system memory while waiting for user input, thereby maximizing concurrent user capacity and minimizing processing overhead. Session state, user authorization levels, and transaction history are securely maintained across program transitions using a shared communication area. Additionally, administrators can safely exit the menu and return to the main sign-on screen at any time by pressing a designated function key, ensuring a secure and controlled session termination.

Business Case and User Interaction

Business Case Overview

The COADM01C program serves as the centralized Administration Menu for the CardDemo application. It acts as a secure, role-based control panel that allows administrative users to navigate to various system management and security functions. The program dynamically builds and displays a menu of administrative options, validates user selections, and transfers control to the appropriate sub-programs.

The administrative functions accessible through this menu include:

  • User List (Security) : Displays a list of application users.
  • User Add (Security) : Allows creation of new application users.
  • User Update (Security) : Allows modification of existing user profiles.
  • User Delete (Security) : Allows removal of users from the system.
  • Transaction Type List/Update (Db2) : Manages transaction type configurations stored in Db2.
  • Transaction Type Maintenance (Db2) : Performs detailed maintenance on transaction types.
User Interaction and Screen Flow
  • Entry : The user is routed to this screen automatically after successful authentication as an Administrator (User Type 'A') in the Sign-on program ( COSGN00C ), or by returning from one of the sub-programs.
  • Screen Display : The program displays the COADM1A map, showing the system header (Transaction ID, Program Name, Current Date, and Time) and the list of 6 active administrative options.
  • Option Selection : The user types a 1- or 2-digit option number into the selection field and presses ENTER .
  • Execution :
  • If the selection is valid, the program transfers control (via XCTL ) to the corresponding program.
  • If the selection is invalid, an error message is displayed at the bottom of the screen, and the menu is redisplayed.
  • Exit : The user can press PF3 at any time to exit the Admin Menu and return to the Sign-on screen.

Screen Layout and Navigation

Screen Layout (COADM1A)

+-----------------------------------------------------------------------------+

| Tran: CA00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COADM01C CardDemo Time: hh:mm:ss |

| |

| Admin Menu |

| |

| 1. User List (Security) |

| 2. User Add (Security) |

| 3. User Update (Security) |

| 4. User Delete (Security) |

| 5. Transaction Type List/Update (Db2) |

| 6. Transaction Type Maintenance (Db2) |

| |

| |

| |

| Please select an option : [ ] |

| |

| <ERRMSG: Error messages appear here in red/green > |

| |

| ENTER=Continue F3=Exit |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Transaction CA00 / EIBCALEN > 0)

v

+--------------------------+

| COADM01C | <------------------+

| (Admin Menu Pgm) | |

+------------+-------------+ |

| |

| (Presents COADM1A Map) |

v |

+--------------------------+ |

| COADM1A Map | |

+------------+-------------+ |

| |

+---[PF3]-------------+---[ENTER] |

| | |

v v |

+------------------+ [Validate Option] |

| COSGN00C | | |

| (Sign-on Screen) | +---(If Invalid Option)--+

+------------------+ |

| (If Valid Option)

v

[XCTL to Target Program]

- Option 1: COUSR00C

- Option 2: COUSR01C

- Option 3: COUSR02C

- Option 4: COUSR03C

- Option 5: COTRTLIC

- Option 6: COTRTUPC

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COADM01C' | Program identifier |

| WS-TRANID | 'CA00' | CICS Transaction ID associated with this program |

| CDEMO-ADMIN-OPT-COUNT | 6 | Total number of active menu options |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • Option Selection Validation :
  • The program trims trailing spaces from the input field OPTIONI .
  • Any remaining spaces are replaced with '0' to normalize the input (e.g., ' 1' or '1 ' becomes '01' ).
  • The normalized value is moved to a numeric field ( WS-OPTION ).
  • Numeric Check : The entered option must be numeric.
  • Range Check : The option must be greater than 0 and less than or equal to CDEMO-ADMIN-OPT-COUNT (6).
  • If any of these checks fail, WS-ERR-FLG is set to 'Y' , the error message "Please enter a valid option number..." is displayed in red, and the screen is redisplayed.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Initiates option validation and program transfer.
  • PF3 : Triggers exit processing, redirecting the user back to the Sign-on screen ( COSGN00C ).
  • Other Keys : Any other key (e.g., PF1, PF2, PF4, Clear) is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the menu.
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 (indicating the program was invoked directly without a communication area), the program bypasses the menu, sets the target program to 'COSGN00C' , and redirects to the Sign-on screen.
  • Re-entry Check : The program uses CDEMO-PGM-REENTER to determine if this is the initial display of the menu (sends a fresh map with low-values) or a postback from a user interaction (receives and processes the input).
  • Dummy Program Check : Before executing an XCTL , the program verifies that the target program name associated with the selected option does not start with 'DUMMY' .

Data Elements Processed

Screen and Input Fields
  • OPTIONI / OPTIONO : User-entered menu option (2 characters).
  • ERRMSGO / ERRMSGC : Error message text and attribute color control field.
  • OPTN001O to OPTN012O : Output fields on the map used to display the formatted menu options.
Backend and Control Fields
  • CARDDEMO-COMMAREA : Shared communication area passed between programs.
  • CDEMO-FROM-TRANID : Set to 'CA00' before transferring control to track the originating transaction.
  • CDEMO-FROM-PROGRAM : Set to 'COADM01C' before transferring control to track the originating program.
  • CDEMO-TO-PROGRAM : Set to 'COSGN00C' during exit processing to specify the target redirection program.
  • CDEMO-PGM-CONTEXT : Reset to 0 (Enter context) before transferring control to signal a fresh entry into the target program.
  • CDEMO-ADMIN-OPT-PGMNAME(WS-OPTION) : Resolves the target program name based on the validated user selection.

Exception and Error Handling

CICS HANDLE CONDITION
  • PGMIDERR : The program registers a global handle condition for PGMIDERR pointing to PGMIDERR-ERR-PARA . If an XCTL command fails because the target program is not defined or installed in the CICS region, the program catches the exception, sets the message "This option is not installed ..." in green, redisplays the menu, and returns control to CICS.
Error Messages
  • "Please enter a valid option number..." : Displayed in red when the user enters a non-numeric value, a value of 0 , or a value greater than 6 .
  • "Invalid key pressed. Please see below..." : Displayed in red when the user presses an unsupported AID key.
  • "This option is not installed ..." : Displayed in green if a PGMIDERR occurs during transfer, or if the selected option's program name starts with 'DUMMY' .

Security and Authorization Checks

  • Role-Based Access : The program relies on the upstream authentication process ( COSGN00C ) to verify that the user is an Administrator ( CDEMO-USRTYP-ADMIN is 'A' ).
  • Direct Access Prevention : If a user attempts to bypass the sign-on screen and execute the transaction CA00 directly, EIBCALEN will be 0 . The program detects this, blocks access, and immediately redirects the user to the Sign-on screen ( COSGN00C ).
  • No Explicit Platform Security : No explicit external security manager (such as RACF) checks or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the transaction ID CA00 and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption.
  • No Database or File I/O : This program does not perform any VSAM or Db2 database operations, making it highly efficient and fast to execute. Target program names are resolved entirely from static tables defined in Working-Storage.

<h2

COBIL00C

cbl/COBIL00C.cbl
scanner420 code lines1 calls out0 called by10 copybooks6 filesyes dynamic dispatch
MAT / Gemini

Online Bill Payment Processing System for CardDemo

Online Bill Payment Processing System for CardDemo

The COBIL00C program serves as the online bill payment module within the CardDemo application, designed to facilitate the full payment of outstanding credit card account balances. Its primary business purpose is to provide a secure, interactive interface where users can retrieve an account's current balance, verify the details, and process a payment to bring the outstanding balance down to zero. This program ensures financial consistency by coordinating real-time …

Full MAT analysis

Online Bill Payment Processing System for CardDemo

The COBIL00C program serves as the online bill payment module within the CardDemo application, designed to facilitate the full payment of outstanding credit card account balances. Its primary business purpose is to provide a secure, interactive interface where users can retrieve an account's current balance, verify the details, and process a payment to bring the outstanding balance down to zero. This program ensures financial consistency by coordinating real-time updates across account records and transaction logs.

When a user accesses the bill payment screen, they are prompted to enter a valid account ID. The program retrieves the account's current balance from the database and displays it on the screen. To prevent accidental or unauthorized payments, the system enforces a two-step confirmation workflow. The user must explicitly confirm the payment by entering a confirmation response. If the user confirms the payment, the system proceeds with the financial processing; if they decline or cancel, the transaction is aborted, and the screen is safely cleared.

Upon receiving user confirmation, the program performs a series of coordinated database updates to finalize the payment. It first performs a cross-reference lookup to identify the credit card number associated with the account. It then queries the transaction registry to determine the next sequential transaction identifier. Using this identifier, the system generates and writes a new transaction record detailing the online bill payment, including the payment amount, timestamp, and standard merchant information. Simultaneously, the program updates the account record by subtracting the payment amount—effectively resetting the outstanding balance to zero—and saves the updated account details.

The program is designed with robust validation and error-handling mechanisms to ensure data integrity. It verifies that the entered account exists, checks that there is an active balance to be paid, and validates all user inputs. If any step fails—such as a missing account or an invalid confirmation code—the program displays clear, contextual error messages to guide the user. Upon a successful payment, a green confirmation message is displayed on the screen, presenting the user with the newly generated transaction receipt number. Users can also easily clear their inputs or navigate back to the main menu using standard function keys.

Business Case and User Interaction

Business Case Overview

The COBIL00C program implements the Online Bill Payment functionality for the CardDemo Credit Card Processing Application. Its primary business purpose is to allow cardholders or operators to pay off an account's outstanding balance in full.

When executed, the program performs the following core business functions:

  • Balance Retrieval : Looks up the specified Account ID in the account database ( ACCTDAT ) and displays the current outstanding balance.
  • Payment Confirmation : Prompts the user to confirm the payment transaction.
  • Transaction Generation : Upon confirmation, it automatically generates a unique transaction ID, creates a new financial transaction record in the transaction log ( TRANSACT ), and sets the transaction amount to the full outstanding balance.
  • Account Update : Deducts the payment amount from the account's current balance (bringing the balance to zero) and updates the account record in the database.
User Interaction and Screen Flow
  • Entry : The user navigates to the Bill Payment screen, typically from the Main Menu ( COMEN01C ) or another sub-application. If an Account ID was already selected in a previous screen, it is automatically populated in the "Enter Acct ID" field, and the balance is retrieved immediately.
  • Account Input : If the Account ID field is empty, the user types an 11-digit Account ID and presses ENTER .
  • Balance Display & Confirmation Prompt : The program retrieves and displays the current balance. It then prompts the user with the message "Confirm to make a bill payment..." and positions the cursor on the confirmation field.
  • Confirmation Input : The user types 'Y' (Yes) or 'N' (No) in the confirmation field and presses ENTER .
  • If the user enters 'Y' , the payment is processed, the account balance is updated to zero, a success message is displayed in green with the new Transaction ID, and the input fields are cleared.
  • If the user enters 'N' , the transaction is aborted, the screen is cleared, and the fields are reset.
  • Exit/Clear :
  • The user can press PF3 to return to the previous screen.
  • The user can press PF4 to clear all input fields and reset the screen.

Screen Layout and Navigation

Screen Layout (COBIL0A)

+-----------------------------------------------------------------------------+

| Tran: CB00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COBIL00C CardDemo Time: hh:mm:ss |

| |

| Bill Payment |

| |

| Enter Acct ID: [ ] |

| |

| ---------------------------------------------- ---------------|

| |

| Your current balance is: [ ] |

| |

| Do you want to pay your balance now. Please confirm: [ ] (Y/N) |

| |

| <ERRMSG: Error or success messages appear here > |

| |

| ENTER=Continue F3=Back F4=Clear |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu / Calling Program |

| (e.g., COMEN01C or COTRN00C) |

+-----------------------+--------------------------+

|

| (Transfers Control via XCTL)

v

+--------------------------------------------------+

| Bill Payment Program | <-----------------+

| (COBIL00C) | |

+-----------------------+--------------------------+ |

| |

+------------------+------------------+ | (Re-entry /

| [PF3] | [ENTER] | Validation

v v | Failure)

+-----------------------+ +------------------+ |

| Previous Screen | | Validate Inputs | -----------------+

| (COMEN01C / CDEMO-F*) | | & Process VSAM |

+-----------------------+ +------------------+

Data Flow Description
  • Incoming Data : The program receives the CARDDEMO-COMMAREA from the calling program. If CDEMO-CB00-TRN-SELECTED contains an Account ID, it is automatically moved to the screen input field ( ACTIDINI ) to initiate an immediate balance lookup.
  • Outgoing Data : When returning to the previous screen via PF3 , the program updates the CARDDEMO-COMMAREA with its own transaction ID ( CB00 ) and program name ( COBIL00C ) in the tracking fields before executing XCTL .
User Navigation
  • ENTER : Validates the Account ID, retrieves the balance, prompts for confirmation, and processes the payment.
  • PF3 : Returns control to the program specified in CDEMO-FROM-PROGRAM (or defaults to COMEN01C if empty).
  • PF4 : Clears all screen fields and resets the cursor to the Account ID field.

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COBIL00C' | Program identifier |

| WS-TRANID | 'CB00' | CICS Transaction ID associated with this program |

| WS-TRANSACT-FILE | 'TRANSACT' | VSAM KSDS file containing transaction records |

| WS-ACCTDAT-FILE | 'ACCTDAT ' | VSAM KSDS file containing account master records |

| WS-CXACAIX-FILE | 'CXACAIX ' | VSAM Alternate Index path linking accounts to card numbers |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • Account ID ( ACTIDINI ) :
  • Must not be spaces or low-values.
  • If empty, the program sets WS-ERR-FLG to 'Y' , displays "Acct ID can NOT be empty..." , and positions the cursor on the Account ID field ( ACTIDINL = -1 ).
  • Confirmation Flag ( CONFIRMI ) :
  • Must be one of the following values: 'Y' , 'y' , 'N' , 'n' , spaces, or low-values.
  • If any other character is entered, the program sets WS-ERR-FLG to 'Y' , displays "Invalid value. Valid values are (Y/N)..." , and positions the cursor on the confirmation field ( CONFIRML = -1 ).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers input validation, balance retrieval, and payment processing.
  • PF3 : Triggers exit processing, transferring control back to the calling program.
  • PF4 : Clears all input and output fields on the screen and positions the cursor on the Account ID field.
  • Other Keys : Any other key is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the screen.
Condition Checks
  • Zero or Negative Balance Check :
  • If the retrieved account balance ( ACCT-CURR-BAL ) is less than or equal to zero, the program blocks the payment process, sets WS-ERR-FLG to 'Y' , displays "You have nothing to pay..." , and positions the cursor on the Account ID field.
  • Confirmation Check :
  • If CONFIRMI is 'N' or 'n' , the program aborts the payment, clears the screen, and sets the error flag.
  • If CONFIRMI is spaces or low-values, the program retrieves the balance and prompts the user with "Confirm to make a bill payment..." without executing the transaction.
  • If CONFIRMI is 'Y' or 'y' , the program proceeds to execute the payment transaction.

Data Elements Processed

Screen Fields
  • ACTIDINI / ACTIDINO : Input/Output field for the 11-digit Account ID.
  • CURBALI / CURBALO : Output field displaying the retrieved account balance formatted as currency.
  • CONFIRMI / CONFIRMO : Input/Output field for the 1-character payment confirmation flag ( Y/N ).
  • ERRMSGO : Output field for error, warning, and success messages.
  • ERRMSGC : Attribute byte used to dynamically change the color of the error message (e.g., DFHGREEN for successful payments, default red for errors).
Backend and Control Fields
  • ACCT-ID : Key field used to read and update the ACCTDAT file.
  • ACCT-CURR-BAL : Stored account balance retrieved from the ACCOUNT-RECORD .
  • XREF-ACCT-ID : Key field used to read the CXACAIX file to retrieve the associated card number.
  • XREF-CARD-NUM : Card number retrieved from the cross-reference record, mapped to TRAN-CARD-NUM .
  • TRAN-ID : Key field used to read and write records in the TRANSACT file.
  • TRAN-AMT : Transaction amount, set to the full outstanding account balance ( ACCT-CURR-BAL ).
  • WS-TIMESTAMP : Generated timestamp used to populate TRAN-ORIG-TS and TRAN-PROC-TS .

Exception and Error Handling

CICS File Exception Handling

The program utilizes explicit response checking ( RESP and RESP2 parameters) on all file operations to handle exceptions inline:

READ / REWRITE on ACCTDAT :

  • DFHRESP(NORMAL) : Continues processing.
  • DFHRESP(NOTFND) : Sets WS-ERR-FLG to 'Y' , displays "Account ID NOT found..." , and positions the cursor on the Account ID field.
  • Other Errors : Displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup Account..." or "Unable to Update Account..." .

READ on CXACAIX :

  • DFHRESP(NORMAL) : Continues processing.
  • DFHRESP(NOTFND) : Sets WS-ERR-FLG to 'Y' , displays "Account ID NOT found..." , and positions the cursor on the Account ID field.
  • Other Errors : Displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup XREF AIX file..." .

STARTBR / READPREV on TRANSACT :

  • DFHRESP(NORMAL) : Continues processing.
  • DFHRESP(NOTFND) : Sets WS-ERR-FLG to 'Y' , displays "Transaction ID NOT found..." , and positions the cursor on the Account ID field.
  • DFHRESP(ENDFILE) : Gracefully handles an empty transaction file by initializing TRAN-ID to zeros.
  • Other Errors : Displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup Transaction..." .

WRITE on TRANSACT :

  • DFHRESP(NORMAL) : Clears input fields, sets the message color to green, and displays "Payment successful. Your Transaction ID is [TRAN-ID]."
  • DFHRESP(DUPKEY) / DFHRESP(DUPREC) : Sets WS-ERR-FLG to 'Y' , displays "Tran ID already exist..." , and positions the cursor on the Account ID field.
  • Other Errors : Displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to Add Bill pay Transaction..." .

Security and Authorization Checks

  • Session Validation : The program checks if EIBCALEN is equal to 0 . If true, it indicates that the program was accessed directly without a valid CICS communication area. The program immediately redirects the user to the Sign-on screen ( COSGN00C ).
  • No Explicit Security Checks : No explicit external security manager (such as IBM RACF) checks, EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program. Security and session state are entirely application-managed via the CARDDEMO-COMMAREA .

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. After sending the map, it issues an EXEC CICS RETURN specifying the transaction ID CB00 and passing the CARDDEMO-COMMAREA . This releases CICS resources and maximizes concurrent user capacity.
  • Efficient Last Key Retrieval : To generate a unique, sequential Transaction ID, the program performs a STARTBR with HIGH-VALUES on the TRANSACT file, followed by a single READPREV to retrieve the highest existing key, and immediately issues an ENDBR . This is a highly efficient mainframe pattern that avoids scanning the entire VSAM KSDS file.
  • Exclusive Lock on Read : The READ command on the ACCTDAT file is executed with the UPDATE option. This places an exclusive lock on the account record, preventing concurrent update anomalies (lost updates) until the subsequent REWRITE is executed.

<h2

COBSWAIT

cbl/COBSWAIT.cbl
scanner13 code lines1 calls out0 called by0 copybooks0 files
MAT / Gemini

COBSWAIT: A Batch Utility Program for Introducing Controlled Execution Delays

COBSWAIT: A Batch Utility Program for Introducing Controlled Execution Delays

The COBSWAIT program is a utility component within the CardDemo batch processing framework. Its primary business purpose is to introduce a controlled, temporary pause in the execution flow of batch jobs. This is particularly useful in enterprise environments where sequential job steps or interdependent processes need to be synchronized, or when throttling is required to prevent resource contention and manage system workload …

Full MAT analysis

COBSWAIT: A Batch Utility Program for Introducing Controlled Execution Delays

The COBSWAIT program is a utility component within the CardDemo batch processing framework. Its primary business purpose is to introduce a controlled, temporary pause in the execution flow of batch jobs. This is particularly useful in enterprise environments where sequential job steps or interdependent processes need to be synchronized, or when throttling is required to prevent resource contention and manage system workload effectively.

To determine the duration of the delay, the program reads an input parameter from the standard system input stream. This parameter specifies the desired wait time, allowing scheduling administrators or calling processes to dynamically define how long the execution should be suspended for each specific run without needing to modify the program's underlying logic.

The input value is processed and converted into a specific time format measured in centiseconds (hundredths of a second). This high-resolution timing capability allows for precise control over the delay, ranging from fractions of a second to longer durations. Once the time value is prepared, the program delegates the actual waiting operation to a specialized system-level service.

By calling the external system routine responsible for managing environment-level waits, COBSWAIT safely suspends the execution thread. During this pause, no active processing occurs, preserving valuable CPU cycles. Once the specified duration has elapsed, the system service returns control to the utility, which then cleanly terminates, allowing the subsequent steps in the batch job stream to resume.

Program Business Logic Description

COBSWAIT is a batch utility program designed to pause or suspend the execution of a batch job step for a specified duration. The program acts as a wrapper that interfaces with an external system-level wait routine.

The business and operational logic of the program is executed as follows:

  • Read Input Parameter : The program reads an 8-character alphanumeric value from the standard input stream ( SYSIN ) into the variable PARM-VALUE . This value represents the desired wait time.
  • Format Conversion : The alphanumeric input is moved to a computational binary numeric field ( MVSWAIT-TIME ). This implicit conversion prepares the duration value in the format required by the operating system's wait utility.
  • Invoke Wait Routine : The program calls the external system utility MVSWAIT , passing the binary wait time as a parameter. The unit of time expected by MVSWAIT is centiseconds (1/100ths of a second).
  • Terminate Execution : Once the external MVSWAIT routine completes the pause and returns control, the program terminates execution using STOP RUN .

Important Constants

  • Centisecond Unit (Implicit) : While not explicitly defined as a named constant in the WORKING-STORAGE SECTION , the program logic implicitly operates on the constant time unit of centiseconds (1/100th of a second) for the input parameter.

Validation Logic

The program does not contain any explicit validation logic or data integrity checks:

  • No Input Validation : The program does not verify if the data read from SYSIN is present, non-empty, or numeric before attempting to move it to the numeric field.
  • No Range Validation : There are no checks to ensure the wait time is within reasonable or safe operational limits (e.g., preventing excessively long sleep times that could hang a batch queue).

Data Elements Processed

  • PARM-VALUE (PIC X(8)) : An alphanumeric field that receives the raw wait duration parameter from the SYSIN input stream.
  • MVSWAIT-TIME (PIC 9(8) COMP) : A computational (binary) numeric field that stores the converted wait duration in centiseconds. This field is passed as the parameter to the MVSWAIT system call.

Exception and Error Handling

The program lacks explicit exception handling or recovery routines. Consequently, it is susceptible to the following abnormal terminations (ABENDs):

  • Data Exception (S0C7 ABEND) : If the input read from SYSIN contains non-numeric characters, the implicit conversion during the MOVE PARM-VALUE TO MVSWAIT-TIME statement will result in a decimal data exception.
  • Program Call Failure (S806 ABEND) : If the external utility MVSWAIT is not accessible in the system's link list or the job's load library concatenation ( STEPLIB / JOBLIB ), the program will fail when attempting the CALL statement.

Security and Authorization Checks

No explicit security checks identified.

Performance Considerations

  • Initiator and Resource Holding : While the program is in a wait state, it does not consume significant CPU cycles (as the MVSWAIT routine yields CPU control to the operating system). However, the batch job step remains active, holding its assigned batch initiator and any allocated system resources (such as datasets or database locks) for the duration of the wait. This can impact overall batch window throughput if long wait times are specified.

<h2

COBTUPDT

app-transaction-type-db2/cbl/COBTUPDT.cbl
scanner177 code lines0 calls out0 called by1 copybooks1 files
MAT / Gemini

Transaction Type Database Maintenance Utility

Transaction Type Database Maintenance Utility

The Transaction Type Database Maintenance utility is a batch processing program designed to manage and synchronize transaction type definitions within a core financial database. By processing a sequential input file containing requested changes, the program ensures that the system's transaction classification records remain accurate and up to date. This automated maintenance is critical for downstream transaction processing, reporting, and auditing functions.

The …

Full MAT analysis

Transaction Type Database Maintenance Utility

The Transaction Type Database Maintenance utility is a batch processing program designed to manage and synchronize transaction type definitions within a core financial database. By processing a sequential input file containing requested changes, the program ensures that the system's transaction classification records remain accurate and up to date. This automated maintenance is critical for downstream transaction processing, reporting, and auditing functions.

The program operates by reading an input file sequentially, where each record represents a specific maintenance request. Each input record contains an action indicator, a unique transaction type identifier, and an associated transaction description. The utility processes these records one by one, translating the input data into corresponding database operations against the central transaction type registry.

Depending on the action indicator provided in the input file, the utility performs one of three primary database operations. It can insert new transaction types into the database, update the descriptions of existing transaction types, or delete obsolete transaction types. Additionally, the program supports comment lines within the input file, allowing administrators to document the input file without affecting the database.

To ensure data integrity, the utility incorporates robust validation and error-handling procedures. If an input record contains an invalid action code, or if a database operation fails—such as attempting to update or delete a non-existent transaction type—the program logs a descriptive error message and terminates processing with a warning status. This immediate feedback mechanism alerts system administrators to data discrepancies or database connectivity issues that require manual intervention.

Business Logic Description

The COBTUPDT program is a batch utility designed to process transaction type updates from a sequential input file and apply those changes to a DB2 database table named CARDDEMO.TRANSACTION_TYPE .

The program executes the following sequential business flow:

  • Initialization and File Opening :

The program opens the sequential input file TR-RECORD (associated with the JCL DD name INPFILE ). It verifies the file status immediately after opening.

  • Sequential Processing Loop :

The program performs a priming read to fetch the first record. It then enters a loop that continues until the End-of-File (EOF) marker is reached ( LASTREC = 'Y' ). For each valid record read, the program:

  • Displays the record content being processed.
  • Evaluates the action indicator (record type) to determine the database operation.
  • Executes the corresponding SQL statement (Insert, Update, or Delete) or ignores the record if marked as a comment.
  • Performs a subsequent read to fetch the next record.
  • Database Operations :
  • Insert ('A') : Inserts a new transaction type code and its description into the CARDDEMO.TRANSACTION_TYPE table.
  • Update ('U') : Updates the description of an existing transaction type code in the database.
  • Delete ('D') : Deletes the row matching the transaction type code from the database.
  • Comment ('*') : Bypasses database processing for the current record.
  • Termination :

Once all records are processed, the program closes the input file and terminates execution.

Important Constants
  • Action Codes ( INPUT-REC-TYPE ) :
  • 'A' : Add/Insert record.
  • 'U' : Update record.
  • 'D' : Delete record.
  • '*' : Comment line (ignored).
  • File Status Codes :
  • '00' : Successful file open.
  • SQL Codes ( SQLCODE ) :
  • 0 (ZERO): Successful SQL execution.
  • +100 : Row not found (applicable to Update and Delete operations).
  • Return Codes :
  • 4 : Assigned to the RETURN-CODE special register to indicate a processing error or warning.
Validation Logic
  • File Open Verification : After opening TR-RECORD , the program checks if WS-INF-STATUS is equal to '00' . If it is not, it displays 'OPEN FILE NOT OK' , but does not halt execution.
  • Action Code Validation : The program evaluates the INPUT-REC-TYPE field of each record. If the value is not 'A' , 'U' , 'D' , or '*' , it is treated as invalid. The program constructs an error message ( 'ERROR: TYPE NOT VALID' ) and triggers the error handling routine.
  • Database Existence Verification :
  • For Update ( 'U' ) and Delete ( 'D' ) operations, the program validates that the target record exists in the database by checking if SQLCODE is +100 (Not Found). If the record does not exist, it treats this as a validation failure, formats a 'No records found.' message, and triggers the error handling routine.
Data Elements Processed
  • INPUT-REC-TYPE (PIC X(1)): The action indicator read from the input file that dictates whether to insert, update, delete, or ignore the record.
  • INPUT-REC-NUMBER (PIC X(2)): The transaction type identifier read from the input file. This maps directly to the host variable used in the SQL WHERE clause ( TR_TYPE ) for updates and deletes, and the insert value list.
  • INPUT-REC-DESC (PIC X(50)): The transaction description read from the input file. This maps to the host variable used to populate or update the TR_DESCRIPTION column in the database.
  • SQLCODE / WS-VAR-SQLCODE (PIC ----9): The DB2 return code used to evaluate the success, warning, or failure status of each SQL execution.
  • WS-RETURN-MSG (PIC X(80)): A working storage variable used to format error messages before they are written to the system output.
  • RETURN-CODE : A COBOL special register updated to 4 when database or validation errors occur.
Exception and Error Handling
  • Invalid Action Code Handling : If an invalid action code is encountered, the program moves 'ERROR: TYPE NOT VALID' to WS-RETURN-MSG and performs 9999-ABEND .
  • SQL Error Handling (Negative SQLCODE) : If any database operation results in a negative SQLCODE (indicating a database error), the program formats an error message containing the specific SQL code (e.g., 'Error accessing: TRANSACTION_TYPE table. SQLCODE: -xxx' ), moves it to WS-RETURN-MSG , and performs 9999-ABEND .
  • Record Not Found Handling (+100) : For Update and Delete operations, if the target row does not exist ( SQLCODE = +100 ), the program formats 'No records found.' into WS-RETURN-MSG and performs 9999-ABEND .
  • ABEND Routine ( 9999-ABEND ) : This paragraph displays the formatted error message stored in WS-RETURN-MSG and sets the COBOL RETURN-CODE special register to 4 .
  • Non-Fatal Error Flow : It is important to note that the 9999-ABEND routine does not issue a STOP RUN or abnormal termination command. After setting RETURN-CODE to 4 , control returns to the main processing loop, allowing the program to continue reading and processing subsequent records in the input file. The final job step return code will reflect 4 if any error occurred during the run.
Security and Authorization Checks

No explicit security checks identified. The program relies on the mainframe environment's dataset security (e.g., RACF) for file access and the DB2 subsystem's authorization mechanism for table access privileges (INSERT, UPDATE, DELETE on CARDDEMO.TRANSACTION_TYPE ).

Performance Considerations
  • Row-by-Row Processing : The program processes database updates sequentially, one record at a time. It does not utilize bulk insert/update techniques or cursor-based batching.
  • Commit Frequency : There are no explicit COMMIT or ROLLBACK statements within the program. Transaction management (commit scope) is deferred to the external execution environment (e.g., TSO batch runner IKJEFT01 or the calling JCL step configuration).
  • Database Indexing : The UPDATE and DELETE statements filter on TR_TYPE = :INPUT-REC-NUMBER . For optimal performance, the TR_TYPE column should be defined as the primary key or have a unique index on the CARDDEMO.TRANSACTION_TYPE table to avoid full table scans.

<h2

COCRDLIC

cbl/COCRDLIC.cbl
scanner1093 code lines3 calls out0 called by10 copybooks6 filesyes dynamic dispatch
MAT / Gemini

Credit Card Search and List Utility for CardDemo

Credit Card Search and List Utility for CardDemo

The COCRDLIC program serves as the primary search and directory interface for credit cards within the CardDemo application. Its main business purpose is to provide customer service representatives, operators, and administrators with a flexible, paginated list of credit cards registered in the system. Depending on the user's security role and the initial navigation context, the program can display all credit cards in the database or restrict the list to cards …

Full MAT analysis

Credit Card Search and List Utility for CardDemo

The COCRDLIC program serves as the primary search and directory interface for credit cards within the CardDemo application. Its main business purpose is to provide customer service representatives, operators, and administrators with a flexible, paginated list of credit cards registered in the system. Depending on the user's security role and the initial navigation context, the program can display all credit cards in the database or restrict the list to cards associated with a specific account.

Users interact with the program through an interactive search screen where they can filter results by entering an Account ID, a Card Number, or both. The retrieved records are presented in a structured, seven-row grid displaying essential card attributes, including the associated account number, the card number, and its current active status. This high-level overview allows operators to quickly scan and locate specific card records from a large database.

Beyond simple browsing, the list screen acts as a functional launchpad for deeper card management tasks. By entering action codes next to any listed card, users can initiate downstream workflows: selecting 'S' routes them to the Credit Card Detail Inquiry program to view comprehensive cardholder details, while selecting 'U' transfers control to the Credit Card Update program to modify card attributes. The program automatically carries over the selected card and account context, ensuring a seamless transition without requiring the user to re-type search keys.

To handle large volumes of credit card records efficiently, the program features robust pagination controls, allowing users to scroll forward and backward through search results using standard function keys. It also enforces strict input validation on search filters, ensuring that any entered criteria are strictly numeric and of the correct length. If validation fails, the program dynamically highlights the erroneous fields in red and displays descriptive error messages to guide the user.

Under the hood, the program is built using a high-performance, pseudo-conversational design that optimizes mainframe resource utilization by releasing active system threads while waiting for user input. It maintains session state, user authorization levels, and navigation history across screen transitions using a shared communication area. This architecture ensures a secure, responsive, and consistent user experience even under heavy concurrent workloads.

Business Case and User Interaction

Business Case Overview

The COCRDLIC program is the "Credit Card List" component of the CardDemo mainframe application. Its primary business purpose is to display a paginated list of credit cards stored in the system, allowing operators to browse records, apply search filters (by Account ID and/or Card Number), and select specific cards for detailed inquiry or modification.

This program acts as an intermediary navigation directory, supporting the following operational workflows:

  • Card Browsing : Displays up to 7 credit card records per screen, showing the Account Number, Card Number, and Active Status.
  • Filtered Search : Allows users to narrow down the list by entering a specific 11-digit Account ID or a 16-digit Card Number.
  • Action Dispatching :
  • View Detail ('S') : Transfers control to the Credit Card Detail Inquiry program ( COCRDSLC ) to view comprehensive cardholder information.
  • Update ('U') : Transfers control to the Credit Card Detail Update program ( COCRDUPC ) to modify card attributes.
Screen Layout and Navigation
Screen Layout (CCRDLIA)

The screen displays system metadata in the header, search filter inputs, a 7-row tabular grid for card records, and navigation/action instructions at the bottom.

+-----------------------------------------------------------------------------+

| Tran: CCLI AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COCRDLIC CardDemo Time: HH:MM:SS |

| |

| Credit Card List Screen Page: 01 |

| |

| Account Id: [ ] |

| Card Number: [ ] |

| |

| Sel Account ID Card Number Status |

| --- ------------ ------------------ ------ |

| [ ] [12345678901] [4321098765432109] [Y] |

| [ ] [12345678901] [4321098765432110] [N] |

| [ ] [12345678902] [4321098765432111] [Y] |

| [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] |

| |

| <INFOMSGI: TYPE S FOR DETAIL, U TO UPDATE ANY RECORD > |

| <ERRMSGI: Error messages appear here in red > |

| |

| ENTER=Fetch/Select F3=Exit F7=PageUp F8=PageDown |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu (COMEN01C) |

+------------------------+-------------------------+

|

| (Select Option 3)

v

+-----------------------------------------------------------------------------+

| Credit Card List (COCRDLIC) |

| |

| 1. Displays paginated list of cards (7 rows max) |

| 2. Accepts filters: Account ID and Card Number |

| 3. Accepts row actions: 'S' (View Detail), 'U' (Update) |

+-----------------------------------------------------------------------------+

| | |

| [PF3] | Action='S' | Action='U'

v v v

+------------------+ +------------------+ +------------------+

| Main Menu | | Card Detail | | Card Update |

| (COMEN01C) | | (COCRDSLC) | | (COCRDUPC) |

+------------------+ +------------------+ +------------------+

Screen Flow and User Navigation
  • Entry : The user enters transaction CCLI or selects Option 3 from the Main Menu ( COMEN01C ).
  • Filtering : The user can enter search criteria in the Account Id or Card Number fields and press ENTER to filter the list.
  • Pagination :
  • PF8 (Page Down) : Displays the next 7 records starting from the last card key of the current page.
  • PF7 (Page Up) : Displays the previous 7 records using a backward file browse.
  • Row Selection :
  • To view details, the user types S in the Sel column of a row and presses ENTER . The program transfers control to COCRDSLC via EXEC CICS XCTL .
  • To update details, the user types U in the Sel column of a row and presses ENTER . The program transfers control to COCRDUPC via EXEC CICS XCTL .
  • Exit : The user presses PF3 to return to the Main Menu ( COMEN01C ).

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COCRDLIC' | Program identifier |

| LIT-THISTRANID | 'CCLI' | CICS Transaction ID for this program |

| LIT-THISMAPSET | 'COCRDLI' | BMS Mapset name |

| LIT-THISMAP | 'CCRDLIA' | BMS Map name |

| LIT-MENUPGM | 'COMEN01C' | Program ID of the Main Menu program |

| LIT-CARDDTLPGM | 'COCRDSLC' | Program ID of the Card Detail program |

| LIT-CARDUPDPGM | 'COCRDUPC' | Program ID of the Card Update program |

| LIT-CARD-FILE | 'CARDDAT ' | Primary VSAM KSDS Card Data File |

| LIT-CARD-FILE-ACCT-PATH | 'CARDAIX ' | Alternate Index Path for Card Data File (by Account ID) |

| WS-MAX-SCREEN-LINES | 7 | Maximum number of records displayed per page |

Validation Logic

The program performs input validation during pseudo-conversational re-entry.

Input Field Validations
  • Account ID Filter ( 2210-EDIT-ACCOUNT ) :
  • If supplied, the value must be strictly numeric.
  • If non-numeric, the program flags INPUT-ERROR , sets FLG-ACCTFILTER-NOT-OK , protects the selection rows, and displays: "ACCOUNT FILTER,IF SUPPLIED MUST BE A 11 DIGIT NUMBER" .
  • Card Number Filter ( 2220-EDIT-CARD ) :
  • If supplied, the value must be strictly numeric.
  • If non-numeric, the program flags INPUT-ERROR , sets FLG-CARDFILTER-NOT-OK , protects the selection rows, and displays: "CARD ID FILTER,IF SUPPLIED MUST BE A 16 DIGIT NUMBER" .
Row Selection Validations ( 2250-EDIT-ARRAY )
  • Action Code Validation :
  • The selection character in the Sel column must be 'S' (View), 'U' (Update), or blank/low-values.
  • Any other character flags an error, highlights the selection field in red, and displays: "INVALID ACTION CODE" .
  • Single Selection Enforcement :
  • The user is only allowed to select one record at a time for viewing or updating.
  • If multiple rows have selection characters ( 'S' or 'U' ), the program flags an error, highlights the offending selection fields in red, and displays: "PLEASE SELECT ONLY ONE RECORD TO VIEW OR UPDATE" .
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • Valid keys are ENTER , PF3 (Exit), PF7 (Page Up), and PF8 (Page Down).
  • If any other key is pressed, the program defaults the action to ENTER but flags the key as invalid.
  • Pagination Bounds :
  • Pressing PF7 on the first page displays the error: "NO PREVIOUS PAGES TO DISPLAY" .
  • Pressing PF8 on the last page displays the error: "NO MORE PAGES TO DISPLAY" .

Data Elements Processed

Screen Fields
  • ACCTSIDI / ACCTSIDO : Input/Output field for the 11-digit Account ID filter.
  • CARDSIDI / CARDSIDO : Input/Output field for the 16-digit Card Number filter.
  • CRDSEL1I to CRDSEL7I / CRDSEL1O to CRDSEL7O : Input/Output selection action fields for rows 1 to 7.
  • ACCTNO1O to ACCTNO7O : Output fields for displayed Account Numbers.
  • CRDNUM1O to CRDNUM7O : Output fields for displayed Card Numbers.
  • CRDSTS1O to CRDSTS7O : Output fields for displayed Card Statuses.
  • PAGENOO : Output field for the current page number.
  • INFOMSGO : Output field for informational messages (green/neutral text).
  • ERRMSGO : Output field for error messages (red text).
Backend and Control Fields
  • CARDDEMO-COMMAREA : Shared communication area containing session metadata.
  • CDEMO-USER-ID : Logged-in user identifier.
  • CDEMO-USER-TYPE : User role ( 'A' for Admin, 'U' for User).
  • CDEMO-ACCT-ID : Passed Account ID.
  • CDEMO-CARD-NUM : Passed Card Number.
  • WS-THIS-PROGCOMMAREA : Program-specific state appended to the COMMAREA.
  • WS-CA-FIRST-CARD-NUM / WS-CA-FIRST-CARD-ACCT-ID : Keys of the first record on the current page (used for backward paging).
  • WS-CA-LAST-CARD-NUM / WS-CA-LAST-CARD-ACCT-ID : Keys of the last record on the current page (used for forward paging).
  • WS-CA-SCREEN-NUM : Current page number.
  • WS-CA-LAST-PAGE-DISPLAYED : Flag indicating if the last page has been reached.
  • WS-CA-NEXT-PAGE-IND : Flag indicating if a next page exists.
  • CARD-RECORD : VSAM record structure mapped from CARDDAT .
  • CARD-NUM : Primary key (16-digit card number).
  • CARD-ACCT-ID : Associated 11-digit account ID.
  • CARD-ACTIVE-STATUS : Status flag ( 'Y' / 'N' ).

Exception and Error Handling

CICS Command Exception Handling
  • EXEC CICS STARTBR / READNEXT / READPREV (File: CARDDAT ) :
  • NORMAL / DUPREC : Record successfully processed.
  • ENDFILE : Handled gracefully. Sets CA-NEXT-PAGE-NOT-EXISTS to true and displays "NO MORE RECORDS TO SHOW" . If no records are found on the very first page, it sets WS-NO-RECORDS-FOUND ("NO RECORDS FOUND FOR THIS SEARCH CONDITION.").
  • Other Responses : Captures the response codes in WS-RESP-CD and WS-REAS-CD , formats a system error message using WS-FILE-ERROR-MESSAGE (e.g., "File Error: READ on CARDDAT returned RESP... ,RESP2..." ), and displays it on the screen.
Error Messages and Triggers

| Error Message | Trigger Condition |

| :--- | :--- |

| ACCOUNT FILTER,IF SUPPLIED MUST BE A 11 DIGIT NUMBER | Account ID filter contains non-numeric characters. |

| CARD ID FILTER,IF SUPPLIED MUST BE A 16 DIGIT NUMBER | Card Number filter contains non-numeric characters. |

| PLEASE SELECT ONLY ONE RECORD TO VIEW OR UPDATE | User entered selection characters on more than one row. |

| INVALID ACTION CODE | User entered a character other than 'S', 'U', or space in the selection column. |

| NO PREVIOUS PAGES TO DISPLAY | User pressed PF7 while on page 1. |

| NO MORE PAGES TO DISPLAY | User pressed PF8 when no more records are available. |

| NO RECORDS FOUND FOR THIS SEARCH CONDITION. | No records match the search filters on initial load. |

Security and Authorization Checks

  • No explicit security checks identified : The program does not perform RACF checks or use CICS Sign-on APIs directly.
  • Session-Based Context :
  • The program relies on the application-managed CARDDEMO-COMMAREA passed from previous programs to maintain user context ( CDEMO-USER-ID , CDEMO-USER-TYPE ).
  • When exiting via PF3 or starting a fresh session, the program explicitly sets the user type to standard user ( SET CDEMO-USRTYP-USER TO TRUE ) to ensure standard user privileges are maintained.

Performance Considerations

Manual Scan Filtering (Critical Performance Issue)

The program performs a file browse ( STARTBR and READNEXT / READPREV loops) on the primary KSDS file CARDDAT using the Card Number as the key.

If a user filters by Account ID ( CC-ACCT-ID ), the program still browses the primary file sequentially and filters records in memory ( 9500-FILTER-RECORDS ). This is highly inefficient because it reads every single record in the database from the starting point to find matches for the specified Account ID.

Although the alternate index path constant LIT-CARD-FILE-ACCT-PATH ( 'CARDAIX ' ) is defined in Working-Storage, it is not used in the STARTBR or READ commands. A more performant design would open the browse on the alternate index path ( CARDAIX ) when filtering by Account ID, allowing direct retrieval of only the records associated with that account.

<h2

COCRDSLC

cbl/COCRDSLC.cbl
scanner642 code lines1 calls out0 called by12 copybooks2 filesyes dynamic dispatch
MAT / Gemini

Credit Card Detail Inquiry and Retrieval Program

Credit Card Detail Inquiry and Retrieval Program

The COCRDSLC program is a core business logic component of the CardDemo application designed to facilitate the secure retrieval and display of detailed credit card information. Its primary business purpose is to provide customer service representatives and standard users with a dedicated inquiry interface to view specific card attributes. By entering an account number and a card number, users can instantly access critical cardholder details, including the embossed …

Full MAT analysis

Credit Card Detail Inquiry and Retrieval Program

The COCRDSLC program is a core business logic component of the CardDemo application designed to facilitate the secure retrieval and display of detailed credit card information. Its primary business purpose is to provide customer service representatives and standard users with a dedicated inquiry interface to view specific card attributes. By entering an account number and a card number, users can instantly access critical cardholder details, including the embossed name, card expiration date, and current activation status.

User interaction with the program is designed to be highly flexible and intuitive. Users can either access the detail screen directly from the main menu or be routed to it automatically after selecting a specific card from the Credit Card List screen. When navigating from the list screen, the program automatically carries over the selected account and card numbers, bypassing manual entry and immediately displaying the card details. For manual searches, the program provides an interactive form, allowing users to input search criteria and execute the query, with the option to exit back to the main menu or the calling program at any time using a designated function key.

To maintain high data quality and prevent unnecessary database overhead, the program performs robust validation on all user inputs. It ensures that the entered account number is a non-zero, 11-digit numeric value and that the card number is a valid 16-digit numeric identifier. Once the inputs pass validation, the program queries the primary card database. If a matching card record is found, the screen is populated with the retrieved details. If the search fails to find a match, or if the inputs are malformed, the program dynamically highlights the invalid fields in red and displays clear, descriptive error messages to guide the user.

Behind the scenes, the program is built using a pseudo-conversational design to maximize mainframe performance and support high volumes of concurrent users. It efficiently releases system resources while waiting for user input on the screen. Throughout the user's session, the program maintains state, security roles, and navigation history by passing a shared communication area between screens. This ensures that the user's context is preserved as they navigate between the main menu, the card list, and the detailed card view.

Business Case and User Interaction

Business Case Overview

The COCRDSLC program is the "Credit Card Detail View" component of the CardDemo mainframe application. Its primary business purpose is to retrieve and display detailed information for a specific credit card, including the cardholder's embossed name, card status (active/inactive), and expiration date.

This program supports two primary operational workflows:

  • Direct Inquiry : A business user enters a specific Account ID and Credit Card Number directly on the screen to retrieve card details.
  • List-to-Detail Navigation : A user selects a specific card from the Credit Card List screen ( COCRDLIC ), which automatically transfers control to COCRDSLC with the selection criteria pre-populated, bypassing manual input.
User Interaction and Screen Flow
  • Screen Entry :
  • If accessed from the Main Menu ( COMEN01C ), the screen is displayed with empty input fields, prompting the user to enter search criteria.
  • If accessed from the Credit Card List ( COCRDLIC ), the program automatically retrieves and displays the card details for the selected account and card number.
  • Data Query : The user enters an 11-digit Account ID and a 16-digit Card Number, then presses ENTER .
  • Result Presentation :
  • If the card is found in the database, the system populates the read-only fields (Embossed Name, Status, Expiration Month, and Expiration Year) and displays a success message: "Displaying requested details" .
  • If validation fails or the card is not found, the input fields are highlighted in red, the cursor is positioned at the invalid field, and an error message is displayed at the bottom of the screen.
  • Exit/Navigation : The user can press PF3 to exit the screen and return to the calling program (either the Credit Card List or the Main Menu).

Screen Layout and Navigation

Screen Layout (CCRDSLA)

+-----------------------------------------------------------------------------+

| Tran: CCDL AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COCRDSLC CardDemo Time: HH:MM:SS |

| |

| Credit Card Detail Screen |

| |

| Account Id: [ 12345678901 ] |

| Card Number: [ 1234567890123456 ] |

| |

| Name on Card: [ John Doe ] |

| Card Status: [ A ] |

| Expiration Month: [ 12 ] Expiration Year: [ 2026 ] |

| |

| |

| |

| |

| |

| <INFOMSGI: Displaying requested details > |

| <ERRMSGI: Error messages appear here in red > |

| |

| ENTER=Fetch F3=Back |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu (COMEN01C) |

+------------------------+-------------------------+

|

| (Select Option 4)

v

+--------------------------------------------------+

| Credit Card List (COCRDLIC) |

+------------------------+-------------------------+

|

| (Select Card & Press Enter)

v

+-----------------------------------------------------------------------------+

| Card Detail View (COCRDSLC) |

| |

| 1. Receives Account ID & Card Number via COMMAREA |

| 2. Reads CARDDAT file directly |

| 3. Displays Cardholder Name, Status, and Expiration Date |

+-----------------------------------------------------------------------------+

| |

| [PF3] (If called from List) | [PF3] (If called from Menu)

v v

+---------------------------------+ +--------------------------+

| Credit Card List (COCRDLIC) | | Main Menu (COMEN01C) |

+---------------------------------+ +--------------------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COCRDSLC' | Program identifier |

| LIT-THISTRANID | 'CCDL' | CICS Transaction ID for this program |

| LIT-THISMAPSET | 'COCRDSL ' | BMS Mapset name |

| LIT-THISMAP | 'CCRDSLA' | BMS Map name |

| LIT-CCLISTPGM | 'COCRDLIC' | Program ID of the Credit Card List program |

| LIT-MENUPGM | 'COMEN01C' | Program ID of the Main Menu program |

| LIT-CARDFILENAME | 'CARDDAT ' | VSAM KSDS Card Data File |

| LIT-CARDFILENAME-ACCT-PATH | 'CARDAIX ' | Alternate Index Path for Card Data File (by Account ID) |

Validation Logic

The program performs input validation during pseudo-conversational re-entry ( CDEMO-PGM-REENTER ).

Input Field Validations
  • Account ID Validation ( 2210-EDIT-ACCOUNT ) :
  • Checks if the field is empty, spaces, or contains asterisks ( * ). If so, it sets FLG-ACCTFILTER-BLANK and triggers the error "Account number not provided" .
  • Verifies if the input is strictly numeric. If non-numeric, it flags FLG-ACCTFILTER-NOT-OK and displays "ACCOUNT FILTER,IF SUPPLIED MUST BE A 11 DIGIT NUMBER" .
  • Verifies that the value is non-zero.
  • Card Number Validation ( 2220-EDIT-CARD ) :
  • Checks if the field is empty, spaces, or contains asterisks ( * ). If so, it sets FLG-CARDFILTER-BLANK and triggers the error "Card number not provided" .
  • Verifies if the input is strictly numeric. If non-numeric, it flags FLG-CARDFILTER-NOT-OK and displays "CARD ID FILTER,IF SUPPLIED MUST BE A 16 DIGIT NUMBER" .
  • Verifies that the value is non-zero.
Screen-Level Validations
  • Cross-Field Validation :
  • If both Account ID and Card Number are blank or contain asterisks, the program flags an error and displays "No input received" .
  • Attention Identifier (AID) Validation :
  • ENTER : Initiates input processing and database retrieval.
  • PF3 : Triggers exit processing, returning the user to the calling program.
  • Other Keys : Any other key is treated as invalid. The program defaults the action to ENTER but flags the key as invalid.

Data Elements Processed

Screen Fields
  • ACCTSIDI / ACCTSIDO : Input/Output field for the 11-digit Account ID.
  • CARDSIDI / CARDSIDO : Input/Output field for the 16-digit Card Number.
  • CRDNAMEO : Output field for the cardholder's embossed name (50 characters).
  • CRDSTCDO : Output field for the card status (1 character).
  • EXPMONO : Output field for the card expiration month (2 characters).
  • EXPYEARO : Output field for the card expiration year (4 characters).
  • INFOMSGO : Output field for informational messages (green/neutral text).
  • ERRMSGO : Output field for error messages (red text).
Backend and Control Fields
  • CARDDEMO-COMMAREA : Shared communication area containing session metadata.
  • CDEMO-FROM-PROGRAM : Tracks the calling program to determine where to return on PF3 .
  • CDEMO-ACCT-ID : Passed Account ID from the calling program.
  • CDEMO-CARD-NUM : Passed Card Number from the calling program.
  • CARD-RECORD : VSAM record structure mapped from CARDDAT .
  • CARD-NUM : Primary key (16-digit card number).
  • CARD-ACCT-ID : Associated 11-digit account ID.
  • CARD-CVV-CD : Card verification value.
  • CARD-EMBOSSED-NAME : Name printed on the card.
  • CARD-EXPIRAION-DATE : Expiration date stored as YYYY-MM-DD .
  • CARD-ACTIVE-STATUS : Status flag ( 'Y' / 'N' ).

Exception and Error Handling

CICS Command Exception Handling
  • EXEC CICS READ (File: CARDDAT ) :
  • NORMAL : Card record successfully retrieved. Sets FOUND-CARDS-FOR-ACCOUNT to true.
  • NOTFND : Card number not found in the database. Sets INPUT-ERROR and displays "Did not find cards for this search condition" .
  • Other Responses : Captures the response codes in WS-RESP-CD and WS-REAS-CD , formats a system error message using WS-FILE-ERROR-MESSAGE (e.g., "File Error: READ on CARDDAT returned RESP... ,RESP2..." ), and displays it on the screen.
  • EXEC CICS READ (File: CARDAIX - Alternate Index) :
  • Implemented in paragraph 9150-GETCARD-BYACCT (not actively called in the main execution path but available for alternate index reads).
  • NOTFND : Displays "Did not find this account in cards database" .
Abnormal Condition Responses (ABEND)
  • EXEC CICS HANDLE ABEND :
  • If an unhandled system abend occurs, control is transferred to ABEND-ROUTINE .
  • The program populates ABEND-DATA with the program name ( COCRDSLC ) and an error message ( "UNEXPECTED ABEND OCCURRED." ).
  • It sends this plain text message to the terminal and terminates the transaction with abend code '9999' .

Security and Authorization Checks

  • Application-Level Authorization :
  • The program checks the user type ( CDEMO-USER-TYPE ) passed in the CARDDEMO-COMMAREA .
  • When exiting via PF3 , it explicitly sets CDEMO-USRTYP-USER to TRUE to ensure standard user privileges are maintained upon return to the calling program.
  • Platform Security :
  • No explicit external security manager (such as IBM RACF) checks, transaction security profiles, or standard CICS Sign-on ( CESN / CESF ) integrations are implemented within this program. Security is entirely application-managed via the COMMAREA.

Performance Considerations

  • Pseudo-Conversational Design :
  • The program utilizes a pseudo-conversational model. After sending the map ( EXEC CICS SEND MAP ), it terminates execution and releases system resources by issuing EXEC CICS RETURN with transaction ID CCDL and the communication area. This prevents active tasks from holding CICS threads while waiting for user input.
  • Direct Key Access :
  • Database retrieval is performed via a direct READ on the primary key (Card Number) of the CARDDAT VSAM KSDS file. This is highly efficient and avoids resource-intensive file browsing operations.

<h2

COCRDUPC

cbl/COCRDUPC.cbl
scanner1194 code lines1 calls out0 called by12 copybooks3 filesyes dynamic dispatch
MAT / Gemini

Credit Card Detail Update Program for the CardDemo Application

Credit Card Detail Update Program for the CardDemo Application

The COCRDUPC program is a core business-logic and presentation component of the CardDemo application, designed to facilitate the secure retrieval and modification of credit card account details. From a business perspective, it allows customer service representatives and authorized personnel to search for specific credit cards, view their current status, and update critical information such as the cardholder's embossed name, active status, and …

Full MAT analysis

Credit Card Detail Update Program for the CardDemo Application

The COCRDUPC program is a core business-logic and presentation component of the CardDemo application, designed to facilitate the secure retrieval and modification of credit card account details. From a business perspective, it allows customer service representatives and authorized personnel to search for specific credit cards, view their current status, and update critical information such as the cardholder's embossed name, active status, and expiration date. This ensures that the credit card registry remains accurate, up-to-date, and compliant with business rules.

Users can access this update utility either directly from the main application menu or by selecting a specific card from a search list. When initiating a fresh search, the user must provide a valid account number and credit card number. Once the program successfully retrieves the matching record from the database, it populates the screen with the card's current details, transitioning the interface into an edit mode where authorized fields become modifiable.

To safeguard data integrity, the program enforces strict business validation rules on all user inputs before any database modifications are permitted. The account and card numbers must be strictly numeric and conform to standard lengths. The cardholder's embossed name is validated to ensure it contains only alphabetic characters and spaces, the active status must be a simple 'Y' or 'N' indicator, and the expiration month and year are verified to represent a valid future calendar date. Any validation failures are highlighted in red on the screen with clear, contextual error messages.

A critical feature of this program is its robust concurrency control mechanism, which prevents data corruption in a multi-user environment. When a user submits validated changes, the program temporarily locks the record and performs a comparison between the original data fetched at the start of the session and the current state of the database. If another user has modified the record in the interim, the update is aborted, the user is alerted to the conflict, and the screen is refreshed with the latest database values to prevent accidental overwrites.

Operating under an efficient pseudo-conversational design, the program optimizes mainframe system resources by releasing active threads while waiting for user input. It maintains session state and user context across screen transitions using a shared communication area. Users can seamlessly commit validated updates, cancel pending changes, or navigate back to the main menu or the preceding credit card list screen using standard keyboard function keys.

Business Case and User Interaction

Business Case Overview

The COCRDUPC program is a core business logic and presentation component of the CardDemo application. Its primary business purpose is to allow authorized operators to update credit card details, specifically the cardholder's embossed name, active status, and expiration date.

To ensure data integrity and prevent concurrent update conflicts (lost updates), the program implements an optimistic concurrency control pattern. It reads the record without a lock, allows the user to make modifications, and then performs a secondary verification read with an update lock ( READ UPDATE ) immediately before rewriting the record. If another transaction modified the record in the interim, the update is rejected, and the operator is prompted to review the updated data.

Screen Layouts
Screen 1: Search / Initial Entry Screen (CCRDUPA)

This screen is presented when the program is first executed or after an update has been successfully completed. The operator must provide both the Account ID and the Card Number to retrieve the card details.

+-----------------------------------------------------------------------------+

| Tran: CCUP AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COCRDUPC CardDemo Time: HH:MM:SS |

| |

| Update Credit Card Details |

| |

| Account Id : [ ] |

| Card Number : [ ] |

| |

| Card Name : [ ] |

| Active Status: [ ] |

| Expiry Month: [ ] Expiry Year: [ ] Expiry Day: [ ] |

| |

| |

| |

| |

| |

| Message: Please enter Account and Card Number |

| Error : |

| |

| ENTER=Fetch F3=Exit F12=Cancel |

+-----------------------------------------------------------------------------+

Screen 2: Details Display / Edit Screen

Once a valid Account ID and Card Number are entered and fetched, the card details are displayed. The search key fields become protected (read-only), and the editable fields (Card Name, Active Status, Expiry Month, Expiry Year) become unprotected.

+-----------------------------------------------------------------------------+

| Tran: CCUP AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COCRDUPC CardDemo Time: HH:MM:SS |

| |

| Update Credit Card Details |

| |

| Account Id : 12345678901 |

| Card Number : 4321098765432109 |

| |

| Card Name : [JOHN DOE ] |

| Active Status: [Y] |

| Expiry Month: [12] Expiry Year: [2026] Expiry Day: 01 |

| |

| |

| |

| |

| |

| Message: Details of selected card shown above |

| Error : |

| |

| ENTER=Validate F3=Exit F12=Cancel |

+-----------------------------------------------------------------------------+

Screen 3: Validation / Save Confirmation Screen

After the operator modifies the fields and presses ENTER , the program validates the inputs. If validation succeeds, all input fields are protected, and the operator is prompted to confirm the save operation by pressing PF5 .

+-----------------------------------------------------------------------------+

| Tran: CCUP AWS Mainframe Modernization Date: MM/DD/YY |

| Prog: COCRDUPC CardDemo Time: HH:MM:SS |

| |

| Update Credit Card Details |

| |

| Account Id : 12345678901 |

| Card Number : 4321098765432109 |

| |

| Card Name : JOHN A DOE |

| Active Status: Y |

| Expiry Month: 12 Expiry Year: 2028 Expiry Day: 01 |

| |

| |

| |

| |

| |

| Message: Changes validated.Press F5 to save |

| Error : |

| |

| F5=Save F3=Exit F12=Cancel |

+-----------------------------------------------------------------------------+

Screen Flow and User Navigation

+--------------------------------------------------+

| Main Menu / List |

| (COMEN01C / COCRDLIC) |

+-----------------------+--------------------------+

|

| (Select Update Option / Pass Keys)

v

+--------------------------------------------------+

+----> | Search / Initial Entry | <-----------------+

| | (State: NOT-FETCHED) | |

| +-----------------------+--------------------------+ |

| | |

| | (Enter Keys & Press ENTER) |

| v |

| +--------------------------------------------------+ |

| | Details Display / Edit | |

| | (State: SHOW-DETAILS) | |

| +-----------------------+--------------------------+ |

| | | (PF12 Cancel /

| | (Modify Fields & Press ENTER) | Update Success)

| v |

| +--------------------------------------------------+ |

| | Validation / Confirmation | |

| | (State: OK-NOT-CONFIRMED) | ------------------+

| +-----------------------+--------------------------+

| |

| | (Press PF5 to Save)

| v

| +--------------------------------------------------+

| | Write Processing & Commit |

| | (State: OKAYED-AND-DONE) |

| +-----------------------+--------------------------+

| |

+------------------------------+ (Auto-Reset to Search)

Navigation and Data Flow Description
  • Entry : The program can be invoked directly from the Main Menu ( COMEN01C ) or with pre-populated keys from the Credit Card List program ( COCRDLIC ).
  • Search State : If no keys are passed, the program starts in the CCUP-DETAILS-NOT-FETCHED state. The operator enters the Account ID and Card Number and presses ENTER . The program reads the CARDDAT file. If found, the state transitions to CCUP-SHOW-DETAILS .
  • Edit State : The screen is redisplayed with the card details. The operator can modify the Card Name, Active Status, Expiry Month, and Expiry Year. Pressing ENTER triggers validation.
  • Confirmation State : If validation is successful, the state transitions to CCUP-CHANGES-OK-NOT-CONFIRMED . The screen fields are protected, and the operator is prompted to press PF5 to save or PF12 to cancel.
  • Commit State : Pressing PF5 triggers the write processing. The program locks the record, verifies that no other user has changed it, rewrites the record, and transitions to CCUP-CHANGES-OKAYED-AND-DONE . The screen is then reset to the initial search state with a success message.
  • Exit : Pressing PF3 at any time exits the program and returns control to the calling program or the Main Menu.

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COCRDUPC' | Current Program Name |

| LIT-THISTRANID | 'CCUP' | Current Transaction ID |

| LIT-THISMAPSET | 'COCRDUP ' | Mapset Name |

| LIT-THISMAP | 'CCRDUPA' | Map Name |

| LIT-CCLISTPGM | 'COCRDLIC' | Credit Card List Program Name |

| LIT-MENUPGM | 'COMEN01C' | Main Menu Program Name |

| LIT-CARDFILENAME | 'CARDDAT ' | VSAM Card Data File Name |

| LIT-ALL-ALPHA-FROM | 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' | Source string for alphabetic validation |

| LIT-ALL-SPACES-TO | SPACES (52 spaces) | Target string for alphabetic validation |

Validation Logic

Input Field Validations
Account ID ( ACCTSIDI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must be strictly numeric.
  • Must be an 11-digit non-zero number.
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Account number must be a non zero 11 digit number" is displayed.
Card Number ( CARDSIDI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must be strictly numeric.
  • Must be a 16-digit non-zero number.
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Card number if supplied must be a 16 digit number" is displayed.
Cardholder Name ( CRDNAMEI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must contain only alphabetic characters (A-Z, a-z) and spaces. This is validated by converting all alphabetic characters to spaces using INSPECT CONVERTING and verifying that the remaining trimmed string length is zero.
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Card name can only contain alphabets and spaces" is displayed.
Card Active Status ( CRDSTCDI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must be exactly 'Y' or 'N' .
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Card Active Status must be Y or N" is displayed.
Expiry Month ( EXPMONI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must be numeric and fall within the range of 01 through 12 .
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Card expiry month must be between 1 and 12" is displayed.
Expiry Year ( EXPYEARI )
  • Must be supplied (cannot be spaces, low-values, or asterisks).
  • Must be numeric and fall within the range of 1950 through 2099 .
  • If invalid, the field is highlighted in red, the cursor is positioned on it, and the error message "Invalid card expiry year" is displayed.
Screen-Level Validations and Condition Checks
Attention Identifier (AID) Key Validation
  • PF3 : Allowed at any time to exit the program.
  • PF12 : Allowed to cancel the current operation and reset the screen.
  • PF5 : Only allowed when the program is in the CCUP-CHANGES-OK-NOT-CONFIRMED state (changes validated but not yet saved).
  • ENTER : Used to submit search keys or submit modifications for validation.
  • Any other key is treated as invalid, and the program defaults the action to ENTER .
No Changes Detected Check
  • If the program is in the CCUP-SHOW-DETAILS state and the operator presses ENTER without modifying any of the editable fields (Card Name, Status, Expiry Month, Expiry Year), the program rejects the submission with the message "No change detected with respect to values fetched." .
Optimistic Concurrency Check
  • Before rewriting the record to the VSAM file, the program performs a READ UPDATE to lock the record and compares the current file values against the original values stored in CCUP-OLD-DETAILS .
  • If any field (CVV, Embossed Name, Expiry Year, Expiry Month, Expiry Day, or Active Status) has changed since the initial read, the update is aborted, the state is reset to CCUP-SHOW-DETAILS , and the error message "Record changed by some one else. Please review" is displayed.

Data Elements Processed

Screen Fields (Map CCRDUPA )
  • ACCTSIDI / ACCTSIDO : Input/Output Account ID (11 characters).
  • CARDSIDI / CARDSIDO : Input/Output Card Number (16 characters).
  • CRDNAMEI / CRDNAMEO : Input/Output Cardholder Embossed Name (50 characters).
  • CRDSTCDI / CRDSTCDO : Input/Output Card Active Status (1 character).
  • EXPMONI / EXPMONO : Input/Output Expiry Month (2 characters).
  • EXPYEARI / EXPYEARO : Input/Output Expiry Year (4 characters).
  • EXPDAYI / EXPDAYO : Input/Output Expiry Day (2 characters, protected).
  • INFOMSGO : Output Information Message (40 characters).
  • ERRMSGO : Output Error Message (80 characters).
Commarea Fields ( CARDDEMO-COMMAREA & WS-THIS-PROGCOMMAREA )
  • CDEMO-USER-ID : Logged-in user identifier.
  • CDEMO-USER-TYPE : User role ( 'A' for Admin, 'U' for User).
  • CCUP-CHANGE-ACTION : Current state flag of the update process:
  • LOW-VALUES / SPACES : Details not yet fetched.
  • 'S' : Details fetched and displayed.
  • 'E' : Validation errors found.
  • 'N' : Changes validated, awaiting confirmation.
  • 'C' : Changes successfully committed.
  • 'L' : Lock error during update.
  • 'F' : Update failed.
  • CCUP-OLD-DETAILS : Group item storing the original values of the card record for concurrency verification.
  • CCUP-NEW-DETAILS : Group item storing the newly entered values from the screen.
Database Fields ( CARD-RECORD from CARDDAT )
  • CARD-NUM : Primary key, Card Number (16 characters).
  • CARD-ACCT-ID : Account ID (9-digit numeric, redefined as 11 characters).
  • CARD-CVV-CD : Card Verification Value (3-digit numeric).
  • CARD-EMBOSSED-NAME : Cardholder Name (50 characters).
  • CARD-EXPIRAION-DATE : Expiration Date stored in YYYY-MM-DD format (10 characters).
  • CARD-ACTIVE-STATUS : Active Status flag (1 character).

Exception and Error Handling

CICS Command Exception Handling
  • EXEC CICS HANDLE ABEND : Directs any unhandled program abends to the ABEND-ROUTINE label, which sends an abend screen with the code '9999' and terminates the task.
  • EXEC CICS READ (Initial Read) :
  • NOTFND : Handled gracefully. Sets the error message "Did not find cards for this search condition" and highlights the search fields in red.
  • Other errors: Formats a file error message containing the operation ( READ ), file name ( CARDDAT ), RESP , and RESP2 codes, and displays it in ERRMSGO .
  • EXEC CICS READ UPDATE (Locking Read) :
  • If the record cannot be locked or read, the program sets the error message "Could not lock record for update" and aborts the write sequence.
  • EXEC CICS REWRITE :
  • If the rewrite operation fails, the program sets the error message "Update of record failed" and aborts.
Error Messages and Triggers

| Error Message | Trigger Condition |

| :--- | :--- |

| Account number not provided | Account ID field is blank or contains asterisks on search submission. |

| Card number not provided | Card Number field is blank or contains asterisks on search submission. |

| Card name not provided | Card Name field is blanked out during modification. |

| Card name can only contain alphabets and spaces | Card Name contains numeric or special characters. |

| No input received | Both Account ID and Card Number are blank on search submission. |

| No change detected with respect to values fetched. | Operator pressed ENTER without modifying any fields in edit mode. |

| Account number must be a non zero 11 digit number | Account ID is non-numeric or not 11 digits. |

| Card number if supplied must be a 16 digit number | Card Number is non-numeric or not 16 digits. |

| Card Active Status must be Y or N | Active Status field contains a value other than 'Y' or 'N'. |

| Card expiry month must be between 1 and 12 | Expiry Month is non-numeric or outside the 01-12 range. |

| Invalid card expiry year | Expiry Year is non-numeric or outside the 1950-2099 range. |

| Did not find cards for this search condition | VSAM read returned NOTFND for the specified Card Number. |

| Could not lock record for update | VSAM READ UPDATE failed to acquire an exclusive lock. |

| Record changed by some one else. Please review | Concurrency check failed; the record was modified by another transaction. |

| Update of record failed | VSAM REWRITE returned a non-normal response. |

Security and Authorization Checks

  • No explicit external security checks (such as IBM RACF or standard CICS Signon CESN / CESF integrations) are implemented within this program.
  • Session-Based Authorization : The program relies entirely on the application-managed CARDDEMO-COMMAREA passed from previous programs to maintain user context ( CDEMO-USER-ID , CDEMO-USER-TYPE ).
  • Role Assignment : Upon returning to the calling menu, the program explicitly sets the user type to standard user ( SET CDEMO-USRTYP-USER TO TRUE ).

Performance Considerations

Pseudo-Conversational Design

The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for operator input. After sending a map, it issues an EXEC CICS RETURN specifying the transaction ID CCUP and passing the transaction state in the COMMAREA . This releases CICS thread storage and resources, maximizing concurrent user capacity.

Optimistic Locking Pattern

To prevent long-held locks on the VSAM file ( CARDDAT ), the program reads the record without a lock during the initial fetch ( 9100-GETCARD-BYACCTCARD ).

An exclusive lock is only acquired during the write processing phase ( 9200-WRITE-PROCESSING ) using EXEC CICS READ UPDATE . This lock is held for a minimal duration—only long enough to perform the concurrency comparison and execute the EXEC CICS REWRITE —before being released by the implicit syncpoint at task end. This pattern significantly reduces transaction queuing and deadlocks in high-concurrency environments.

<h2

CODATE01

app-vsam-mq/cbl/CODATE01.cbl
scanner409 code lines9 calls out0 called by6 copybooks0 files
MAT / Gemini

Automated System Date and Time Query Service via IBM MQ

Automated System Date and Time Query Service via IBM MQ

This program serves as an automated utility service within a CICS mainframe environment, designed to provide the current system date and time to requesting client applications. Operating as an asynchronous message consumer, the program processes incoming inquiries via IBM MQ, allowing external or internal systems to synchronize or verify their clocks against the mainframe's authoritative system time.

Upon invocation, which is typically triggered …

Full MAT analysis

Automated System Date and Time Query Service via IBM MQ

This program serves as an automated utility service within a CICS mainframe environment, designed to provide the current system date and time to requesting client applications. Operating as an asynchronous message consumer, the program processes incoming inquiries via IBM MQ, allowing external or internal systems to synchronize or verify their clocks against the mainframe's authoritative system time.

Upon invocation, which is typically triggered automatically when a new message arrives, the program retrieves the identity of the initiating queue. It then establishes connections to three distinct message queues: an input queue for receiving requests, an output queue for sending responses, and a dedicated error queue for logging operational anomalies. This setup ensures that the program can dynamically adapt to the queue that triggered its execution while maintaining a structured path for communication and error reporting.

The core processing logic runs in a continuous loop, fetching request messages from the input queue. For each message retrieved, the program queries the mainframe operating system to obtain the current absolute time. It formats this timestamp into a standardized date (MM-DD-YYYY) and time string, constructs a response message, and dispatches it to the designated reply queue. To maintain message context and ensure the requesting application can match the response to its original request, the program preserves and attaches the original message and correlation identifiers to the reply.

The program continues to process incoming requests until no more messages are available on the input queue, utilizing a short wait interval to detect idle periods. If an error occurs during queue operations or message processing, the program formats a detailed diagnostic message, routes it to the centralized error queue for administrator review, and initiates a shutdown. Once all messages are processed or an unrecoverable error is encountered, the program gracefully closes all active queues and terminates its execution, releasing system resources back to the CICS environment.

Program Analysis: CODATE01

Business Case

The CODATE01 program is an asynchronous, message-driven CICS-MQ service that acts as a centralized system date and time provider. It is designed to run in the background on an IBM Mainframe, triggered automatically when request messages arrive on a designated MQ input queue.

The primary business purpose of this program is to provide a standardized, synchronized mainframe system timestamp to requesting client applications (which may be external systems or other mainframe applications). By offloading this to a dedicated service, the enterprise ensures consistent date and time formatting across integrated systems.

User Interaction and Screen Navigation

CODATE01 is a headless, system-to-system middleware program . It does not feature any user interface, 3270 terminal screens, or direct human interaction.

Interaction Workflow
  • Triggering : An external application puts a request message onto an MQ input queue.
  • CICS Initiation : The arrival of the message triggers the CICS transaction associated with CODATE01 (typically via the CICS-MQ trigger monitor, CKTI ).
  • Processing : CODATE01 reads the request, fetches the system date and time, and formats it.
  • Replying : The program writes the formatted date/time string back to a reply queue.
  • Termination : The program continues to process messages until the input queue is empty, then terminates.
System Interaction Diagram

+-----------------------------------------------------------------+

| Requesting Client Application |

+-------------------------------+---------------------------------+

|

| 1. Sends Request Message

v

+-------------------------------+---------------------------------+

| MQ Input Queue |

+-------------------------------+---------------------------------+

|

| 2. Triggers CICS Transaction

v

+-------------------------------+---------------------------------+

| COBOL Program: CODATE01 |

| |

| - Retrieves Input Queue Name via EXEC CICS RETRIEVE |

| - Opens Input, Reply, and Error Queues |

| - Loops MQGET with 5-second wait |

| - Formats System Date & Time via CICS ASKTIME/FORMATTIME |

+---------------+---------------------------------+---------------+

| |

| 3a. Success: MQPUT | 3b. Failure: MQPUT

v v

+---------------+-----------------+ +-------------+-----------------+

| MQ Reply Queue | | MQ Error Queue |

| (CARD.DEMO.REPLY.DATE) | | (CARD.DEMO.ERROR) |

+---------------------------------+ +---------------------------------+

Data Flow
  • Trigger Data Retrieval : Upon startup, the program issues an EXEC CICS RETRIEVE command to obtain the MQ Trigger Message ( MQTM ). This structure contains the name of the queue that triggered the transaction ( MQTM-QNAME ).
  • Queue Initialization : The program uses the retrieved queue name to open the input queue for reading, and opens the hardcoded reply and error queues for writing.
  • Message Consumption : The program enters a loop, executing MQGET to retrieve messages from the input queue.
  • Date/Time Retrieval : For each message successfully retrieved:
  • It executes EXEC CICS ASKTIME to get the raw absolute system time.
  • It executes EXEC CICS FORMATTIME to convert the absolute time into a readable date ( MM-DD-YYYY ) and time ( HH:MM:SS ).
  • Response Construction : The program concatenates the literal headers with the formatted values into a single string:

"SYSTEM DATE : MM-DD-YYYYSYSTEM TIME : HH:MM:SS"

  • Message Correlation : The program copies the MsgId and CorrelId from the incoming request message descriptor ( MQMD ) into the outgoing message descriptor. This ensures the requesting client can correlate the reply with its original request.
  • Reply Transmission : The program executes MQPUT to write the response string to the reply queue ( CARD.DEMO.REPLY.DATE ).
  • Transaction Commit : An EXEC CICS SYNCPOINT is issued after each message is processed to commit the MQ operations.
Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| REPLY-QUEUE-NAME | 'CARD.DEMO.REPLY.DATE' | The hardcoded MQ queue where successful date/time replies are sent. |

| ERROR-QUEUE-NAME | 'CARD.DEMO.ERROR' | The hardcoded MQ queue where application and MQ error details are logged. |

| MQGMO-WAITINTERVAL | 5000 | The MQ Get Message Option wait interval set to 5,000 milliseconds (5 seconds). |

| MQ-BUFFER-LENGTH | 1000 | The maximum buffer size (1,000 bytes) allocated for MQ messages. |

| LIT-ACCTFILENAME | 'ACCTDAT ' | Hardcoded file name literal (defined but unused in the logic). |

Validation Logic

The program performs several system-level and conditional validations to ensure robust execution:

  • CICS Start Validation : Validates the success of the EXEC CICS RETRIEVE command by checking if WS-CICS-RESP1-CD is equal to DFHRESP(NORMAL) . If the retrieve fails, the program logs the error and terminates.
  • MQ Open Validation : After calling MQOPEN for the input, reply, and error queues, the program validates that MQ-CONDITION-CODE is equal to MQCC-OK . Any other value triggers the error routine.
  • MQ Get Validation : After calling MQGET , the program checks MQ-CONDITION-CODE :
  • If MQCC-OK , it proceeds to process the message.
  • If not MQCC-OK , it checks if MQ-REASON-CODE is MQRC-NO-MSG-AVAILABLE . If true, it gracefully sets the end-of-messages flag ( NO-MORE-MSGS to TRUE ) to exit the processing loop.
  • Any other reason code is treated as a fatal error, triggering the error routine.
  • MQ Put/Close Validation : Every MQPUT and MQCLOSE call is validated against MQ-CONDITION-CODE = MQCC-OK . Failure results in immediate error logging and program termination.
Data Elements Processed

The key data fields and parameters processed by the program include:

  • MQTM-QNAME : The input queue name passed by CICS during transaction initiation.
  • INPUT-QUEUE-NAME : The variable holding the active input queue name.
  • WS-ABS-TIME : A packed decimal field ( PIC S9(15) COMP-3 ) holding the raw absolute system time from CICS.
  • WS-MMDDYYYY : A 10-character field ( PIC X(10) ) holding the formatted system date (e.g., 12-31-2023 ).
  • WS-TIME : An 8-character field ( PIC X(8) ) holding the formatted system time (e.g., 14:30:00 ).
  • MQ-BUFFER : A 1,000-byte alphanumeric field used as the transit buffer for sending and receiving MQ payloads.
  • MQMD-MSGID / SAVE-MSGID : The unique 24-byte Message Identifier used to correlate the reply message.
  • MQMD-CORRELID / SAVE-CORELID : The 24-byte Correlation Identifier used to match the reply to the client's request.
  • MQ-ERR-DISPLAY : A structured group item used to format error details, containing:
  • MQ-ERROR-PARA : The paragraph where the error occurred.
  • MQ-APPL-RETURN-MESSAGE : A descriptive error message.
  • MQ-APPL-CONDITION-CODE : The MQ condition code.
  • MQ-APPL-REASON-CODE : The MQ reason code.
  • MQ-APPL-QUEUE-NAME : The name of the queue associated with the failure.
Exception and Error Handling

CODATE01 implements structured error handling to prevent silent failures and ensure message integrity:

  • CICS Response Codes : Uses the RESP and RESP2 options on CICS commands. If EXEC CICS RETRIEVE fails, the response codes are converted to decimal format, formatted into a string, and sent to the error queue before the program exits.
  • MQ Error Logging : When an MQ call fails (e.g., MQOPEN or MQGET returns a non-zero condition code other than "no message available"), the program:
  • Populates the MQ-ERR-DISPLAY structure with the failing paragraph, MQ condition code, MQ reason code, and queue name.
  • Moves this structure to the MQ buffer.
  • Executes MQPUT to write the error details to the CARD.DEMO.ERROR queue.
  • Calls the termination routine to close any open queues and exit.
  • Double-Fault Protection : If an error occurs while trying to open or write to the error queue itself, the program falls back to a standard DISPLAY MQ-ERR-DISPLAY statement to write the error details directly to the CICS system log (sysout), then terminates immediately.
  • Transactional Rollback : The program utilizes MQ syncpoint options ( MQGMO-SYNCPOINT and MQPMO-SYNCPOINT ) in conjunction with EXEC CICS SYNCPOINT . If the program encounters a fatal error and terminates, CICS will automatically roll back any uncommitted MQ operations, ensuring that the request message is not lost and can be retried or sent to a dead-letter queue by the queue manager.
Security and Authorization Checks
  • No explicit security checks identified : The program does not contain any explicit RACF calls ( EXEC SECU ), transaction security checks, or sign-on validations ( CESN / CESF ).
  • Infrastructure Security : It relies entirely on the underlying CICS transaction security profiles and IBM MQ queue-level authorization checks configured by system administrators.
Performance Considerations
  • IS INITIAL Program Attribute : The program is defined with IS INITIAL in the PROGRAM-ID paragraph. This ensures that the program's Working-Storage Section is reset to its initial state on every execution, preventing memory leaks but introducing a minor overhead for re-initialization.
  • Non-Blocking Wait Interval : The MQGET call uses a 5-second wait interval ( MQGMO-WAITINTERVAL = 5000 ) with the MQGMO-WAIT option. This prevents CPU spinning (busy-waiting) when the queue is temporarily empty, allowing the program to wait efficiently for incoming messages.
  • Shared Input Queue : The input queue is opened with MQOO-INPUT-SHARED . This allows multiple instances of CODATE01 to run concurrently, enabling parallel processing of date/time requests under heavy workloads.
  • Syncpoint Management : By issuing EXEC CICS SYNCPOINT inside the main loop after each message is processed, the program releases locks and commits MQ messages incrementally, preventing long-running units of work (UOWs) from consuming excessive system resources.

<h2

COMEN01C

cbl/COMEN01C.cbl
scanner213 code lines1 calls out1 called by9 copybooks0 filesyes dynamic dispatch
MAT / Gemini

CardDemo Main Application Menu for Regular Users

CardDemo Main Application Menu for Regular Users

The COMEN01C program serves as the central navigation hub for standard, non-administrative users within the CardDemo credit card processing application. Acting as the primary landing page immediately following a successful login, this program presents users with a structured, interactive menu of daily business operations. Its main business purpose is to facilitate seamless navigation across the application's core functional areas while maintaining a secure and …

Full MAT analysis

CardDemo Main Application Menu for Regular Users

The COMEN01C program serves as the central navigation hub for standard, non-administrative users within the CardDemo credit card processing application. Acting as the primary landing page immediately following a successful login, this program presents users with a structured, interactive menu of daily business operations. Its main business purpose is to facilitate seamless navigation across the application's core functional areas while maintaining a secure and consistent user session.

Through this main menu, standard users can access a comprehensive suite of credit card management and financial transaction features. The menu options include viewing and updating customer account details, searching and updating credit card records, and managing financial transactions—such as listing, viewing, and adding new transactions. Additionally, users can navigate to modules for generating transaction reports, processing bill payments, and viewing pending transaction authorizations.

User interaction is designed to be intuitive and robust. The user selects a desired function by entering its corresponding menu number. The program immediately validates the input to ensure it is a valid, active option. It also performs role-based authorization checks to ensure standard users do not accidentally access restricted administrative functions. If the user enters an invalid option, presses an unsupported key, or attempts to access an unauthorized area, the program displays clear, contextual error messages at the bottom of the screen.

Behind the scenes, the program coordinates navigation by dynamically transferring control to the selected sub-application. It utilizes a shared communication area to pass critical session metadata—such as the user's identity, role, and transaction history—ensuring that the user's context is preserved as they move between different screens. The program also features built-in safeguards, such as verifying whether a target module is installed before attempting to load it, and displaying "coming soon" notifications for features currently under development.

To ensure a user-friendly experience, the program allows users to safely exit the menu and return to the main sign-on screen at any time by pressing a designated function key. Operating under a pseudo-conversational design, the program efficiently releases system resources while waiting for user input, optimizing mainframe performance and supporting high concurrent user activity.

CardDemo Main Menu Program ( COMEN01C ) - Business & Technical Description

Business Case and User Interaction
Business Case Overview

The COMEN01C program serves as the primary navigation hub (Main Menu) for regular, non-administrative users of the CardDemo Credit Card Processing Application. Its primary business purpose is to present a structured list of available application functions—such as viewing accounts, updating credit cards, listing transactions, and viewing pending authorizations—and safely route the user to their selected destination.

By acting as a centralized dispatcher, the program ensures that users can seamlessly navigate the application while maintaining their security context, user profile, and session state across different functional modules.

User Interaction and Screen Flow
  • Menu Entry : The user is automatically routed to this menu program ( COMEN01C ) after successful authentication via the Sign-on program ( COSGN00C ), provided their user type is "Regular User" ('U').
  • Screen Presentation : The program displays the COMEN1A map, which dynamically lists up to 11 functional options. The header displays real-time system metadata, including the transaction ID ( CM00 ), program name ( COMEN01C ), current date, and current time.
  • Option Selection : The user types a 1- or 2-digit option number (1 through 11) into the selection field and presses the ENTER key.
  • Routing :
  • If the option is valid and installed, the program transfers control ( EXEC CICS XCTL ) to the corresponding target program, passing the user's session data in the CICS Communication Area ( COMMAREA ).
  • If the option is marked as "coming soon" (dummy program) or is not installed on the CICS region, an appropriate status or error message is displayed at the bottom of the screen, and the menu is redisplayed.
  • Exit : The user can press the PF3 key at any time to exit the menu. This action routes them back to the Sign-on screen ( COSGN00C ).
Screen Layout and Navigation
Screen Layout (COMEN1A)

+-----------------------------------------------------------------------------+

| Tran: CM00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COMEN01C CardDemo Time: hh:mm:ss |

| |

| Main Menu |

| |

| 1. Account View |

| 2. Account Update |

| 3. Credit Card List |

| 4. Credit Card View |

| 5. Credit Card Update |

| 6. Transaction List |

| 7. Transaction View |

| 8. Transaction Add |

| 9. Transaction Reports |

| 10. Bill Payment |

| 11. Pending Authorization View |

| |

| |

| Please select an option : [ ] |

| |

| <ERRMSG: Error or status messages appear here in red/green > |

| |

| ENTER=Continue F3=Exit |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Sign-on Screen |

| (COSGN00C) |

+-----------------------+--------------------------+

|

| (Successful Login - Regular User)

v

+--------------------------------------------------+

| Main Menu Program | <-----------------+

| (COMEN01C) | |

+-----------------------+--------------------------+ |

| |

+------------------+------------------+ |

| [PF3] | [ENTER] (Valid Option) | (XCTL Return /

v v | Invalid Option)

+-----------------------+ +------------------+ |

| Sign-on Screen | | Target Program | |

| (COSGN00C) | | (e.g., COACTVWC) | -----------------+

+-----------------------+ +------------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COMEN01C' | Program identifier |

| WS-TRANID | 'CM00' | CICS Transaction ID associated with this program |

| CDEMO-MENU-OPT-COUNT | 11 | Total number of active menu options |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

| CCDA-MSG-THANK-YOU | 'Thank you for using CardDemo application... ' | Exit message |

Validation Logic
Input Field Validations
  • Option Selection Validation :
  • The program extracts the user input from OPTIONI and trims trailing spaces.
  • Any remaining spaces are replaced with '0' characters to ensure a clean numeric conversion.
  • The input is verified to be strictly numeric. If non-numeric characters are present, the error "Please enter a valid option number..." is displayed.
  • The numeric value must fall within the range of 1 to 11 (defined by CDEMO-MENU-OPT-COUNT ). If the value is 0 or greater than 11 , the error "Please enter a valid option number..." is displayed.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers option validation and program routing.
  • PF3 : Triggers exit processing, transferring control back to COSGN00C .
  • Other Keys : Any other key (e.g., PF1, PF2, PF4, Clear) is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the menu.
Condition Checks
  • Role-Based Authorization Check :
  • The program checks if the current user's role ( CDEMO-USER-TYPE ) is authorized for the selected option.
  • If the user is a standard user ( CDEMO-USRTYP-USER / 'U' ) and the selected option's metadata requires admin privileges ( CDEMO-MENU-OPT-USRTYPE = 'A' ), access is blocked, and the message "No access - Admin Only option... " is displayed.
  • Program Installation Check :
  • For Option 11 ( COPAUS0C ), the program performs a dynamic CICS inquiry ( EXEC CICS INQUIRE PROGRAM ) to verify if the program is installed in the CICS region.
  • If the program is not installed, it prevents the transfer of control and displays "This option Pending Authorization View is not installed..." in red.
  • Dummy Program Check :
  • If the target program name associated with the selected option starts with 'DUMMY' , the program displays "This option [Option Name] is coming soon ..." in green.
Data Elements Processed
Screen Fields
  • TRNNAMEO : Output field for the transaction ID ( CM00 ).
  • PGMNAMEO : Output field for the program name ( COMEN01C ).
  • TITLE01O / TITLE02O : Output fields for screen headers.
  • CURDATEO / CURTIMEO : Output fields for the formatted system date ( MM/DD/YY ) and time ( HH:MM:SS ).
  • OPTN001O through OPTN012O : Output fields displaying the formatted menu option text (e.g., "1. Account View" ).
  • OPTIONI / OPTIONO : Input/Output field for the user's menu selection.
  • ERRMSGO : Output field for error and status messages.
  • ERRMSGC : Attribute byte used to dynamically change the color of the error message (e.g., DFHRED for errors, DFHGREEN for status updates).
Backend and Control Fields
  • CARDDEMO-COMMAREA : The primary CICS Communication Area used to pass session state between programs.
  • CDEMO-FROM-TRANID : Set to 'CM00' before transferring control.
  • CDEMO-FROM-PROGRAM : Set to 'COMEN01C' before transferring control.
  • CDEMO-USER-ID : Retains the logged-in user's ID.
  • CDEMO-USER-TYPE : Retains the user's role ( 'U' for Regular User, 'A' for Admin).
  • CDEMO-PGM-CONTEXT : Set to 0 (Enter context) to signal a fresh entry into the target program.
Exception and Error Handling
CICS Command Exception Handling
  • EXEC CICS INQUIRE PROGRAM :
  • The program utilizes the NOHANDLE option to prevent CICS from abending if the target program is not defined in the CICS System Definition (CSD) file.
  • The response code is captured in EIBRESP . If EIBRESP does not equal DFHRESP(NORMAL) , the program gracefully handles the error by displaying a red error message indicating the option is not installed.
  • EXEC CICS RECEIVE MAP :
  • Response codes are captured using the RESP and RESP2 options into WS-RESP-CD and WS-REAS-CD to ensure structured, inline error handling.
Error Messages Displayed

| Message Text | Color | Trigger Condition |

| :--- | :--- | :--- |

| Invalid key pressed. Please see below... | Red | User pressed an unsupported AID key (not ENTER or PF3). |

| Please enter a valid option number... | Red | User entered a non-numeric value, a value of 0, or a value greater than 11. |

| No access - Admin Only option... | Red | A regular user attempted to select an option reserved for administrators. |

| This option [Option Name] is not installed... | Red | The target program for the selected option is not defined in the CICS region. |

| This option [Option Name] is coming soon ... | Green | The selected option is mapped to a dummy program. |

Security and Authorization Checks
  • Role-Based Authorization :
  • The program performs an application-level authorization check by comparing the user's role ( CDEMO-USER-TYPE from the COMMAREA) against the required user type of the selected menu option ( CDEMO-MENU-OPT-USRTYPE ).
  • Standard users ( 'U' ) are blocked from executing options flagged as Admin-only ( 'A' ).
  • Platform Security :
  • No explicit external security manager (such as IBM RACF) checks, EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program. Security is entirely application-managed via the COMMAREA.
Performance Considerations
  • Pseudo-Conversational Design :
  • The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input.
  • After sending the map, it issues an EXEC CICS RETURN specifying the transaction ID CM00 and passing the CARDDEMO-COMMAREA . This releases CICS resources (such as thread storage) and maximizes concurrent user capacity.
  • Dynamic Program Inquiry :
  • By using EXEC CICS INQUIRE PROGRAM with NOHANDLE before executing XCTL for optional programs, the program avoids costly transaction abends (such as PGMIDERR ), which are resource-intensive for the CICS region to process.

<h2

COPAUA0C

app-authorization-ims-db2-mq/cbl/COPAUA0C.cbl
scanner771 code lines4 calls out0 called by16 copybooks3 files
MAT / Gemini

Card Authorization Decision and Transaction Processing Engine

Card Authorization Decision and Transaction Processing Engine

The COPAUA0C program is a core transactional component of the CardDemo authorization module, designed to evaluate and decide on credit card transaction requests in real time. Operating as an asynchronous, message-driven service within a CICS environment, the program is triggered by incoming messages on a request queue. It processes batches of transaction requests to determine whether a cardholder's purchase should be approved or declined based on credit …

Full MAT analysis

Card Authorization Decision and Transaction Processing Engine

The COPAUA0C program is a core transactional component of the CardDemo authorization module, designed to evaluate and decide on credit card transaction requests in real time. Operating as an asynchronous, message-driven service within a CICS environment, the program is triggered by incoming messages on a request queue. It processes batches of transaction requests to determine whether a cardholder's purchase should be approved or declined based on credit availability and account status.

Upon receiving a transaction request, the program performs a series of data retrieval steps to establish the context of the transaction. It maps the incoming card number to its associated customer and account identifiers using cross-reference files. Once the identifiers are resolved, the program retrieves the master account details, customer profile information, and any existing pending authorization summaries from an IMS database to obtain an accurate, up-to-date financial profile of the cardholder.

The core business logic centers on credit evaluation and risk assessment. The program calculates the cardholder's available credit by subtracting their current balance and pending transactions from their total credit limit. If the requested transaction amount is within the available limit, the transaction is approved; otherwise, it is declined due to insufficient funds. The program also handles fallback scenarios where master account data is used if pending summaries are unavailable, and it assigns specific response codes to communicate the exact reason for any declined transactions, such as inactive accounts or suspected fraud.

After making a decision, the program immediately formats and sends a response message back to the originating system via a reply queue, ensuring minimal latency for the merchant. Concurrently, it updates the system's database of record. It modifies the pending authorization summary with updated balances and transaction counts, and inserts a detailed authorization record containing timestamps, merchant details, and the final decision status for subsequent clearing and settlement matching.

To ensure operational efficiency and system stability, the program processes messages in a controlled loop up to a predefined limit per execution. It incorporates robust error-handling routines that capture database, file, or messaging middleware failures, logging detailed diagnostic information to a centralized system queue. This design guarantees that critical processing errors are recorded for administrative action while maintaining the integrity of the financial transaction stream.

Business Case and Overview

The COPAUA0C program is the core Card Authorization Decision Program within the CardDemo application's Authorization Module. It is designed as an automated, high-performance, message-driven background process running under CICS.

Instead of interacting with human users via 3270 terminal screens, this program processes credit card transaction authorization requests submitted asynchronously by external point-of-sale (POS) or merchant systems.

Core Business Functions:
  • Request Retrieval : Receives transaction authorization requests from an IBM MQ Request Queue.
  • Data Validation & Cross-Referencing : Validates the incoming card number against a cross-reference file ( CCXREF ), retrieves the associated account master record ( ACCTDAT ), and verifies the customer master record ( CUSTDAT ).
  • Credit Limit Evaluation : Retrieves the current pending authorization summary from an IMS database ( PSBPAUTB ). It calculates the available credit limit and evaluates whether the requested transaction amount can be approved.
  • Decisioning : Approves or declines the transaction, assigning standardized response and reason codes.
  • Response Delivery : Sends an immediate CSV-formatted response message back to the caller via an MQ Reply Queue.
  • Audit Trail & Ledger Update : Updates the IMS database with the new authorization summary and inserts a detailed transaction record for audit and matching purposes.

System Interaction and Data Flow

Because COPAUA0C is a background, message-driven program triggered by MQ events, there are no user-facing screens or direct user navigation. The system-to-system interaction and data flow are illustrated below.

System Interaction Diagram

+-----------------------------------------------------------------------+

| External POS / Merchant |

+-----------------------------------+-----------------------------------+

|

1. Send Auth Request (CSV) | 7. Receive Auth Response (CSV)

v

+-----------------------------------------------------------------------+

| IBM MQ Series |

| |

| +--------------------------+ +--------------------------+ |

| | MQ Request Queue | | MQ Reply Queue | |

| +------------+-------------+ +------------^-------------+ |

+----------------|------------------------------------|-----------------+

| |

| 2. Trigger (CKTI) | 6. MQPUT1 (Response)

v |

+-----------------------------------------------------|-----------------+

| CICS Region | |

| | |

| +-------------------------------------------------+-------------+ |

| | Transaction: CP00 Program: COPAUA0C | |

| +------------+--------------------------------------------------+ |

| | |

| |-- 3. Read Request (MQGET) |

| | |

| |-- 4. Read VSAM Files (EXEC CICS READ) |

| | | |

| | +--> CCXREF (Card Cross-Reference) |

| | +--> ACCTDAT (Account Master) |

| | +--> CUSTDAT (Customer Master) |

| | |

| |-- 5. Read/Write IMS DB (EXEC DLI) |

| | | |

| | +--> PAUTSUM0 (Summary Segment - GU/REPL/ISRT) |

| | +--> PAUTDTL1 (Detail Segment - ISRT) |

| | |

| +-- 8. Log Errors (EXEC CICS WRITEQ TD -> CSSL) |

+-----------------------------------------------------------------------+

Data Flow Description
  • Triggering : An external system places a CSV-formatted authorization request on the MQ Request Queue. The CICS MQ Trigger Monitor (CKTI) detects the message and starts transaction CP00 , invoking program COPAUA0C .
  • Initialization : The program retrieves trigger information using EXEC CICS RETRIEVE to identify the request queue name. It then opens the request queue.
  • Message Consumption : The program reads the request message from the queue using MQGET .
  • Parsing : The CSV payload is unstrung into the PENDING-AUTH-REQUEST structure.
  • Validation & Database Lookup :
  • Reads the CCXREF VSAM file to map the card number to an Account ID and Customer ID.
  • Reads the ACCTDAT VSAM file to obtain the account status and credit limits.
  • Reads the CUSTDAT VSAM file to verify customer details.
  • Issues an IMS GU (Get Unique) call to retrieve the PAUTSUM0 segment for the account.
  • Decision Processing : Compares the transaction amount against the available credit.
  • Response Dispatch : Formats the decision into a CSV string and sends it to the MQ Reply Queue using MQPUT1 .
  • Database Update : Updates the IMS PAUTSUM0 summary segment (using REPL or ISRT ) and inserts a new PAUTDTL1 detail segment (using ISRT ).
  • Commit : Issues EXEC CICS SYNCPOINT to commit all VSAM, IMS, and MQ updates for the processed message.
User Navigation

There is no user navigation. The program runs entirely in the background, processing up to 500 messages per execution loop before terminating normally.

Validation Logic

The program performs several layers of validation and condition checks to determine if a transaction should be approved or declined:

Card Cross-Reference Validation :

  • The incoming card number ( PA-RQ-CARD-NUM ) is used to search the CCXREF file.
  • Condition Check : If the card is not found ( DFHRESP(NOTFND) ), the transaction is immediately declined with Response Code 05 and Reason Code 3100 (Card/Account/Customer Not Found).

Account Master Validation :

  • The Account ID retrieved from the cross-reference is used to search the ACCTDAT file.
  • Condition Check : If the account is not found, the transaction is declined with Response Code 05 and Reason Code 3100 .

Customer Master Validation :

  • The Customer ID retrieved from the cross-reference is used to search the CUSTDAT file.
  • Condition Check : If the customer is not found, the transaction is declined with Response Code 05 and Reason Code 3100 .

Credit Limit and Balance Validation :

  • Scenario A: IMS Summary Segment Exists ( FOUND-PAUT-SMRY-SEG ) :
  • Calculates available credit: Available Amount = PA-CREDIT-LIMIT - PA-CREDIT-BALANCE .
  • Condition Check : If PA-RQ-TRANSACTION-AMT > Available Amount , the transaction is declined with Response Code 05 and Reason Code 4100 (Insufficient Funds).
  • Scenario B: IMS Summary Segment Does Not Exist ( NFOUND-PAUT-SMRY-SEG ) :
  • Falls back to the Account Master file.
  • Calculates available credit: Available Amount = ACCT-CREDIT-LIMIT - ACCT-CURR-BAL .
  • Condition Check : If PA-RQ-TRANSACTION-AMT > Available Amount , the transaction is declined with Response Code 05 and Reason Code 4100 .
  • If the account master record is also missing, the transaction is declined.

Data Elements Processed

The following table lists the key data fields, amounts, and parameters used during message processing and database updates:

| Data Element | COBOL Picture | Source / Destination | Description |

| :--- | :--- | :--- | :--- |

| PA-RQ-CARD-NUM | PIC X(16) | MQ Request / CCXREF Key | Credit card number being authorized. |

| PA-RQ-TRANSACTION-AMT | PIC +9(10).99 | MQ Request (CSV) | Requested transaction amount. |

| XREF-ACCT-ID | PIC 9(11) | CCXREF Record | Account ID associated with the card. |

| XREF-CUST-ID | PIC 9(09) | CCXREF Record | Customer ID associated with the card. |

| ACCT-CREDIT-LIMIT | PIC S9(10)V99 | ACCTDAT Record | Total credit limit assigned to the account. |

| ACCT-CURR-BAL | PIC S9(10)V99 | ACCTDAT Record | Current outstanding balance on the account. |

| PA-CREDIT-LIMIT | PIC S9(09)V99 | IMS PAUTSUM0 Segment | Credit limit stored in the authorization summary. |

| PA-CREDIT-BALANCE | PIC S9(09)V99 | IMS PAUTSUM0 Segment | Current balance including pending authorizations. |

| PA-RL-AUTH-RESP-CODE | PIC X(02) | MQ Reply (CSV) | Approval status: 00 (Approved), 05 (Declined). |

| PA-RL-AUTH-RESP-REASON | PIC X(04) | MQ Reply (CSV) | Specific reason code for declines (e.g., 4100 ). |

| PA-RL-APPROVED-AMT | PIC +9(10).99 | MQ Reply (CSV) | The final approved amount (0 if declined). |

Exception and Error Handling

The program implements a robust error-handling mechanism that logs failures to the CICS Transient Data Queue CSSL and terminates processing gracefully on critical errors.

Error Logging Structure ( ERROR-LOG-RECORD )

When an error occurs, the program populates ERROR-LOG-RECORD with:

  • Current Date and Time.
  • Application ID ( CP00 ) and Program ID ( COPAUA0C ).
  • Error Location (e.g., M001 for MQ Open, I001 for IMS Schedule, C001 for VSAM Read).
  • Severity Level ( L = Log, I = Info, W = Warning, C = Critical).
  • Subsystem ( A = App, C = CICS, I = IMS, M = MQ, F = File).
  • Error Codes (CICS Response Codes, MQ Reason Codes, or IMS Status Codes).
  • Error Message and Event Key (e.g., Card Number or Account ID).
Specific Exception Handling Logic

MQ Errors :

  • MQGET No Message : If MQGET returns MQRC-NO-MSG-AVAILABLE (Reason Code 2033 ), it is treated as a normal end-of-queue condition. The program sets NO-MORE-MSG-AVAILABLE to true and exits the processing loop.
  • Other MQ Failures : Any other failure during MQOPEN , MQGET , MQPUT1 , or MQCLOSE logs a critical error and triggers the emergency shutdown routine ( 9990-END-ROUTINE ).

VSAM Errors :

  • Record Not Found ( DFHRESP(NOTFND) ) : Handled as a business exception. The program logs a warning (e.g., A001 for XREF not found), declines the transaction, and continues processing subsequent messages.
  • Other VSAM Failures : Any unexpected CICS response code (e.g., LOCKED , IOERR ) is treated as a critical error, logging the response codes and triggering 9990-END-ROUTINE .

IMS Database Errors :

  • PSB Schedule Failure : If the PSB cannot be scheduled, a critical error ( I001 ) is logged, and the program terminates.
  • Segment Not Found ( GE ) : During a GU call on PAUTSUM0 , a GE status is handled gracefully by setting NFOUND-PAUT-SMRY-SEG to true, allowing the program to fall back to VSAM account data.
  • Other IMS Failures : Any other status code during GU , REPL , or ISRT logs a critical error and terminates the program.

Emergency Shutdown ( 9990-END-ROUTINE ) :

  • Terminates the IMS PSB schedule ( EXEC DLI TERM ).
  • Closes the MQ Request Queue if it is currently open.
  • Issues EXEC CICS RETURN to stop execution immediately, preventing further message processing.

Security and Authorization Checks

  • No explicit security checks identified within the source code.
  • System-Level Security : The program relies on external security managers (such as RACF) to secure CICS transaction CP00 and restrict access to the MQ queues ( WS-REQUEST-QNAME and WS-REPLY-QNAME ) and VSAM datasets.

Performance Considerations

  • Batch Processing Limit : To prevent transaction timeouts, excessive CPU consumption, and long-held database locks, the program limits processing to a maximum of 500 messages ( WS-REQSTS-PROCESS-LIMIT ) per execution.
  • MQ Wait Interval : The MQGET call uses a wait interval of 5000 milliseconds ( WS-WAIT-INTERVAL ). This allows the program to wait briefly for new messages before terminating when the queue becomes empty.
  • Optimized Reply Mechanism : The program uses MQPUT1 to send response messages. MQPUT1 is highly efficient for single-message delivery because it combines open, put, and close operations into a single call.
  • Message Expiry and Persistence : Reply messages are marked as non-persistent ( MQPER-NOT-PERSISTENT ) with a short expiry time of 50 seconds ( MQMD-EXPIRY = 50 ), reducing MQ overhead and preventing queue buildup.
  • Unit of Work Commit ( SYNCPOINT ) : The program issues EXEC CICS SYNCPOINT after processing each individual message. This commits VSAM updates, IMS database inserts/replacements, and MQ messages, releasing database locks quickly and ensuring data consistency.

Important Constants

The following constants are defined in the program's Working-Storage Section:

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGM-AUTH | 'COPAUA0C' | Program Identifier. |

| WS-CICS-TRANID | 'CP00' | CICS Transaction ID. |

| WS-CCXREF-FILE | 'CCXREF ' | Card Cross-Reference VSAM File Name. |

| WS-ACCTFILENAME | 'ACCTDAT ' | Account Master VSAM File Name. |

| WS-CUSTFILENAME | 'CUSTDAT ' | Customer Master VSAM File Name. |

| PSB-NAME | 'PSBPAUTB' | IMS PSB Name for Authorization Database. |

| WS-REQSTS-PROCESS-LIMIT | 500 | Maximum messages processed per execution run. |

| WS-WAIT-INTERVAL | 5000 | MQGET wait time in milliseconds (5 seconds). |

| PA-RL-AUTH-RESP-CODE | '00' / '05' | '00' = Approved, '05' = Declined. |

| PA-RL-AUTH-RESP-REASON | '0000' | Approved transaction reason code. |

| PA-RL-AUTH-RESP-REASON | '3100' | Decline: Card, Account, or Customer not found. |

| PA-RL-AUTH-RESP-REASON | '4100' | Decline: Insufficient Funds. |

<h2

COPAUS0C

app-authorization-ims-db2-mq/cbl/COPAUS0C.cbl
scanner792 code lines2 calls out0 called by14 copybooks3 filesyes dynamic dispatch
MAT / Gemini

Credit Card Pending Transaction Authorization Summary Viewer

Credit Card Pending Transaction Authorization Summary Viewer

The COPAUS0C program serves as an interactive summary dashboard within the CardDemo application, allowing customer service representatives and credit analysts to view pending transaction authorizations for a specific customer account. From a business perspective, this program is critical for real-time credit monitoring, risk management, and customer support. It provides a consolidated view of an account's credit status, including credit limits, cash …

Full MAT analysis

Credit Card Pending Transaction Authorization Summary Viewer

The COPAUS0C program serves as an interactive summary dashboard within the CardDemo application, allowing customer service representatives and credit analysts to view pending transaction authorizations for a specific customer account. From a business perspective, this program is critical for real-time credit monitoring, risk management, and customer support. It provides a consolidated view of an account's credit status, including credit limits, cash limits, current balances, and the total count and amount of approved versus declined authorizations, helping the institution assess credit exposure and address cardholder inquiries promptly.

When a user enters a valid Account ID, the program retrieves and displays the account's financial profile alongside a list of recent pending authorization requests. The screen displays up to five authorization records at a time, showing essential transaction details such as the transaction ID, date, time, transaction type, approval status, and the requested amount. This immediate visibility allows analysts to quickly identify unusual activity, verify recent transaction attempts, and assist customers who may be experiencing issues with card declines at the point of sale.

To facilitate efficient navigation through large volumes of transactions, the program supports robust pagination. Users can scroll forward and backward through multiple pages of pending authorizations using standard function keys (PF7 for Page Up and PF8 for Page Down). The program dynamically tracks the database keys in a shared communication area to maintain the user's context across page boundaries. Furthermore, users can select any individual transaction from the summary list to drill down into its granular details, which automatically transfers control to the Authorization Detail module, or press PF3 to return to the main application menu.

Behind the scenes, the program coordinates complex data retrieval by integrating multiple data sources. It combines core customer demographics, card cross-references, and account balances stored in indexed files with real-time pending authorization records maintained in a hierarchical database. By consolidating this information into a single, cohesive screen, the program eliminates the need for users to navigate multiple systems, significantly improving operational efficiency and reducing response times during customer interactions.

Business Case and User Interaction

Business Case Overview

The COPAUS0C program is an interactive, screen-based CICS application within the CardDemo Authorization Module. Its primary business purpose is to provide a comprehensive summary view of pending transaction authorizations for a specific credit card account.

By aggregating account-level financial metrics (such as credit limits, cash limits, current balances, and approved/declined transaction counts and amounts) and listing individual pending authorization requests, this program enables customer service representatives and credit analysts to monitor account activity, verify pending charges, and identify potential credit or fraud issues in real time.

User Interaction and Screen Flow

Initial Entry :

  • The user can access this screen directly or be routed from the CardDemo Main Menu ( COMEN01C ) with an Account ID already populated in the communication area.
  • If entered with no prior context, the screen displays empty fields, prompting the user to input an Account ID.

Account Search :

  • The user enters an 11-digit Account ID in the Search Acct Id field and presses ENTER .
  • The program validates the input, retrieves the associated customer and account records from VSAM files, and queries the IMS database for pending authorization summaries and details.
  • The screen is populated with customer demographics, account status, credit limits, balances, and a list of up to 5 pending authorizations.

Pagination :

  • PF8 (Forward) : If more than 5 pending authorizations exist, the user presses PF8 to view the next page of transactions.
  • PF7 (Backward) : The user presses PF7 to return to the previous page of transactions.

Detail Drill-Down :

  • To view the granular details of a specific pending authorization, the user types 'S' (or 's' ) in the Sel column next to the desired transaction and presses ENTER .
  • The program transfers control ( XCTL ) to the Authorization Detail program ( COPAUS1C ), passing the selected transaction's unique authorization key.

Exit :

  • The user presses PF3 to exit the summary view and return to the Main Menu ( COMEN01C ).

Screen Layout and Navigation

Screen Layout (COPAU0A)

+-----------------------------------------------------------------------------+

| Tran: CPVS AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COPAUS0C CardDemo Time: hh:mm:ss |

| |

| View Authorizations |

| |

| Search Acct Id: [ ] |

| |

| Name: [ ] Customer Id: [ ] |

| Acct Status: [ ] Addr Line 1: [ ]|

| Addr Line 2: [ ] |

| PH: [ ] Approval # : [ ] Decline #: [ ] |

| |

| Credit Lim: [ ] Cash Lim: [ ] Appr Amt: [ ]|

| Credit Bal: [ ] Cash Bal: [ ] Decl Amt: [ ]|

| |

| Sel Transaction ID Date Time Type A/D STS Amount |

| --- ---------------- -------- -------- ---- --- --- ------------ |

| [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] |

| |

| Type 'S' to View Authorization details from the list |

| <ERRMSG: Error or status messages appear here in red > |

| ENTER=Continue F3=Back F7=Backward F8=Forward |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu (COMEN01C) |

+------------------------+-------------------------+

|

| (Select Option 11)

v

+--------------------------------------------------+

| Authorization Summary (COPAUS0C) | <---------+

+------------------------+-------------------------+ |

| |

+---------------------+---------------------+ |

| [PF3] | [ENTER] (Sel = 'S') | [PF7/PF8] | (PF3 / Back)

v v v |

+-----------------------+ +------------------+ +--------------+ |

| Main Menu (COMEN01C) | | Auth Details | | IMS Database | |

| | | (COPAUS1C) | | (Page Scroll)| ------+

+-----------------------+ +--------+---------+ +--------------+

|

+-----------------------------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGM-AUTH-SMRY | 'COPAUS0C' | Program ID of the Authorization Summary program |

| WS-PGM-AUTH-DTL | 'COPAUS1C' | Program ID of the Authorization Detail program |

| WS-PGM-MENU | 'COMEN01C' | Program ID of the Main Menu program |

| WS-CICS-TRANID | 'CPVS' | CICS Transaction ID associated with this program |

| PSB-NAME | 'PSBPAUTB' | IMS Program Specification Block (PSB) Name |

| PAUT-PCB-NUM | +1 | IMS PCB Offset number |

| WS-CARDXREFNAME-ACCT-PATH | 'CXACAIX ' | VSAM Alternate Index path for Card Cross-Reference |

| WS-ACCTFILENAME | 'ACCTDAT ' | VSAM Account Master File |

| WS-CUSTFILENAME | 'CUSTDAT ' | VSAM Customer Master File |

Validation Logic

Input Field Validations
  • Account ID ( ACCTIDI ) :
  • Must not be spaces or low-values. If empty, sets error: "Please enter Acct Id..." .
  • Must be strictly numeric. If non-numeric, sets error: "Acct Id must be Numeric ..." .
  • Row Selection ( SEL0001I to SEL0005I ) :
  • Checked when the user presses ENTER .
  • If a selection field is populated, it must be 'S' or 's' . Any other character triggers the error: "Invalid selection. Valid value is S" .
  • Only one selection is processed at a time (evaluated sequentially from row 1 to 5).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers input validation, account data retrieval, and detail selection processing.
  • PF3 : Triggers exit processing, returning the user to the Main Menu ( COMEN01C ).
  • PF7 : Triggers backward pagination. Validates that the current page number is greater than 1. If already at page 1, displays: "You are already at the top of the page..." .
  • PF8 : Triggers forward pagination. Verifies if more records exist. If no more records are available, displays: "You are already at the bottom of the page..." .
  • Other Keys : Any other key triggers the error: "Invalid key pressed. Please see below..." .
Condition Checks
  • IMS Status Code Checks :
  • Evaluates DIBSTAT after every database call.
  • ' ' or 'FW' indicates successful execution ( STATUS-OK ).
  • 'GE' or 'GB' indicates segment not found or end of database ( AUTHS-EOF ).
  • VSAM Response Checks :
  • Evaluates WS-RESP-CD after VSAM reads.
  • DFHRESP(NORMAL) indicates successful read.
  • DFHRESP(NOTFND) triggers a specific "not found" error message on the screen.

Data Elements Processed

Screen and Commarea Fields
  • CDEMO-ACCT-ID / WS-ACCT-ID : 11-digit Account ID used as the primary search key.
  • CDEMO-CPVS-PAU-SEL-FLG : Selection flag passed to the detail program ( 'S' ).
  • CDEMO-CPVS-PAU-SELECTED : The unique 8-character authorization key of the selected transaction.
  • CDEMO-CPVS-PAGE-NUM : Current page number for pagination tracking.
  • CDEMO-CPVS-PAUKEY-PREV-PG : Occurs 20 times; stores the starting authorization keys of previous pages for backward scrolling.
  • CDEMO-CPVS-PAUKEY-LAST : Stores the last authorization key processed on the current page.
VSAM Record Fields
  • CARD-XREF-RECORD (Read via Alternate Index CXACAIX using Account ID):
  • XREF-CUST-ID : Customer ID associated with the account.
  • XREF-CARD-NUM : Card number associated with the account.
  • ACCOUNT-RECORD (Read from ACCTDAT using Account ID):
  • ACCT-CREDIT-LIMIT : Total credit limit.
  • ACCT-CASH-CREDIT-LIMIT : Cash advance limit.
  • CUSTOMER-RECORD (Read from CUSTDAT using Customer ID):
  • CUST-FIRST-NAME , CUST-MIDDLE-NAME , CUST-LAST-NAME : Formatted into the screen name field.
  • CUST-ADDR-LINE-1 , CUST-ADDR-LINE-2 , CUST-ADDR-LINE-3 , CUST-ADDR-STATE-CD , CUST-ADDR-ZIP : Formatted into screen address fields.
  • CUST-PHONE-NUM-1 : Customer phone number.
IMS Database Segment Fields
  • PENDING-AUTH-SUMMARY (Root Segment PAUTSUM0 ):
  • PA-ACCT-ID : Account ID key.
  • PA-APPROVED-AUTH-CNT / PA-DECLINED-AUTH-CNT : Counts of approved/declined authorizations.
  • PA-APPROVED-AUTH-AMT / PA-DECLINED-AUTH-AMT : Total amounts of approved/declined authorizations.
  • PA-CREDIT-BALANCE / PA-CASH-BALANCE : Current credit and cash balances.
  • PENDING-AUTH-DETAILS (Child Segment PAUTDTL1 ):
  • PA-AUTHORIZATION-KEY : Composite key containing packed date and time.
  • PA-TRANSACTION-ID : Unique transaction identifier.
  • PA-AUTH-ORIG-DATE / PA-AUTH-ORIG-TIME : Transaction timestamp.
  • PA-AUTH-TYPE : Transaction type (e.g., Purchase, Cash).
  • PA-AUTH-RESP-CODE : Response code ( '00' = Approved, others = Declined).
  • PA-MATCH-STATUS : Match status code.
  • PA-APPROVED-AMT : Transaction amount.

Exception and Error Handling

VSAM File Read Exceptions

The program explicitly captures response codes ( RESP and RESP2 ) for all VSAM operations:

  • DFHRESP(NOTFND) :
  • If the account is not found in the Cross-Reference file: "Account: [ID] not found in XREF file. Resp: [code] Reas: [code]"
  • If the account is not found in the Account Master file: "Account: [ID] not found in ACCT file. Resp: [code] Reas: [code]"
  • If the customer is not found in the Customer Master file: "Customer: [ID] not found in CUST file. Resp: [code] Reas: [code]"
  • Other VSAM Errors :
  • Displays a system error message: "Account/Customer: [ID] System error while reading [FILE] file. Resp: [code] Reas: [code]"
IMS Database Exceptions

The program evaluates the DIBSTAT field after every DLI call:

  • PSB Scheduling Failure : If scheduling the PSB ( PSBPAUTB ) fails, the program displays: " System error while scheduling PSB: Code: [DIBSTAT]"
  • Summary Segment Read Failure : If reading the PAUTSUM0 segment fails with an unexpected status code, displays: " System error while reading AUTH Summary: Code: [DIBSTAT]"
  • Detail Segment Read/Reposition Failure : If reading or repositioning on the PAUTDTL1 segment fails, displays: " System error while reading/repos. AUTH Details: Code: [DIBSTAT]"
CICS Command Failures
  • The program uses explicit response checking ( RESP and RESP2 ) on all CICS commands (such as RECEIVE MAP ) to prevent transaction abends and ensure graceful recovery.

Security and Authorization Checks

  • No explicit security checks identified within the program code.
  • The program does not perform direct RACF checks, transaction security validations, or sign-on checks.
  • It relies entirely on the security context of the calling transaction ( CPVS ) and the CICS region configuration to restrict unauthorized access to the authorization summary functionality.

Performance Considerations

Pseudo-Conversational Design :

  • The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input.
  • After sending the map, it issues an EXEC CICS RETURN specifying the transaction ID CPVS and passing the CARDDEMO-COMMAREA . This releases CICS resources and maximizes concurrent user capacity.

Dynamic PSB Scheduling :

  • The program dynamically schedules the PSB ( PSBPAUTB ) using EXEC DLI SCHD only when database access is required.
  • It releases database locks promptly by performing a syncpoint ( EXEC CICS SYNCPOINT ) before sending the screen to the user terminal, ensuring high concurrency.

Alternate Index (AIX) Path Usage :

  • The program utilizes the alternate index path CXACAIX to read the Card Cross-Reference file by Account ID. This allows direct, high-performance key access and avoids costly sequential file scans.

Efficient Pagination :

  • To support backward scrolling (PF7) without re-scanning the database from the beginning, the program stores the starting authorization keys of previously visited pages in an array ( CDEMO-CPVS-PAUKEY-PREV-PG ) within the COMMAREA .
  • When paging forward (PF8) or backward (PF7), the program uses these saved keys to perform qualified direct reads ( WHERE (PAUT9CTS = PA-AUTHORIZATION-KEY) ) to reposition the database cursor instantly.

<h2

COPAUS1C

app-authorization-ims-db2-mq/cbl/COPAUS1C.cbl
scanner461 code lines2 calls out0 called by10 copybooks0 filesyes dynamic dispatch
MAT / Gemini

Credit Card Transaction Authorization Detail and Fraud Management System

Credit Card Transaction Authorization Detail and Fraud Management System

This program serves as an interactive customer service and fraud analysis tool within the CardDemo application, providing a comprehensive, detailed view of individual credit card transaction authorizations. Operating within a CICS environment, it allows financial analysts and customer service representatives to inspect the exact status and technical details of pending or processed transaction requests. By presenting a clear breakdown of …

Full MAT analysis

Credit Card Transaction Authorization Detail and Fraud Management System

This program serves as an interactive customer service and fraud analysis tool within the CardDemo application, providing a comprehensive, detailed view of individual credit card transaction authorizations. Operating within a CICS environment, it allows financial analysts and customer service representatives to inspect the exact status and technical details of pending or processed transaction requests. By presenting a clear breakdown of transaction parameters, the program helps the institution resolve cardholder inquiries, audit transaction histories, and maintain operational security.

The program retrieves transaction data from an IMS database, combining account-level summaries with specific transaction details. It formats and displays critical information on the user's terminal, including the card number, transaction timestamp, requested and approved amounts, and merchant details such as name, ID, and location. To facilitate quick decision-making, the program automatically translates technical response codes into human-readable descriptions, clearly indicating whether a transaction was approved or declined, and specifying the exact reason for any decline, such as insufficient funds, an inactive card, or suspected fraud.

A core business capability of this program is its direct integration with fraud mitigation workflows. From the detail screen, an authorized user can instantly flag a transaction as fraudulent or reverse a previous fraud designation. When this action is triggered, the program coordinates with a specialized backend fraud management service to update the central database, modifies the local transaction record, and utilizes strict transactional control protocols (commit and rollback) to ensure that database updates are processed reliably and securely.

To optimize the analyst's workflow, the program supports intuitive screen navigation and paging controls. Users can easily return to the primary authorization summary list or page forward to inspect the next sequential authorization record associated with the active account. This seamless navigation allows fraud analysts to rapidly review multiple disputed charges in sequence, significantly reducing investigation times and improving overall operational efficiency.

Business Case and User Interaction

Business Case

The COPAUS1C program is an interactive, screen-based CICS application within the CardDemo Authorization Module. Its primary business purpose is to provide a detailed, read-only view of a specific pending transaction authorization. It also allows authorized users (such as fraud analysts or customer service representatives) to perform two key operational tasks:

  • Fraud Tagging : Toggle the fraud status of a transaction (marking it as fraudulent or removing a previous fraud flag).
  • Sequential Browsing : Page through subsequent authorization records for the same account sequentially.

By providing granular transaction details (including merchant information, point-of-sale entry modes, and response codes) and integrating with the fraud management system, this program helps financial institutions investigate disputed charges, mitigate fraud losses, and maintain cardholder security.

User Interaction and Screen Flow

+---------------------------------------+

| COPAUS0C |

| (Authorization Summary) |

+-------------------+-------------------+

|

| Selects an Auth

v

+---------------------------------------------------------------------------+

| COPAU1A |

| (View Authorization Details) |

+-------------------------------------+-------------------------------------+

|

+------------------------+------------------------+

| (PF3) | (PF5) | (PF8)

v v v

+------------+------------+ +--------+--------+ +------------+------------+

| COPAUS0C | | COPAUS2C | | IMS Database |

| (Authorization Summary) | | (Fraud Service) | | (Read Next Auth Record) |

+-------------------------+ +-----------------+ +-------------------------+

Screen Navigation and Flow
  • Entry : The user arrives at the COPAU1A screen from the Authorization Summary screen ( COPAUS0C ) after selecting a specific authorization record.
  • Viewing Details : The program retrieves the authorization summary and detail records from the IMS database and populates the screen fields.
  • PF3 (Back) : Returns the user to the Authorization Summary screen ( COPAUS0C ).
  • PF5 (Mark/Remove Fraud) : Toggles the fraud status of the current transaction. It calls the backend program COPAUS2C via a CICS LINK to update the central fraud database, updates the local IMS segment, and refreshes the screen with a confirmation message.
  • PF8 (Next Auth) : Retrieves and displays the next sequential authorization detail record for the current account. If the user is already at the last record, an informational message is displayed.

Important Constants

| Constant Value | Field / Variable | Description |

| :--- | :--- | :--- |

| 'COPAUS1C' | WS-PGM-AUTH-DTL | Current Program Identifier |

| 'COPAUS0C' | WS-PGM-AUTH-SMRY | Target Summary Program Identifier |

| 'COPAUS2C' | WS-PGM-AUTH-FRAUD | Backend Fraud Management Program |

| 'CPVD' | WS-CICS-TRANID | CICS Transaction ID |

| 'PSBPAUTB' | PSB-NAME | IMS Program Specification Block (PSB) Name |

| +1 | PAUT-PCB-NUM | IMS PCB Offset |

| '00' | PA-AUTH-APPROVED | Response code indicating an approved transaction |

| 'F' | WS-REPORT-FRAUD | Action code to report/flag a transaction as fraud |

| 'R' | WS-REMOVE-FRAUD | Action code to remove/clear a fraud flag |

| 'S' | WS-FRD-UPDT-SUCCESS | Status indicating successful fraud database update |

| 'F' | WS-FRD-UPDT-FAILED | Status indicating failed fraud database update |

Validation Logic

The program performs several critical validations and condition checks during execution:

Input Parameter Validation :

  • Verifies that the Account ID ( CDEMO-ACCT-ID ) passed in the communication area is numeric.
  • Verifies that the selected Authorization Key ( CDEMO-CPVD-PAU-SELECTED ) is not spaces or low-values.
  • If either check fails, the error flag is set ( WS-ERR-FLG = 'Y' ) and details are not populated.

Response Code Formatting :

  • Evaluates the authorization response code ( PA-AUTH-RESP-CODE ).
  • If the code is '00' (Approved), the screen field AUTHRSPO is set to 'A' and colored green ( DFHGREEN ).
  • For any other code (Declined), AUTHRSPO is set to 'D' and colored red ( DFHRED ).

Decline Reason Lookup :

  • Performs a binary/sequential search ( SEARCH ALL ) on the internal decline reason table ( WS-DECLINE-REASON-TAB ) using the response reason code ( PA-AUTH-RESP-REASON ).
  • If found, it populates the screen with the code and its description (e.g., 4100-INSUFFICNT FUND ).
  • If not found, it defaults the screen display to 9999-ERROR .

Fraud Status Toggle Logic :

  • Evaluates the current fraud status of the record ( PA-FRAUD-CONFIRMED ).
  • If the transaction is already flagged as fraud, it sets the action to remove the flag ( 'R' ).
  • If the transaction is not flagged, it sets the action to report the fraud ( 'F' ).

End-of-Database Check :

  • During sequential browsing (PF8), the program checks the IMS status code ( DIBSTAT ). If it receives 'GE' (Segment Not Found) or 'GB' (End of Database), it sets the end-of-file flag ( AUTHS-EOF ) and displays an informational message to the user.

Data Elements Processed

The program processes the following key data elements during screen interactions and database operations:

Screen and Commarea Fields
  • CDEMO-ACCT-ID / WS-ACCT-ID : Account ID (11-digit numeric).
  • CDEMO-CPVD-PAU-SELECTED / WS-AUTH-KEY : Selected Authorization Key (8-character alphanumeric).
  • CARDNUMO : Credit Card Number displayed on screen (16 characters).
  • AUTHDTO / AUTHTMO : Formatted Authorization Date (MM/DD/YY) and Time (HH:MM:SS).
  • AUTHAMTO : Formatted Authorization Amount (edited numeric -zzzzzzz9.99 ).
  • AUTHRSPO / AUTHRSNO : Authorization Response Status (A/D) and Reason Description.
  • AUTHFRDO : Fraud Status and Report Date displayed on screen (e.g., F-YYYYMMDD ).
IMS Database Segment Fields (Pending Authorizations)
  • PA-ACCT-ID : Account ID key.
  • PA-AUTHORIZATION-KEY : Composite key containing packed date and time.
  • PA-CARD-NUM : Card number associated with the authorization.
  • PA-TRANSACTION-AMT / PA-APPROVED-AMT : Transaction and approved amounts.
  • PA-MATCH-STATUS : Match status flag ( P = Pending, D = Declined, E = Expired, M = Matched).
  • PA-AUTH-FRAUD : Fraud status flag ( F = Confirmed, R = Removed).
  • PA-FRAUD-RPT-DATE : Date the fraud status was updated.
  • Merchant Details : Name, ID, City, State, and Zip code of the merchant.

Exception and Error Handling

IMS Database Exception Handling

The program evaluates the IMS status code ( DIBSTAT ) after every database call:

  • STATUS-OK ( ' ' , 'FW' ) : Execution continues normally.
  • SEGMENT-NOT-FOUND ( 'GE' ) / END-OF-DB ( 'GB' ) : Handled as a standard business condition (sets EOF flag).
  • Other Database Errors : Sets the error flag, formats a descriptive error message containing the specific IMS status code, and displays it in the screen's error message field ( ERRMSGO ):
  • Example : " System error while reading Auth Summary: Code: [DIBSTAT]"
  • Example : " System error while reading Auth Details: Code: [DIBSTAT]"
CICS Link and Transaction Recovery
  • CICS LINK Failures : When linking to COPAUS2C via EXEC CICS LINK , the program uses the NOHANDLE option. If the link fails (i.e., EIBRESP is not NORMAL ), the program executes a rollback ( EXEC CICS SYNCPOINT ROLLBACK ) to ensure database integrity.
  • Fraud Update Failures : If the backend program COPAUS2C returns a failed update status ( WS-FRD-UPDT-FAILED ), the program displays the returned error message ( WS-FRD-ACT-MSG ) and performs a rollback.
  • IMS Update Failures : If the REPL call to update the IMS segment fails, the program performs a rollback and displays:
  • " System error while FRAUD Tagging, ROLLBACK||[DIBSTAT]"
User Input Errors
  • Invalid Keys : If the user presses an unsupported key, the program retains the current screen data, sets the cursor, and displays:
  • "Invalid key pressed. Please see below... "

Security and Authorization Checks

  • No explicit security checks identified within the program code.
  • The program does not perform direct RACF checks, transaction security validations, or sign-on checks.
  • It relies entirely on the security context of the calling transaction ( CPVD ) and the CICS region configuration to restrict unauthorized access to the authorization detail and fraud tagging functionalities.

Performance Considerations

Dynamic PSB Scheduling :

  • The program dynamically schedules the PSB ( PSBPAUTB ) using EXEC DLI SCHD only when database access is required.
  • If the PSB is already scheduled, it terminates and reschedules it to prevent conflicts.
  • It releases database locks promptly by performing a syncpoint ( EXEC CICS SYNCPOINT ) after completing read or update operations.

Efficient Sequential Browsing :

  • For the "Next Auth" function (PF8), the program utilizes an unqualified EXEC DLI GNP (Get Next in Parent) call.
  • Because the parent segment ( PAUTSUM0 ) is already established during the initial read, the database engine can rapidly retrieve the next child segment ( PAUTDTL1 ) sequentially without the overhead of re-evaluating fully qualified search arguments.

Transaction Integrity :

  • Explicit use of EXEC CICS SYNCPOINT and EXEC CICS SYNCPOINT ROLLBACK ensures that database locks are held for the shortest time possible, minimizing database contention in high-concurrency environments.

<h2

COPAUS2C

app-authorization-ims-db2-mq/cbl/COPAUS2C.cbl
scanner201 code lines0 calls out0 called by2 copybooks0 files
MAT / Gemini

CardDemo Credit Card Authorization Fraud Management Program

CardDemo Credit Card Authorization Fraud Management Program

The primary business purpose of this program is to manage and record fraudulent activity associated with credit card transaction authorizations within the CardDemo application. It serves as a backend service that processes requests to either flag a transaction as fraudulent or reverse a previous fraud designation. By maintaining an accurate registry of disputed transactions, the program helps the financial institution mitigate risk, protect cardholders, …

Full MAT analysis

CardDemo Credit Card Authorization Fraud Management Program

The primary business purpose of this program is to manage and record fraudulent activity associated with credit card transaction authorizations within the CardDemo application. It serves as a backend service that processes requests to either flag a transaction as fraudulent or reverse a previous fraud designation. By maintaining an accurate registry of disputed transactions, the program helps the financial institution mitigate risk, protect cardholders, and maintain security standards.

Upon receiving a request, the program extracts comprehensive transaction details, including the account and customer identifiers, card number, transaction amounts, and merchant information. It performs necessary date and time conversions to reconstruct the exact timestamp of the original authorization. This ensures that the transaction can be uniquely identified and accurately recorded in the database, with the current system date marked as the fraud reporting date.

The program first attempts to register the transaction as a new entry in the central fraud tracking database. If the transaction has not been flagged before, a new record is created containing all the relevant transaction details, the merchant's location and identity, and the specified fraud status. This automated entry streamlines the auditing process for disputed charges.

In cases where the transaction has already been registered in the database, the program automatically detects the duplicate entry and switches to an update mode. Instead of failing, it modifies the existing record to reflect the updated fraud status—such as confirming or removing the fraud flag—and refreshes the reporting date to the current date. Once the database operation is complete, the program returns a success or error message to the calling system, ensuring seamless integration with the user interface.

Business Case and User Interaction

Business Case

The COPAUS2C program is a backend service within the CardDemo Authorization Module. Its primary business function is to manage the fraud status of credit card transactions. It allows the system to either flag a pending transaction as fraudulent ('F') or clear/remove a fraud flag ('R').

This program acts as an "Upsert" (Update or Insert) service for the CARDDEMO.AUTHFRDS DB2 table. When a fraud analyst or customer service representative interacts with a front-end screen to report or resolve fraud, the front-end application calls COPAUS2C via a CICS LINK or XCTL passing the transaction details. COPAUS2C then:

  • Attempts to insert a new fraud record into the database.
  • If the record already exists (indicated by a duplicate key SQL error), it updates the existing record with the new fraud status and reporting date.
User Interaction and Screen Flow

COPAUS2C is a non-interactive, program-to-program (backend) CICS program . It does not directly send or receive BMS maps (screens) to an end-user terminal. Instead, it is invoked by a parent UI program (such as an Authorization Inquiry or Fraud Management screen) which handles the user interface.

Screen and User Interaction Diagram

+-----------------------------------------------------------------------+

| Calling Program (UI) |

| (e.g., Fraud Management / Auth Inquiry Screen) |

+-----------------------------------+-----------------------------------+

|

CICS LINK with DFHCOMMAREA Data

v

+-----------------------------------------------------------------------+

| COPAUS2C |

| (Fraud Status Update Service) |

+-----------------------------------+-----------------------------------+

|

1. Attempt SQL INSERT

|

+--------------+--------------+

| |

[SQLCODE = 0] [SQLCODE = -803]

| (Duplicate Key)

| |

| v

| 2. Attempt SQL UPDATE

| |

| +------+------+

| | |

| [SQLCODE=0] [SQLCODE!=0]

v v v

(Add Success) (Updt Success) (Updt Error)

| | |

+--------------+-------+-------------+

|

Return Status & Message in COMMAREA

v

+-----------------------------------------------------------------------+

| Calling Program (UI) |

| (Displays Success/Error Message to the User) |

+-----------------------------------------------------------------------+

Data Flow Between Screens
  • Input Flow : The calling program populates the DFHCOMMAREA with the account ID, customer ID, transaction details (from the IMS pending authorization segment), and the requested action ( WS-FRD-ACTION set to 'F' or 'R').
  • Processing : COPAUS2C processes the request, interacts with the DB2 database, and updates the status fields in the DFHCOMMAREA ( WS-FRD-UPDATE-STATUS and WS-FRD-ACT-MSG ).
  • Output Flow : COPAUS2C returns control to the calling program. The calling program reads the returned status and message from the DFHCOMMAREA and displays a success or error message to the user on the terminal screen.
User Navigation
  • The user does not navigate directly to or from COPAUS2C .
  • Navigation is controlled entirely by the calling program. Once COPAUS2C completes its execution, it issues an EXEC CICS RETURN to hand control back to the calling program, which remains on the active user screen.
Important Constants

| Constant Value | Field / Variable | Description |

| :--- | :--- | :--- |

| 'COPAUS2C' | WS-PGMNAME | Program Identifier |

| 'F' | WS-REPORT-FRAUD / WS-FRD-ACTION | Action code to report/flag a transaction as fraud |

| 'R' | WS-REMOVE-FRAUD / WS-FRD-ACTION | Action code to remove/clear a fraud flag |

| 'S' | WS-FRD-UPDT-SUCCESS | Status indicating the database operation succeeded |

| 'F' | WS-FRD-UPDT-FAILED | Status indicating the database operation failed |

| 'ADD SUCCESS' | WS-FRD-ACT-MSG | Message returned when a new fraud record is successfully inserted |

| 'UPDT SUCCESS' | WS-FRD-ACT-MSG | Message returned when an existing fraud record is successfully updated |

| 0 | SQLCODE | SQL execution successful |

| -803 | SQLCODE | SQL duplicate key error (Unique Constraint Violation) |

Validation Logic

Because COPAUS2C is a backend service, it assumes that basic data format validations have been performed by the calling program. However, it performs several critical data transformations and conditional checks:

Action Code Validation :

  • Evaluates WS-FRD-ACTION to determine whether to flag the transaction as fraud ( 'F' ) or remove the flag ( 'R' ).

Timestamp Reconstruction :

  • The program reconstructs the original transaction timestamp ( WS-AUTH-TS ) from the IMS segment fields:
  • Extracts Year ( WS-AUTH-YY ), Month ( WS-AUTH-MM ), and Day ( WS-AUTH-DD ) from PA-AUTH-ORIG-DATE .
  • Decodes the inverted time key: WS-AUTH-TIME = 999999999 - PA-AUTH-TIME-9C .
  • Extracts Hours ( WS-AUTH-HH ), Minutes ( WS-AUTH-MI ), Seconds ( WS-AUTH-SS ), and Milliseconds ( WS-AUTH-SSS ) from the decoded time.
  • This reconstructed timestamp is validated and formatted into a DB2-compatible timestamp using the DB2 TIMESTAMP_FORMAT function: 'YY-MM-DD HH24.MI.SSNNNNNN' .

Database Write Validation (Upsert Logic) :

  • Insert Check : The program first attempts to insert the record. If SQLCODE = 0 , the write is valid and complete.
  • Duplicate Key Check : If SQLCODE = -803 , the program detects that the record already exists and branches to the FRAUD-UPDATE paragraph to perform an update instead.
  • Update Check : In the update paragraph, it verifies that SQLCODE = 0 to confirm the update succeeded.
Data Elements Processed

The following key data elements are passed via the DFHCOMMAREA and processed by the program:

Input Elements (from Calling Program)
  • WS-ACCT-ID : Account ID (11-digit numeric).
  • WS-CUST-ID : Customer ID (9-digit numeric).
  • PA-CARD-NUM : Credit card number (16-character alphanumeric).
  • PA-AUTH-ORIG-DATE : Original authorization date (6-character YYMMDD).
  • PA-AUTH-TIME-9C : Inverted authorization time (9-digit packed decimal).
  • PA-AUTH-TYPE : Type of authorization (4-character alphanumeric).
  • PA-CARD-EXPIRY-DATE : Card expiration date (4-character alphanumeric).
  • PA-TRANSACTION-AMT : Transaction amount (packed decimal with 2 decimal places).
  • PA-APPROVED-AMT : Approved transaction amount (packed decimal with 2 decimal places).
  • PA-MERCHANT-ID : Merchant identifier (15-character alphanumeric).
  • PA-MERCHANT-NAME : Merchant name (22-character alphanumeric).
  • WS-FRD-ACTION : Requested action ('F' = Report Fraud, 'R' = Remove Fraud).
Output Elements (Returned to Calling Program)
  • PA-FRAUD-RPT-DATE : Date the fraud was reported (8-character formatted date).
  • WS-FRD-UPDATE-STATUS : Status of the update operation ('S' = Success, 'F' = Failed).
  • WS-FRD-ACT-MSG : Descriptive result message (up to 50 characters) containing success confirmation or detailed DB2 error codes.
Exception and Error Handling

COPAUS2C implements robust error handling to prevent transaction abends and return meaningful diagnostics to the calling program:

CICS Command Exception Handling :

  • The EXEC CICS ASKTIME and EXEC CICS FORMATTIME commands utilize the NOHANDLE option. This ensures that if a CICS-level exception occurs during time retrieval or formatting, the program will not abend and will continue execution.

DB2 SQL Exception Handling :

  • Duplicate Key ( SQLCODE = -803 ) : This is handled as a normal business exception. The program automatically recovers by executing the FRAUD-UPDATE paragraph.
  • Other SQL Errors : If any other database error occurs during INSERT or UPDATE (e.g., connection loss, table locked, resource unavailable):
  • The update status is set to failed: SET WS-FRD-UPDT-FAILED TO TRUE (sets WS-FRD-UPDATE-STATUS to 'F' ).
  • The program captures the specific SQLCODE and SQLSTATE .
  • A formatted error message is constructed and returned in WS-FRD-ACT-MSG :
  • For Insert Errors: ' SYSTEM ERROR DB2: CODE:[SQLCODE], STATE: [SQLSTATE]'
  • For Update Errors: ' UPDT ERROR DB2: CODE:[SQLCODE], STATE: [SQLSTATE]'
Security and Authorization Checks
  • No explicit security checks identified within this program.
  • COPAUS2C does not perform any direct RACF checks, transaction security validations, or sign-on checks (CESN/CESF).
  • It relies entirely on the security context of the calling transaction/program and the CICS region configuration to restrict unauthorized access to the fraud management functionality.
Performance Considerations

Upsert Pattern Efficiency :

  • The program uses an "Insert-else-Update" pattern. This is highly efficient if the majority of transactions processed are being flagged for fraud for the first time (resulting in a successful insert on the first try). If most transactions are updates, an "Update-else-Insert" pattern would be more performant to avoid the overhead of handling -803 SQL exceptions.

Timestamp Inversion :

  • The calculation 999999999 - PA-AUTH-TIME-9C is a classic mainframe performance design pattern. Inverting the timestamp allows database indexes (especially in legacy IMS or DB2 structures) to store the most recent transactions at the beginning of the index, optimizing retrieval times for recent activity.

Use of NOHANDLE :

  • Using NOHANDLE on CICS system calls avoids the overhead of CICS establishing and tearing down condition-handling blocks.

<h2

CORPT00C

cbl/CORPT00C.cbl
scanner498 code lines3 calls out0 called by8 copybooks0 filesyes dynamic dispatch
MAT / Gemini

Online Transaction Report Submission Gateway

Online Transaction Report Submission Gateway

The CORPT00C program serves as an online gateway within the CardDemo application, enabling business users to initiate the generation and printing of comprehensive transaction reports. Instead of running resource-intensive report generation directly within the interactive online session, this program bridges the gap between the user interface and the system's background processing capabilities. It allows users to request reports on demand, which are then queued and …

Full MAT analysis

Online Transaction Report Submission Gateway

The CORPT00C program serves as an online gateway within the CardDemo application, enabling business users to initiate the generation and printing of comprehensive transaction reports. Instead of running resource-intensive report generation directly within the interactive online session, this program bridges the gap between the user interface and the system's background processing capabilities. It allows users to request reports on demand, which are then queued and processed efficiently in the background without degrading online system performance.

Through an intuitive interactive screen, users can choose from three distinct reporting periods: Monthly, Yearly, or a Custom date range. Selecting a Monthly or Yearly report automatically calculates the appropriate start and end dates based on the current system date. For more targeted analysis, the Custom option allows users to manually input specific start and end dates, providing the flexibility needed to audit transactions for precise, user-defined timeframes.

To ensure data integrity and prevent downstream processing errors, the program performs rigorous validation on all user inputs. When a custom date range is specified, the system verifies that the entered months, days, and years are numeric and represent valid calendar dates. Once the inputs are validated, the program requires an explicit confirmation from the user before proceeding, safeguarding against accidental or duplicate report submissions.

Upon receiving user confirmation, the program dynamically prepares a background job script. It injects the selected date parameters into a predefined job template and writes this payload to a specialized system queue that acts as an internal reader. This action triggers a background batch job to compile and print the transaction report, allowing the online user to immediately return to other tasks while the system handles the heavy lifting.

Seamlessly integrated into the CardDemo ecosystem, the program maintains user session context and security roles throughout the interaction. Users can easily navigate back to the main application menu once a report is submitted, or exit directly to the sign-on screen. This design ensures a smooth, responsive user experience that optimizes system resources and supports high volumes of concurrent business activity.

Business Case and User Interaction

Business Case Overview

The CORPT00C program is an online CICS COBOL application within the CardDemo system that allows authorized users to request and print transaction reports. To prevent long-running, resource-intensive reporting queries from blocking the online CICS region, the program offloads the report generation to an asynchronous batch job.

When a user requests a report, the program dynamically constructs a Job Control Language (JCL) stream in memory, injects user-specified date parameters, and submits the JCL to the JES spool via an extra-partition Transient Data Queue (TDQ) named JOBS (which is mapped to the JES internal reader). This design ensures a highly responsive online user experience while leveraging the mainframe's batch processing capabilities for heavy data retrieval.

The program supports three reporting options:

  • Monthly Report : Automatically calculates and submits a report for the current calendar month (from the 1st day to the last day of the current month).
  • Yearly Report : Automatically calculates and submits a report for the current calendar year (from January 1st to December 31st).
  • Custom Report : Allows the user to input a specific start and end date range, which is validated online before job submission.
User Interaction and Screen Flow
  • Menu Entry : The user navigates to the Transaction Reports screen from the CardDemo Main Menu ( COMEN01C ) by selecting Option 9.
  • Screen Presentation : The program displays the CORPT0A map. The header displays system metadata (Transaction ID CR00 , Program ID CORPT00C , current date, and current time). The selection fields for Monthly, Yearly, and Custom reports are displayed as empty input fields.
  • Report Selection :
  • Monthly/Yearly : The user types any non-space character in the selection field next to "Monthly" or "Yearly" and presses ENTER .
  • Custom : The user types any non-space character in the selection field next to "Custom", enters the Start Date ( MM/DD/YYYY ) and End Date ( MM/DD/YYYY ) in the designated input fields, and presses ENTER .
  • Confirmation : Before submitting the job, the program prompts the user for confirmation by displaying a message: Please confirm to print the [Report Type] report... . The cursor is positioned on the confirmation field.
  • The user must enter Y or y to confirm, or N or n to cancel.
  • Submission & Feedback :
  • If confirmed, the JCL is written to the JOBS TDQ, and a green success message is displayed: [Report Type] report submitted for printing ... .
  • If cancelled, the input fields are cleared, and the screen is reset.
  • Exit : The user can press PF3 at any time to exit the screen and return to the Main Menu ( COMEN01C ).

Screen Layout and Navigation

Screen Layout (CORPT0A)

+-----------------------------------------------------------------------------+

| Tran: CR00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: CORPT00C CardDemo Time: hh:mm:ss |

| |

| Transaction Reports |

| |

| [ ] Monthly (Current Month) |

| |

| [ ] Yearly (Current Year) |

| |

| [ ] Custom (Date Range) |

| |

| Start Date : [ ] / [ ] / [ ] (MM/DD/YYYY) |

| End Date : [ ] / [ ] / [ ] (MM/DD/YYYY) |

| |

| |

| The Report will be submitted for printing. Please confirm: [ ] (Y/N) |

| |

| <ERRMSG: Error or status messages appear here in red/green > |

| |

| ENTER=Continue F3=Back |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Main Menu Screen |

| (COMEN01C) |

+-----------------------+--------------------------+

|

| (Select Option 9)

v

+--------------------------------------------------+

| Transaction Reports Screen | <----------------+

| (CORPT00C) | |

+-----------------------+--------------------------+ |

| |

+------------------+------------------+ |

| [PF3] | [ENTER] (Valid Input) | (Re-display /

v v | Error / Cancel)

+-----------------------+ +------------------+ |

| Main Menu Screen | | Prompt Confirm | ----------------+

| (COMEN01C) | | (Y/N Field) |

+-----------------------+ +--------+---------+

|

| (Confirm = 'Y')

v

[Write JCL to TDQ]

|

v

[Submit Batch Job]

Data Flow Between Screens
  • COMEN01C to CORPT00C : Preserves the user session context by passing the CARDDEMO-COMMAREA via the CICS COMMAREA .
  • CORPT00C to CSUTLDTC : Passes the formatted date string ( YYYY-MM-DD ) and the format mask ( YYYY-MM-DD ) to the date utility program to validate calendar integrity.
  • CORPT00C to COMEN01C : Returns control to the main menu when the user presses PF3 , passing back the updated CARDDEMO-COMMAREA .
  • CORPT00C to COSGN00C : If the program is initiated directly without an active session ( EIBCALEN = 0 ), it automatically redirects the user to the Sign-on screen.

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'CORPT00C' | Program identifier |

| WS-TRANID | 'CR00' | CICS Transaction ID associated with this program |

| WS-TRANSACT-FILE | 'TRANSACT' | Transaction file identifier |

| WS-DATE-FORMAT | 'YYYY-MM-DD' | Standard date format mask used for validation |

| JOBS | 'JOBS' | Extra-partition Transient Data Queue (TDQ) name for job submission |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • Report Type Selection :
  • The user must select exactly one report type (Monthly, Yearly, or Custom) by entering a non-space character in the corresponding selection field ( MONTHLYI , YEARLYI , or CUSTOMI ).
  • If no report type is selected, the program displays: Select a report type to print report... .
  • Custom Date Fields :
  • If the Custom report is selected, the program ensures that none of the start date ( SDTMMI , SDTDDI , SDTYYYYI ) or end date ( EDTMMI , EDTDDI , EDTYYYYI ) fields are empty or contain low-values.
  • If any field is empty, a targeted error message is displayed (e.g., Start Date - Month can NOT be empty... ), and the cursor is positioned on the missing field.
  • Numeric and Range Checks :
  • Date inputs are converted to numeric values using FUNCTION NUMVAL-C .
  • Month fields must be numeric and less than or equal to 12 .
  • Day fields must be numeric and less than or equal to 31 .
  • Year fields must be strictly numeric.
  • If any check fails, a descriptive error is displayed (e.g., Start Date - Not a valid Month... ).
  • Calendar Integrity Validation :
  • The program formats the input dates into YYYY-MM-DD and calls the utility program CSUTLDTC to perform calendar validation (e.g., checking for leap years and correct days per month).
  • If CSUTLDTC returns a severity code other than '0000' (excluding warning code '2513' ), the program rejects the input and displays: Start Date - Not a valid date... or End Date - Not a valid date... .
  • Confirmation Validation :
  • The confirmation field ( CONFIRMI ) must contain Y , y , N , or n .
  • If empty, the program prompts: Please confirm to print the [Report Type] report... .
  • If N or n is entered, the transaction is cancelled, fields are initialized, and the screen is reset.
  • If any other character is entered, the program displays: "[Value]" is not a valid value to confirm... .
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers input validation, date calculations, and job submission.
  • PF3 : Safely exits the program and transfers control back to COMEN01C .
  • Other Keys : Any other key is rejected with the error message Invalid key pressed. Please see below... .
Condition Checks
  • Session Validation : Checks EIBCALEN . If it is 0 , the user is redirected to COSGN00C to prevent unauthorized access bypassing the login screen.

Data Elements Processed

Screen and Input Fields
  • MONTHLYI / MONTHLYO : Input selection for Monthly report.
  • YEARLYI / YEARLYO : Input selection for Yearly report.
  • CUSTOMI / CUSTOMO : Input selection for Custom report.
  • SDTMMI / SDTDDI / SDTYYYYI : Input fields for Custom Start Date (Month, Day, Year).
  • EDTMMI / EDTDDI / EDTYYYYI : Input fields for Custom End Date (Month, Day, Year).
  • CONFIRMI / CONFIRMO : Input confirmation flag ( Y/N ).
  • ERRMSGO : Output field for error and status messages.
  • ERRMSGC : Attribute byte used to dynamically change the color of the error message (e.g., DFHRED for errors, DFHGREEN for success).
Backend and Control Fields
  • PARM-START-DATE-1 / PARM-START-DATE-2 : Dynamic JCL parameters populated with the calculated or input start date.
  • PARM-END-DATE-1 / PARM-END-DATE-2 : Dynamic JCL parameters populated with the calculated or input end date.
  • JCL-RECORD : 80-character buffer used to write JCL lines sequentially to the TDQ.
  • JOB-LINES : Redefined array containing the template JCL statements.
  • CARDDEMO-COMMAREA : The primary CICS Communication Area used to maintain session state.

Exception and Error Handling

CICS Command Exception Handling
  • EXEC CICS WRITEQ TD :
  • The program writes JCL records to the JOBS queue.
  • It captures the response code in WS-RESP-CD and the reason code in WS-REAS-CD using the RESP and RESP2 options.
  • If the response is not DFHRESP(NORMAL) , the program displays a red error message: Unable to Write TDQ (JOBS)... and outputs the response and reason codes to the CICS log for diagnostics.
  • EXEC CICS RECEIVE MAP :
  • Captures response codes inline using RESP and RESP2 to handle map failures gracefully without abending the transaction.
Error Messages Displayed

| Message Text | Color | Trigger Condition |

| :--- | :--- | :--- |

| Invalid key pressed. Please see below... | Red | User pressed an unsupported AID key. |

| Select a report type to print report... | Red | User pressed ENTER without selecting Monthly, Yearly, or Custom. |

| Start Date - Month can NOT be empty... | Red | Custom report selected but Start Month is blank. |

| Start Date - Not a valid Month... | Red | Start Month is non-numeric or greater than 12. |

| Start Date - Not a valid date... | Red | Start Date failed calendar validation in CSUTLDTC . |

| "[Value]" is not a valid value to confirm... | Red | User entered an invalid character in the confirmation field. |

| Unable to Write TDQ (JOBS)... | Red | CICS failed to write the JCL record to the Transient Data Queue. |

| [Report Type] report submitted for printing ... | Green | JCL successfully written to the TDQ. |

Security and Authorization Checks

  • Session Verification :
  • The program verifies that EIBCALEN is greater than 0 . If a user attempts to execute the transaction directly (e.g., typing CR00 on a blank screen without logging in), the program intercepts the request and redirects them to the Sign-on screen ( COSGN00C ).
  • Platform Security :
  • No explicit external security manager (such as IBM RACF) checks, EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program. Security is entirely application-managed via the COMMAREA.

Performance Considerations

  • Pseudo-Conversational Design :
  • The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input.
  • After sending the map, it issues an EXEC CICS RETURN specifying the transaction ID CR00 and passing the CARDDEMO-COMMAREA . This releases CICS resources (such as thread storage) and maximizes concurrent user capacity.
  • Asynchronous Batch Offloading :
  • By offloading the transaction report generation to a batch job via the JOBS TDQ, the program avoids executing heavy, resource-intensive file reads and formatting loops within the online CICS region. This prevents transaction timeouts and preserves online performance.
  • Efficient TDQ Writing :
  • The program loops through the JCL template array in memory and writes 80-byte records sequentially to the extra-partition TDQ. This is a low-overhead operation compared to direct database or file updates.

<h2

COSGN00C both engines ✓

cbl/COSGN00C.cbl
scanner172 code lines2 calls out0 called by8 copybooks1 files
Quarry LLM

Displays the CardDemo signon screen, validates entered user ID/password against the security file, and routes the user into the admin or general menu based on their user type.

Business rules
  • {"claim": "On initial entry (no commarea), the program forces display of the signon map with the cursor positioned at the User ID field rather than processing any input.", "confidence": 0.9, "evidence": [{"file": "COSGN00C.cbl", "lines": "80-83"}]}
  • {"claim": "Both User ID and Password fields are mandatory; if either is blank/low-values the signon is rejected with a field-specific message and cursor repositioned to the offending field.", "confidence": 0.9, "evidence": [{"file": "COSGN00C.cbl", "lines": "117-130"}]}
  • {"claim": "User ID and password entered on the screen are uppercased before being used for lookup/comparison, making signon case-insensitive as typed.", "confidence": 0.85, "evidence": [{"file": "COSGN00C.cbl", "lines": "132-136"}]}
  • {"claim": "Successful signon requires an exact match between the entered password and the password stored in the USRSEC record for that user ID; a match populates the shared commarea (from-tranid, from-program, user id, user type) for downstream programs.", "confidence": 0.9, "evidence": [{"file": "COSGN00C.cbl", "lines": "211-227"}]}
  • {"claim": "User type drives navigation: admin-typed users are transferred to COADM01C, all other users to COMEN01C, both via CICS XCTL carrying the commarea.", "confidence": 0.9, "evidence": [{"file": "COSGN00C.cbl", "lines": "230-240"}]}
  • {"claim": "A CICS READ RESP code of 13 (NOTFND) is treated distinctly from other error codes, giving a 'User not found' message versus a generic 'Unable to verify the User' for any other failure.", "confidence": 0.85, "evidence": [{"file": "COSGN00C.cbl", "lines": "221-256"}]}
MAT / Gemini

CardDemo Application Sign-on and User Authentication Gateway

CardDemo Application Sign-on and User Authentication Gateway

The COSGN00C program serves as the secure entry point and primary sign-on gateway for the CardDemo credit card management application. Its main business purpose is to authenticate users attempting to access the system and route them to the appropriate functional areas based on their assigned security privileges. By acting as the initial gatekeeper, the program ensures that only authorized personnel can interact with the application's sensitive financial …

Full MAT analysis

CardDemo Application Sign-on and User Authentication Gateway

The COSGN00C program serves as the secure entry point and primary sign-on gateway for the CardDemo credit card management application. Its main business purpose is to authenticate users attempting to access the system and route them to the appropriate functional areas based on their assigned security privileges. By acting as the initial gatekeeper, the program ensures that only authorized personnel can interact with the application's sensitive financial and administrative features.

Upon initial execution, the program initializes a standardized sign-on screen. This interface displays a professional header containing real-time system metadata—such as the current date, time, transaction identifier, and system name—alongside input fields for the User ID and Password. To facilitate a smooth user experience, the program automatically positions the cursor on the User ID field, ready for the user to input their credentials.

When a user submits their credentials, the program performs immediate input validation to ensure both the User ID and Password fields are populated. If any required information is missing, it alerts the user with a targeted message and highlights the incomplete field. Once basic validation passes, the program queries a secure user registry file. It handles various authentication outcomes by displaying clear, contextual error messages on the screen if the user is not found, if the password is incorrect, or if a general system verification error occurs.

Following successful authentication, the program determines the user's access level, distinguishing between administrative personnel and standard business users. It populates a shared communication area with the authenticated user's profile details and session context. The program then seamlessly transfers control to the appropriate landing page: administrators are routed to the Administration Menu, while standard users are directed to the Main Application Menu.

In addition to credential verification, the program manages basic screen navigation and exit procedures. Users can gracefully exit the sign-on screen at any time by pressing the designated exit key, which triggers a friendly departure message and terminates the session. Any unrecognized keyboard inputs are intercepted with an invalid key warning, ensuring the application remains robust and user-friendly from the very first interaction.

Business Case and User Interaction

Business Case Overview

The COSGN00C program serves as the centralized Signon (Login) screen for the CardDemo Credit Card Processing Application. It acts as the secure gateway to the application, authenticating users against a VSAM security file ( USRSEC ) and routing them to the appropriate functional menu based on their assigned user role (Administrator or Regular User).

User Interaction and Screen Flow
  • Initial Entry : The user initiates the transaction (typically via transaction code CC00 ). The program displays the signon screen ( COSGN0A ) with empty fields for User ID and Password, placing the cursor on the User ID field.
  • Credential Input : The user enters their 8-character User ID and 8-character Password. The password field is masked on the screen for security.
  • Submission : The user presses the ENTER key to submit their credentials.
  • Authentication & Routing :
  • If authentication is successful and the user is an Administrator (User Type 'A'), the program transfers control to the Admin Menu ( COADM01C ).
  • If authentication is successful and the user is a Regular User (User Type 'U'), the program transfers control to the Main Menu ( COMEN01C ).
  • If authentication fails, an error message is displayed at the bottom of the screen, and the cursor is positioned on the invalid field.
  • Exit : The user can press PF3 at any time to exit the application. The screen is cleared, a thank-you message is displayed, and the transaction terminates.

Screen Layout and Navigation

Screen Layout (COSGN0A)

+-----------------------------------------------------------------------------+

| Tran: CC00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COSGN00C CardDemo Time: hh:mm:ss |

| AppID: APPLID SysID: SYSID |

| |

| This is a Credit Card Demo Application for Mainframe Modernization |

| |

| +========================================+ |

| |%%%%%%% NATIONAL RESERVE NOTE %%%%%%%%| |

| |%(1) THE UNITED STATES OF KICSLAND (1)%| |

| |%$$ ___ $$%| |

| |%$ {x} (o o) $%| |

| |%$ ( V ) O N E $%| |

| |%(1) ---m-m--- (1)%| |

| |%%~~~~~~~~~~~ ONE DOLLAR ~~~~~~~~~~~~~%%| |

| +========================================+ |

| |

| Type your User ID and Password, then press ENTER: |

| |

| User ID : [ ] (8 Char) |

| Password : [] (8 Char) |

| |

| <ERRMSG: Error messages appear here in red > |

| |

| ENTER=Sign-on F3=Exit |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+------------------+

| CICS Terminal |

+--------+---------+

|

| (Transaction CC00 / EIBCALEN = 0)

v

+------------------+

| COSGN00C | <----------------------------------+

| (Signon Program) | |

+--------+---------+ |

| |

| (Presents COSGN0A Map) |

v |

+------------------+ |

| COSGN0A Map | |

+--------+---------+ |

| |

+---[PF3]---> (Exit / Plain Text Message) |

| |

+---[ENTER]--> [Validate Inputs] |

| |

| (If Invalid) |

+------------------------+

|

| (If Valid Inputs)

v

[Read USRSEC VSAM File]

|

+---(User Not Found / Wrong Pwd)---+

| |

| (Success & Admin) v

+---> [XCTL to COADM01C]

|

| (Success & Regular User)

+---> [XCTL to COMEN01C]

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COSGN00C' | Program identifier |

| WS-TRANID | 'CC00' | CICS Transaction ID associated with this program |

| WS-USRSEC-FILE | 'USRSEC ' | VSAM KSDS file containing user security records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-THANK-YOU | 'Thank you for using CardDemo application... ' | Exit message displayed on PF3 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported keys |

Validation Logic

Input Field Validations
  • User ID Validation :
  • Must not be spaces or low-values.
  • If empty, the program sets WS-ERR-FLG to 'Y' , displays the message "Please enter User ID ..." , and positions the cursor on the User ID field ( USERIDL = -1 ).
  • Password Validation :
  • Must not be spaces or low-values.
  • If empty, the program sets WS-ERR-FLG to 'Y' , displays the message "Please enter Password ..." , and positions the cursor on the Password field ( PASSWDL = -1 ).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Initiates credential validation and sign-on processing.
  • PF3 : Initiates exit processing, displaying a thank-you message and terminating the transaction.
  • Other Keys : Any other key (e.g., PF1, PF2, PF4, Clear) is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the signon screen.
Condition Checks
  • Case Normalization : Both the entered User ID and Password are automatically converted to uppercase using the FUNCTION UPPER-CASE intrinsic function before performing file lookups or comparisons.
  • Password Matching : The entered password (converted to uppercase) is compared directly against the password retrieved from the VSAM file ( SEC-USR-PWD ). If they do not match, the error "Wrong Password. Try again ..." is displayed, and the cursor is positioned on the Password field.

Data Elements Processed

Screen and Input Fields
  • USERIDI / USERIDO : User ID entered on the screen (up to 8 characters).
  • PASSWDI / PASSWDO : Password entered on the screen (up to 8 characters, masked).
  • ERRMSGO : Error message field at the bottom of the screen.
Backend and Control Fields
  • SEC-USR-ID : Key field used to read the USRSEC VSAM file.
  • SEC-USR-PWD : Stored password retrieved from the USRSEC file.
  • SEC-USR-TYPE : Stored user role/type retrieved from the USRSEC file:
  • 'A' : Administrator
  • 'U' : Regular User
  • CDEMO-FROM-TRANID : Set to 'CC00' to pass the originating transaction ID to the next program.
  • CDEMO-FROM-PROGRAM : Set to 'COSGN00C' to pass the originating program name to the next program.
  • CDEMO-USER-ID : Set to the authenticated User ID to maintain session state.
  • CDEMO-USER-TYPE : Set to the authenticated user's role to maintain authorization state.
  • CDEMO-PGM-CONTEXT : Set to 0 (Enter context) to signal a fresh entry into the next program.

Exception and Error Handling

CICS File Read Exception Handling

The program explicitly checks the CICS response code ( WS-RESP-CD ) after attempting to read the USRSEC VSAM file:

  • WS-RESP-CD = 0 (Normal) : The record was successfully found. The program proceeds to password verification.
  • WS-RESP-CD = 13 (Not Found / DFHRESP(NOTFND) ) : The User ID does not exist in the security file. The program sets WS-ERR-FLG to 'Y' , displays "User not found. Try again ..." , and positions the cursor on the User ID field.
  • WS-RESP-CD = Other : Any other error (e.g., file closed, record locked, or hardware error). The program sets WS-ERR-FLG to 'Y' , displays "Unable to verify the User ..." , and positions the cursor on the User ID field.
CICS Command Failures

The program utilizes explicit response checking ( RESP and RESP2 options) on all file operations rather than relying on global EXEC CICS HANDLE CONDITION statements. This ensures structured, inline error handling and prevents unexpected program abends.

Security and Authorization Checks

  • Authentication : Performed by matching the uppercase representation of the user-entered password against the stored password ( SEC-USR-PWD ) in the USRSEC VSAM file.
  • Role-Based Authorization :
  • Users with SEC-USR-TYPE equal to 'A' (Admin) are authorized to access the Administration Menu ( COADM01C ).
  • Users with SEC-USR-TYPE equal to 'U' (Regular User) are authorized to access the standard Main Menu ( COMEN01C ).
  • Platform Security : No explicit external security manager (such as RACF) checks, EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program. Security is entirely application-managed.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the next transaction ID ( CC00 ) and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption and maximizes concurrent user capacity.
  • Efficient VSAM Access : The read operation on the USRSEC file is a direct key read ( RIDFLD ), which is highly efficient and avoids resource-intensive browse operations.

<h2

COTRN00C

cbl/COTRN00C.cbl
scanner529 code lines2 calls out0 called by8 copybooks3 filesyes dynamic dispatch
MAT / Gemini

CardDemo Transaction List: Interactive Credit Card Transaction Portal

CardDemo Transaction List: Interactive Credit Card Transaction Portal

The COTRN00C program serves as the interactive transaction listing and browsing portal within the CardDemo credit card processing application. Its primary business purpose is to provide customer service representatives, auditors, and financial analysts with a structured, paginated view of all credit card transactions recorded in the system. By presenting transaction histories in an accessible format, the program enables staff to monitor …

Full MAT analysis

CardDemo Transaction List: Interactive Credit Card Transaction Portal

The COTRN00C program serves as the interactive transaction listing and browsing portal within the CardDemo credit card processing application. Its primary business purpose is to provide customer service representatives, auditors, and financial analysts with a structured, paginated view of all credit card transactions recorded in the system. By presenting transaction histories in an accessible format, the program enables staff to monitor financial activities, verify postings, and quickly locate specific records.

Upon entering the screen, users are presented with a clean, tabular list displaying up to ten transactions at a time, complete with transaction IDs, dates, descriptions, and amounts. The program supports intuitive navigation, allowing users to scroll forward and backward through the transaction ledger using standard function keys. To streamline searches within large volumes of data, users can input a specific Transaction ID to jump directly to that point in the ledger, bypassing manual scrolling.

A key feature of this program is its seamless integration with the detailed transaction inquiry module. From the list, a user can select any individual transaction by entering a selection code next to it. The program then automatically transfers control to the Transaction Viewer program, passing the selected transaction's details so the user can immediately inspect comprehensive merchant, cardholder, and processing information without re-entering data.

To maintain high data quality and a smooth user experience, the program features robust input validation and user feedback mechanisms. It ensures that search queries are valid and numeric, preventing system errors before they occur. If a user attempts an invalid action, presses an unsupported key, or reaches the boundaries of the transaction file, the program displays clear, contextual messages at the bottom of the screen to guide their next steps.

Operating as a core component of the CardDemo suite, the program maintains strict session security and context. It coordinates closely with the Main Menu and Sign-on screens, ensuring that user roles and security permissions are preserved as operators navigate through the system. Its efficient, resource-conscious design ensures rapid response times and high availability, even when processing large volumes of concurrent transaction queries.

COTRN00C - CardDemo Transaction List Program

Business Case and User Interaction
Business Case Overview

The COTRN00C program is an essential component of the CardDemo credit card processing application. Its primary business purpose is to provide a paginated, scrollable list of financial transactions retrieved from the transaction master file ( TRANSACT ).

This program allows customer service representatives, billing administrators, and financial auditors to:

  • Browse Transactions : View a high-level summary of transactions (up to 10 per page), including Transaction ID, Date, Description, and Amount.
  • Search by Transaction ID : Initiate a targeted search by entering a specific Transaction ID to start browsing the list from that point forward.
  • Select for Detailed View : Select a specific transaction from the list to view its complete details by transferring control to the Transaction Viewer program ( COTRN01C ).
  • Navigate Pages : Scroll forward (PF8) and backward (PF7) through the transaction database.
User Interaction and Screen Flow
  • Screen Entry : The user enters the transaction list screen either from the Main Menu ( COMEN01C ) by selecting Option 6, or directly via transaction code CT00 .
  • Initial Display : The program performs a browse operation on the TRANSACT VSAM file starting from the beginning (or from a passed key) and displays the first 10 records.
  • Searching : The user can type a numeric Transaction ID in the "Search Tran ID" field and press ENTER . The list will refresh, starting with the specified ID (or the next closest match).
  • Selecting a Transaction : The user can type S or s in the selection field ( Sel ) next to any of the 10 displayed transactions and press ENTER . The program will transfer control ( EXEC CICS XCTL ) to COTRN01C to display the detailed transaction view.
  • Pagination :
  • PF8 (Forward) : Displays the next 10 transactions.
  • PF7 (Backward) : Displays the previous 10 transactions.
  • Exit : The user can press PF3 to return to the Main Menu ( COMEN01C ).
Screen Layout and Navigation
Screen Layout (COTRN0A)

+-----------------------------------------------------------------------------+

| Tran: CT00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COTRN00C CardDemo Time: hh:mm:ss |

| |

| List Transactions Page: 00000001 |

| |

| Search Tran ID: [ ] |

| |

| Sel Transaction ID Date Description Amount |

| --- ---------------- -------- ------------------------- ------------ |

| [ ] 0000000000000001 12/31/22 Gas Station Purchase $ 45.50 |

| [ ] 0000000000000002 12/31/22 Grocery Store $ 120.10 |

| [ ] 0000000000000003 01/01/23 Online Retailer $ 15.99 |

| [ ] 0000000000000004 01/01/23 Restaurant $ 85.00 |

| [ ] 0000000000000005 01/02/23 Coffee Shop $ 4.75 |

| [ ] 0000000000000006 01/02/23 Utility Bill $ 150.00 |

| [ ] 0000000000000007 01/03/23 Streaming Service $ 14.99 |

| [ ] 0000000000000008 01/03/23 Department Store $ 210.45 |

| [ ] 0000000000000009 01/04/23 Pharmacy $ 32.20 |

| [ ] 0000000000000010 01/04/23 Gym Membership $ 50.00 |

| |

| Type 'S' to View Transaction details from the list |

| |

| <ERRMSG: Error or status messages appear here in red > |

| |

| ENTER=Continue F3=Back F7=Backward F8=Forward |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| Sign-on Screen |

| (COSGN00C) |

+-----------------------+--------------------------+

|

| (If EIBCALEN = 0)

v

+--------------------------------------------------+

| Main Menu Program |

| (COMEN01C) |

+-----------------------+--------------------------+

|

| (Select Option 6)

v

+--------------------------------------------------+

+----> | Transaction List Screen | <----+ (PF7/PF8 Scroll)

| | (COTRN00C) | -----+

| +-----------------------+--------------------------+

| |

| | (Select Row with 'S' + ENTER)

| v

| +--------------------------------------------------+

| | Transaction View Screen |

| | (COTRN01C) |

| +-----------------------+--------------------------+

| |

+------------------------------+ (PF3 Back)

Data Flow Between Screens
  • CARDDEMO-COMMAREA : This shared memory block is passed between programs during XCTL transfers to maintain session state.
  • CDEMO-FROM-PROGRAM : Tracks the calling program name ( COTRN00C ) so that pressing PF3 in COTRN01C returns the user to the list.
  • CDEMO-FROM-TRANID : Tracks the calling transaction ID ( CT00 ).
  • CDEMO-CT00-TRNID-FIRST : Stores the first Transaction ID displayed on the current page. Used as the starting key for backward scrolling (PF7).
  • CDEMO-CT00-TRNID-LAST : Stores the last Transaction ID displayed on the current page. Used as the starting key for forward scrolling (PF8).
  • CDEMO-CT00-PAGE-NUM : Tracks the current page number.
  • CDEMO-CT00-NEXT-PAGE-FLG : A flag ('Y'/'N') indicating if there are more records beyond the current page.
  • CDEMO-CT00-TRN-SELECTED : Holds the Transaction ID selected by the user. This is passed to COTRN01C for detailed lookup.
Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COTRN00C' | Program identifier |

| WS-TRANID | 'CT00' | CICS Transaction ID associated with this program |

| WS-TRANSACT-FILE | 'TRANSACT' | Name of the VSAM KSDS file containing transaction records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic
Input Field Validations
  • Search Transaction ID ( TRNIDINI ) :
  • If the field is populated, it must be strictly numeric.
  • If non-numeric characters are entered, the program sets WS-ERR-FLG to 'Y' , displays the error message "Tran ID must be Numeric ..." , and positions the cursor on the search field ( TRNIDINL = -1 ).
  • If the field is empty or contains low-values, the program defaults the search key to low-values to start browsing from the beginning of the file.
  • Row Selection Fields ( SEL0001I to SEL0010I ) :
  • Only one row should be selected at a time.
  • The selection character must be 'S' or 's' .
  • If an invalid character is entered, the program displays the error message "Invalid selection. Valid value is S" .
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Processes search inputs or row selections.
  • PF3 : Transfers control back to the Main Menu ( COMEN01C ).
  • PF7 : Triggers backward pagination.
  • PF8 : Triggers forward pagination.
  • Other Keys : Any other key is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the screen.
Condition Checks
  • First-Time Entry Check : The program checks CDEMO-PGM-CONTEXT . If it is not set to 1 (re-entry), it initializes the screen, sets the page number to 0, and performs an initial forward browse.
  • Boundary Checks :
  • Top of File : If the user is on Page 1 and presses PF7 , the program blocks the action and displays "You are already at the top of the page..." .
  • Bottom of File : If the user is on the last page (where CDEMO-CT00-NEXT-PAGE-FLG is 'N' ) and presses PF8 , the program blocks the action and displays "You are already at the bottom of the page..." .
Data Elements Processed
Screen Fields
  • TRNIDINI / TRNIDINO : Input/Output field for the Search Transaction ID.
  • PAGENUMI / PAGENUMO : Output field for the current page number.
  • SEL0001I to SEL0010I : Input fields for selecting a transaction row.
  • TRNID01O to TRNID10O : Output fields displaying the 16-character Transaction IDs.
  • TDATE01O to TDATE10O : Output fields displaying the formatted transaction dates ( MM/DD/YY ).
  • TDESC01O to TDESC10O : Output fields displaying the transaction descriptions.
  • TAMT001O to TAMT010O : Output fields displaying the formatted transaction amounts.
  • ERRMSGO : Output field for error and status messages.
Backend and Control Fields
  • TRAN-RECORD : The record structure mapping the TRANSACT VSAM file.
  • TRAN-ID : Key field used for VSAM browse operations ( STARTBR , READNEXT , READPREV ).
  • TRAN-AMT : Packed-decimal transaction amount ( S9(09)V99 ) read from the file.
  • WS-TRAN-AMT : Numeric-edited working storage field ( +99999999.99 ) used to format the amount before screen display.
  • TRAN-ORIG-TS : Timestamp field used to extract and format the transaction date.
Exception and Error Handling
CICS Command Exception Handling

The program uses explicit response code checking ( RESP and RESP2 ) on all CICS file control commands instead of global HANDLE CONDITION statements.

EXEC CICS STARTBR (Start Browse) :

  • DFHRESP(NORMAL) : Browse successfully initiated.
  • DFHRESP(NOTFND) : The starting key was not found. The program sets the EOF flag, displays "You are at the top of the page..." , and redisplays the screen.
  • Other Responses : The program displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup transaction..." .

EXEC CICS READNEXT (Read Next Record) :

  • DFHRESP(NORMAL) : Record successfully retrieved.
  • DFHRESP(ENDFILE) : End of file reached. The program sets the EOF flag, displays "You have reached the bottom of the page..." , and redisplays the screen.
  • Other Responses : The program displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup transaction..." .

EXEC CICS READPREV (Read Previous Record) :

  • DFHRESP(NORMAL) : Record successfully retrieved.
  • DFHRESP(ENDFILE) : Beginning of file reached. The program sets the EOF flag, displays "You have reached the top of the page..." , and redisplays the screen.
  • Other Responses : The program displays the response and reason codes, sets WS-ERR-FLG to 'Y' , and displays "Unable to lookup transaction..." .
Error Messages Displayed

| Message Text | Trigger Condition |

| :--- | :--- |

| Tran ID must be Numeric ... | User entered non-numeric characters in the Search Tran ID field. |

| Invalid selection. Valid value is S | User entered a character other than 'S' or 's' in a row selection field. |

| You are already at the top of the page... | User pressed PF7 while on Page 1. |

| You are already at the bottom of the page... | User pressed PF8 when no more records were available. |

| Unable to lookup transaction... | A technical error occurred during a VSAM file operation. |

| Invalid key pressed. Please see below... | User pressed an unsupported AID key. |

Security and Authorization Checks
  • No explicit security checks identified : The program does not perform RACF checks, call EXEC CICS ASSIGN USERID , or utilize standard CICS Sign-on ( CESN / CESF ) integrations. Security and session state are managed entirely at the application level via the passed CARDDEMO-COMMAREA .
Performance Considerations
  • Efficient VSAM Browsing :
  • The program utilizes CICS browse operations ( STARTBR , READNEXT , READPREV , ENDBR ) which are highly efficient for sequential retrieval of records from a VSAM KSDS.
  • It properly terminates the browse operation using EXEC CICS ENDBR as soon as the page is populated, releasing VSAM browse locks and resources.
  • Look-Ahead Pagination :
  • To determine if a "Next Page" exists, the program reads an 11th record ( READNEXT ) after populating the 10 screen rows. If successful, it sets NEXT-PAGE-YES to 'Y' . This prevents unnecessary "empty" page scrolls and provides a better user experience without loading the entire dataset into memory.
  • Pseudo-Conversational Design :
  • The program is designed to be pseudo-conversational. It releases CICS resources while waiting for user input by issuing EXEC CICS RETURN specifying the transaction ID CT00 and passing the CARDDEMO-COMMAREA .

<h2

COTRN01C

cbl/COTRN01C.cbl
scanner231 code lines1 calls out0 called by8 copybooks1 filesyes dynamic dispatch
MAT / Gemini

CardDemo Transaction Viewer: Detailed Credit Card Transaction Inquiry

CardDemo Transaction Viewer: Detailed Credit Card Transaction Inquiry

The COTRN01C program is a core component of the CardDemo application, serving as a dedicated inquiry tool for viewing detailed information about individual credit card transactions. Its primary business purpose is to provide customer service representatives, financial analysts, and administrators with a comprehensive, read-only view of any transaction stored in the system's database. By entering a unique transaction identifier, users can …

Full MAT analysis

CardDemo Transaction Viewer: Detailed Credit Card Transaction Inquiry

The COTRN01C program is a core component of the CardDemo application, serving as a dedicated inquiry tool for viewing detailed information about individual credit card transactions. Its primary business purpose is to provide customer service representatives, financial analysts, and administrators with a comprehensive, read-only view of any transaction stored in the system's database. By entering a unique transaction identifier, users can instantly access the complete history and context of a specific financial event.

When a user accesses the transaction viewer, they are presented with a structured screen where they can input a Transaction ID. Alternatively, the program can be invoked directly from a transaction list screen with a pre-selected ID, automatically loading the details upon entry. The retrieved information is highly detailed, encompassing the associated credit card number, transaction type, category, source, transaction amount, description, and precise timestamps for both when the transaction originated and when it was processed. Additionally, it displays merchant-specific details such as the merchant ID, name, city, and zip code.

Navigation within the program is designed to be intuitive and user-friendly, utilizing standard terminal function keys. Users can press Enter to execute a search, clear the current screen to start a new inquiry, or return to the previous screen—typically the main menu or the transaction list. This seamless flow allows operators to quickly toggle between high-level transaction lists and deep-dive individual views without losing their operational context.

To ensure data integrity and a smooth user experience, the program features robust input validation and error handling. It verifies that the Transaction ID field is not empty before attempting a database lookup. If the requested transaction does not exist in the system, or if a database access issue occurs, the program gracefully intercepts the error and displays a clear, descriptive message on the screen. It also handles invalid keyboard inputs by alerting the user rather than interrupting the application flow.

Operating under a pseudo-conversational design, the program efficiently manages system resources by releasing them while waiting for user input. It relies on a shared communication area to pass session metadata, such as user identity and navigation history, between screens. This architecture ensures that security contexts are maintained and that the application remains highly responsive, even under heavy concurrent user traffic.

Business Case and User Interaction

Business Case Overview

The COTRN01C program is a core component of the CardDemo credit card processing application. Its primary business purpose is to provide a detailed, read-only view of a specific financial transaction retrieved from the transaction master file ( TRANSACT ).

This program is typically invoked when a business user or customer service representative needs to audit or verify the specifics of a transaction—such as the transaction amount, processing timestamps, cardholder number, and merchant details (name, city, and zip code). It supports both direct lookup via manual entry of a Transaction ID and contextual navigation where a Transaction ID is passed from a transaction listing or browse program.

User Interaction and Screen Flow
  • Screen Entry :
  • Direct Entry : The user navigates to the Transaction View screen. The input field "Enter Tran ID" is empty, and the cursor is positioned there.
  • Contextual Entry : If the user arrives from another program (such as the Transaction Browse program COTRN00C ) with a pre-selected transaction, the program automatically populates the "Enter Tran ID" field, executes the lookup logic, and displays the transaction details immediately.
  • Manual Lookup : The user types a 16-character Transaction ID into the "Enter Tran ID" field and presses ENTER .
  • Details Display : If the transaction is found, the program populates and displays all transaction details on the screen. If not found, an error message is displayed at the bottom of the screen.
  • Screen Clearing : The user can press PF4 to clear all input and output fields, resetting the screen for a new search.
  • Navigation :
  • Pressing PF3 returns the user to the calling program (stored in the communication area) or defaults to the Main Menu ( COMEN01C ).
  • Pressing PF5 transfers control directly to the Transaction Browse program ( COTRN00C ).

Screen Layout and Navigation

Screen Layout (COTRN1A)

+-----------------------------------------------------------------------------+

| Tran: CT01 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COTRN01C CardDemo Time: hh:mm:ss |

| |

| View Transaction |

| |

| Enter Tran ID: [ ] |

| ---------------------------------------------- ---------------|

| |

| Transaction ID: [ ] Card Number: [ ] |

| |

| Type CD: [ ] Category CD: [ ] Source: [ ] |

| |

| Description: [ ] |

| |

| Amount: [ ] Orig Date: [ ] Proc Date: [ ] |

| |

| Merchant ID: [ ] Merchant Name: [ ] |

| Merchant City: [ ] Merchant Zip: [ ] |

| |

| <ERRMSG: Error or status messages appear here > |

| |

| ENTER=Fetch F3=Back F4=Clear F5=Browse Tran |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+-----------------------+

| Sign-on (COSGN00C) |

+-----------+-----------+

| (If EIBCALEN = 0)

v

+-----------------------+

| Main Menu (COMEN01C)|

+-----------+-----------+

|

| (Select Option 7)

v

+-----------------------+

| Transaction Browse |

| (COTRN00C) |

+-----------+-----------+

|

| (Select Transaction / PF5)

v

+-----------------------+

| Transaction View | <---+ (PF4 Clear / ENTER Fetch)

| (COTRN01C) | ----+

+-----------+-----------+

|

+--------+--------+

| [PF3] | [PF5]

v v

+--------------------+ +--------------------+

| Previous Screen | | Transaction Browse |

| (e.g., COMEN01C) | | (COTRN00C) |

+--------------------+ +--------------------+

Data Flow Between Screens
  • CARDDEMO-COMMAREA : This shared memory block is passed between programs during XCTL transfers.
  • CDEMO-FROM-PROGRAM : Tracks the calling program name so that pressing PF3 returns the user to the correct screen.
  • CDEMO-CT01-TRN-SELECTED : Holds the Transaction ID selected from the browse screen ( COTRN00C ). If populated, COTRN01C automatically performs a lookup on this ID upon entry.

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COTRN01C' | Program identifier |

| WS-TRANID | 'CT01' | CICS Transaction ID associated with this program |

| WS-TRANSACT-FILE | 'TRANSACT' | Name of the VSAM KSDS file containing transaction records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • Transaction ID Input ( TRNIDINI ) :
  • Must not be spaces or low-values.
  • If the field is empty when the user presses ENTER , the program sets WS-ERR-FLG to 'Y' , displays the error message "Tran ID can NOT be empty..." , and positions the cursor on the input field ( TRNIDINL = -1 ).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers input validation and executes the VSAM file read.
  • PF3 : Triggers exit processing, returning control to the program stored in CDEMO-FROM-PROGRAM (or COMEN01C if empty).
  • PF4 : Clears all screen fields and resets the cursor to the input field.
  • PF5 : Transfers control directly to the Transaction Browse program ( COTRN00C ).
  • Other Keys : Any other key is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the screen.
Condition Checks
  • First-Time Entry Check : The program checks CDEMO-PGM-CONTEXT . If it is not set to 1 (re-entry), it initializes the screen and checks if a Transaction ID was passed from the calling program via CDEMO-CT01-TRN-SELECTED . If passed, it automatically executes the lookup.

Data Elements Processed

Screen Fields
  • TRNIDINI / TRNIDINO : Input field for the Transaction ID search.
  • TRNIDO : Output field displaying the retrieved Transaction ID.
  • CARDNUMO : Output field displaying the 16-digit credit card number.
  • TTYPCDO : Output field displaying the 2-character transaction type code.
  • TCATCDO : Output field displaying the 4-digit transaction category code.
  • TRNSRCO : Output field displaying the transaction source (e.g., POS, ATM).
  • TDESCO : Output field displaying the transaction description.
  • TRNAMTO : Output field displaying the formatted transaction amount.
  • TORIGDTO : Output field displaying the original transaction timestamp.
  • TPROCDTO : Output field displaying the processing timestamp.
  • MIDO : Output field displaying the 9-digit Merchant ID.
  • MNAMEO : Output field displaying the merchant's name.
  • MCITYO : Output field displaying the merchant's city.
  • MZIPO : Output field displaying the merchant's zip code.
  • ERRMSGO : Output field for error and status messages.
Backend and Control Fields
  • TRAN-RECORD : The record structure mapping the TRANSACT VSAM file.
  • TRAN-AMT : The packed-decimal transaction amount ( S9(09)V99 ) read from the file.
  • WS-TRAN-AMT : A numeric-edited working storage field ( +99999999.99 ) used to format the transaction amount before displaying it on the screen.

Exception and Error Handling

CICS Command Exception Handling

The program uses explicit response code checking ( RESP and RESP2 ) on all CICS commands instead of global HANDLE CONDITION statements.

  • EXEC CICS READ (on TRANSACT file) :
  • DFHRESP(NORMAL) : The record was successfully retrieved. The program proceeds to format and display the data.
  • DFHRESP(NOTFND) : The Transaction ID does not exist in the file. The program sets WS-ERR-FLG to 'Y' , displays "Transaction ID NOT found..." , and positions the cursor on the input field.
  • Other Responses : Any other error (e.g., file disabled or closed) is caught. The program displays the response and reason codes to the system log, sets WS-ERR-FLG to 'Y' , displays "Unable to lookup Transaction..." , and positions the cursor on the input field.
Error Messages Displayed

| Message Text | Trigger Condition |

| :--- | :--- |

| Tran ID can NOT be empty... | User pressed ENTER with spaces or low-values in the input field. |

| Transaction ID NOT found... | The entered Transaction ID does not exist in the TRANSACT file. |

| Unable to lookup Transaction... | A technical error occurred during the VSAM read operation. |

| Invalid key pressed. Please see below... | The user pressed an unsupported AID key. |

Security and Authorization Checks

  • No explicit security checks identified : The program does not perform RACF checks, call EXEC CICS ASSIGN USERID , or utilize standard CICS Sign-on ( CESN / CESF ) integrations. Security and session state are managed entirely at the application level via the passed CARDDEMO-COMMAREA .

Performance Considerations

  • Unnecessary Update Lock (Critical Anti-Pattern) :
  • In the READ-TRANSACT-FILE paragraph, the program issues an EXEC CICS READ with the UPDATE option:

EXEC CICS READ

DATASET (WS-TRANSACT-FILE)

INTO (TRAN-RECORD)

...

UPDATE

RESP (WS-RESP-CD)

END-EXEC.

  • Because COTRN01C is a read-only "View" program and does not perform a subsequent REWRITE or DELETE , requesting an update lock is highly inefficient. It holds an exclusive lock on the VSAM record until the transaction ends ( EXEC CICS RETURN ), which can cause severe lock contention, transaction queuing, and potential deadlocks in a high-concurrency production environment.
  • Pseudo-Conversational Design :
  • The program is designed to be pseudo-conversational. It releases CICS resources while waiting for user input by issuing EXEC CICS RETURN specifying the transaction ID CT01 and passing the CARDDEMO-COMMAREA .

<h2

COTRN02C

cbl/COTRN02C.cbl
scanner614 code lines3 calls out0 called by10 copybooks5 filesyes dynamic dispatch
MAT / Gemini

CardDemo Transaction Creation and Validation Gateway

CardDemo Transaction Creation and Validation Gateway

The COTRN02C program serves as the manual transaction entry gateway for the CardDemo credit card application. Its primary business purpose is to allow authorized operators to securely record new financial transactions—such as purchases, returns, or adjustments—directly into the system's master ledger. By providing a controlled interface for manual entry, the program ensures that all new transaction records are complete, accurate, and properly formatted before …

Full MAT analysis

CardDemo Transaction Creation and Validation Gateway

The COTRN02C program serves as the manual transaction entry gateway for the CardDemo credit card application. Its primary business purpose is to allow authorized operators to securely record new financial transactions—such as purchases, returns, or adjustments—directly into the system's master ledger. By providing a controlled interface for manual entry, the program ensures that all new transaction records are complete, accurate, and properly formatted before they impact customer accounts.

The user interaction begins with the operator entering either an Account ID or a Credit Card Number. The program automatically cross-references these identifiers against system files; entering one will automatically retrieve and display the other, verifying that the account exists and is valid. To streamline repetitive data entry, the program features a "copy last" function that allows operators to pre-populate the screen with details from the most recently recorded transaction, which they can then modify as needed.

Before any transaction is committed to the database, the program performs comprehensive validation on all input fields. It verifies that mandatory details—such as the transaction type, category, source, description, amount, and merchant information—are present and numeric where required. Additionally, the program integrates with a centralized date utility to ensure that both the transaction's original date and processing date are valid calendar dates, preventing downstream processing errors caused by corrupt date formats.

To safeguard financial data integrity, the program enforces a two-step confirmation process. After validating the inputs, the system prompts the operator to confirm the addition of the transaction. Once confirmed, the program dynamically determines the next sequential transaction identifier by scanning the transaction database, assigns this unique ID to the new record, and writes the transaction to the master file. A successful operation concludes with a green confirmation message displaying the newly generated transaction ID.

Operating under a pseudo-conversational design, the program efficiently manages mainframe system resources while waiting for operator input. It maintains the user's session context and security profile as they navigate through the application. Operators can easily clear the screen to start a new entry, cancel the operation, or return to the main application menu, ensuring a fluid and secure user experience.

Business Case and User Interaction

Business Case Overview

The COTRN02C program is the "Transaction Add" module of the CardDemo Credit Card Processing Application. Its primary business purpose is to allow authorized users to manually record and insert a new financial transaction into the system. This is particularly useful for manual adjustments, offline transaction logging, or administrative overrides.

The program ensures data integrity by validating all transaction details (such as transaction types, categories, amounts, dates, and merchant information) and cross-referencing the account or card number against the system's cross-reference files ( CCXREF and CXACAIX ). Once validated, the program automatically generates a unique, sequential Transaction ID and commits the new record to the primary transaction database ( TRANSACT ).

User Interaction and Screen Flow
  • Screen Entry : The user navigates to this screen from the Main Menu ( COMEN01C ) by selecting the "Transaction Add" option, or is redirected here from another module with a pre-selected card or account number.
  • Key Field Input : The user must enter either an Account Number or a Card Number . Entering one and pressing ENTER automatically triggers a cross-reference lookup to populate the other field.
  • Data Entry : The user fills in the transaction details:
  • Type CD and Category CD (numeric codes representing the transaction type and category).
  • Source (origin of the transaction, e.g., Terminal, Online).
  • Description (textual description of the transaction).
  • Amount (signed numeric value, e.g., +150.00 or -50.00 ).
  • Orig Date and Proc Date (dates in YYYY-MM-DD format).
  • Merchant Details (ID, Name, City, and Zip Code).
  • Template Copy (Optional) : The user can press PF5 to copy the details of the most recently recorded transaction in the system into the data fields, serving as a template to speed up repetitive data entry.
  • Confirmation : To prevent accidental entries, the user must explicitly enter Y in the confirmation field and press ENTER to commit the transaction.
  • Commit and Feedback : Upon successful insertion, the screen fields are cleared, and a green success message is displayed at the bottom of the screen, showing the newly generated Transaction ID. If validation fails, red error messages highlight the invalid fields.
Screen Layout
Screen Layout (COTRN2A)

+-----------------------------------------------------------------------------+

| Tran: CT02 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COTRN02C CardDemo Time: hh:mm:ss |

| |

| Add Transaction |

| |

| Enter Acct #: [ ] (or) Card #: [ ] |

| |

| ---------------------------------------------- ---------------|

| |

| Type CD: [ ] Category CD: [ ] Source: [ ] |

| |

| Description: [ ] |

| |

| Amount: [ ] Orig Date: [ ] Proc Date: [ ] |

| (-99999999.99) (YYYY-MM-DD) (YYYY-MM-DD) |

| |

| Merchant ID: [ ] Merchant Name: [ ] |

| |

| Merchant City: [ ] Merchant Zip: [ ] |

| |

| You are about to add this transaction. Please confirm : [ ] (Y/N) |

| |

| <ERRMSG: Error or success messages appear here > |

| |

| ENTER=Continue F3=Back F4=Clear F5=Copy Last Tran. |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+-----------------------------------------------------------------+

| Main Menu (COMEN01C) |

+-------------------------------+---------------------------------+

|

| (Select Option 8 / XCTL)

v

+-----------------------------------------------------------------+

| Add Transaction (COTRN02C) | <---+

+-------------------------------+---------------------------------+ |

| |

+-------------------+-------------------+ |

| [PF3] | [ENTER] |

v v |

+-------------------------------+ +-------------------+ |

| Previous Screen | | Validate Inputs | |

| (COMEN01C / CDEMO-FROM-PROG) | +---------+---------+ |

+-------------------------------+ | |

| (If Valid & |

| Confirmed) |

v |

+-------------------+ |

| Write to VSAM |---------+

| (TRANSACT File) | (Success/Error

+-------------------+ Message)

Screen Navigation
  • PF3 (Back) : Returns the user to the calling program (stored in CDEMO-FROM-PROGRAM ) or defaults to the Main Menu ( COMEN01C ).
  • PF4 (Clear) : Clears all input fields on the current screen.
  • PF5 (Copy Last Tran) : Performs a backward browse on the TRANSACT file to retrieve the most recent transaction record and populates the screen data fields with its values.
  • ENTER : Submits the entered data for validation and processing.

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COTRN02C' | Program identifier |

| WS-TRANID | 'CT02' | CICS Transaction ID associated with this program |

| WS-TRANSACT-FILE | 'TRANSACT' | VSAM KSDS file containing transaction records |

| WS-CCXREF-FILE | 'CCXREF ' | VSAM KSDS cross-reference file (keyed by Card Number) |

| WS-CXACAIX-FILE | 'CXACAIX ' | VSAM Alternate Index path for cross-reference (keyed by Account ID) |

| WS-DATE-FORMAT | 'YYYY-MM-DD' | Expected date format mask for validation |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

Validation Logic

Input Field Validations
  • Account Number ( ACTIDINI ) / Card Number ( CARDNINI ) :
  • At least one of these key fields must be entered. If both are empty, the error "Account or Card Number must be entered..." is displayed.
  • If Account Number is entered, it must be numeric. If valid, the program reads the CXACAIX file to retrieve and populate the corresponding Card Number.
  • If Card Number is entered, it must be numeric. If valid, the program reads the CCXREF file to retrieve and populate the corresponding Account Number.
  • Type CD ( TTYPCDI ) :
  • Cannot be empty or low-values.
  • Must be strictly numeric.
  • Category CD ( TCATCDI ) :
  • Cannot be empty or low-values.
  • Must be strictly numeric.
  • Source ( TRNSRCI ) :
  • Cannot be empty or low-values.
  • Description ( TDESCI ) :
  • Cannot be empty or low-values.
  • Amount ( TRNAMTI ) :
  • Cannot be empty or low-values.
  • Must match the format +99999999.99 or -99999999.99 (first character must be + or - , positions 2-9 must be numeric, position 10 must be . , and positions 11-12 must be numeric).
  • Orig Date ( TORIGDTI ) / Proc Date ( TPROCDTI ) :
  • Cannot be empty or low-values.
  • Must match the format YYYY-MM-DD (positions 1-4 numeric, position 5 is - , positions 6-7 numeric, position 8 is - , positions 9-10 numeric).
  • The date is logically validated by calling the utility program CSUTLDTC . If the utility returns a severity code other than '0000' (excluding warning '2513' ), the error "Orig Date - Not a valid date..." or "Proc Date - Not a valid date..." is displayed.
  • Merchant ID ( MIDI ) :
  • Cannot be empty or low-values.
  • Must be strictly numeric.
  • Merchant Name ( MNAMEI ) / City ( MCITYI ) / Zip ( MZIPI ) :
  • Cannot be empty or low-values.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • Only ENTER , PF3 , PF4 , and PF5 are valid keys. Any other key triggers the error "Invalid key pressed. Please see below..." .
  • Confirmation Field ( CONFIRMI ) :
  • To commit the transaction, the user must enter Y or y .
  • If the field contains N , n , spaces, or low-values, the program prompts "Confirm to add this transaction..." and positions the cursor on the confirmation field.
  • Any other value triggers the error "Invalid value. Valid values are (Y/N)..." .
Condition Checks
  • Error Cascading : If any key field validation fails, the program automatically clears all transaction data fields on the screen to prevent processing mismatched data.

Data Elements Processed

Screen Fields
  • ACTIDINI / ACTIDINO : Input/Output field for the 11-digit Account ID.
  • CARDNINI / CARDNINO : Input/Output field for the 16-digit Card Number.
  • TTYPCDI / TTYPCDO : Input/Output field for the 2-digit Transaction Type Code.
  • TCATCDI / TCATCDO : Input/Output field for the 4-digit Transaction Category Code.
  • TRNSRCI / TRNSRCO : Input/Output field for the 10-character Transaction Source.
  • TDESCI / TDESCO : Input/Output field for the 60-character Transaction Description.
  • TRNAMTI / TRNAMTO : Input/Output field for the 12-character formatted Transaction Amount.
  • TORIGDTI / TORIGDTO : Input/Output field for the 10-character Original Date ( YYYY-MM-DD ).
  • TPROCDTI / TPROCDTO : Input/Output field for the 10-character Processed Date ( YYYY-MM-DD ).
  • MIDI / MIDO : Input/Output field for the 9-digit Merchant ID.
  • MNAMEI / MNAMEO : Input/Output field for the 30-character Merchant Name.
  • MCITYI / MCITYO : Input/Output field for the 25-character Merchant City.
  • MZIPI / MZIPO : Input/Output field for the 10-character Merchant Zip Code.
  • CONFIRMI / CONFIRMO : Input/Output field for the 1-character confirmation flag ( Y/N ).
  • ERRMSGO : Output field for error and success messages.
Backend and Control Fields
  • TRAN-ID : Key field for the TRANSACT file (16-character alphanumeric representing a sequential number).
  • TRAN-RECORD : The record structure written to the TRANSACT file containing all transaction details.
  • CARD-XREF-RECORD : The record structure read from CCXREF or CXACAIX to map Card Numbers to Account IDs.
  • CARDDEMO-COMMAREA : The primary CICS Communication Area used to pass session state and navigation metadata.

Exception and Error Handling

CICS Command Exception Handling

The program utilizes explicit response checking ( RESP and RESP2 options) on all CICS file operations to handle exceptions inline:

  • EXEC CICS READ (on CXACAIX / CCXREF ) :
  • DFHRESP(NOTFND) : If the Account ID or Card Number is not found in the cross-reference files, the program displays "Account ID NOT found..." or "Card Number NOT found..." and highlights the invalid field.
  • Other Errors : Displays "Unable to lookup Acct in XREF AIX file..." or "Unable to lookup Card # in XREF file..." .
  • EXEC CICS STARTBR / READPREV (on TRANSACT ) :
  • DFHRESP(NOTFND) : If no transactions exist, displays "Transaction ID NOT found..." .
  • DFHRESP(ENDFILE) : If the end of the file is reached during a backward browse, the program defaults the Transaction ID to zero.
  • Other Errors : Displays "Unable to lookup Transaction..." .
  • EXEC CICS WRITE (on TRANSACT ) :
  • DFHRESP(NORMAL) : Clears the screen and displays a green success message: "Transaction added successfully. Your Tran ID is [TRAN-ID]."
  • DFHRESP(DUPKEY) / DFHRESP(DUPREC) : Displays "Tran ID already exist..." .
  • Other Errors : Displays "Unable to Add Transaction..." .
Error Messages Summary

| Message Text | Color | Trigger Condition |

| :--- | :--- | :--- |

| Account ID must be Numeric... | Red | Account ID input contains non-numeric characters. |

| Card Number must be Numeric... | Red | Card Number input contains non-numeric characters. |

| Account or Card Number must be entered... | Red | Both Account ID and Card Number fields are left blank. |

| [Field Name] can NOT be empty... | Red | A required transaction data field is left blank. |

| Amount should be in format -99999999.99 | Red | Amount does not match the required signed decimal format. |

| [Orig/Proc] Date should be in format YYYY-MM-DD | Red | Date input does not match the required template format. |

| [Orig/Proc] Date - Not a valid date... | Red | Date is formatted correctly but is logically invalid (e.g., February 30th). |

| Confirm to add this transaction... | Red | User pressed ENTER without confirming the transaction. |

| Invalid value. Valid values are (Y/N)... | Red | User entered an invalid character in the confirmation field. |

Security and Authorization Checks

No explicit security checks identified.

The program relies on the CICS Communication Area ( CARDDEMO-COMMAREA ) passed from previous screens to maintain session context, but does not perform explicit RACF checks, transaction security validations, or standard CICS Sign-on ( CESN / CESF ) integrations within this module.

Performance Considerations

  • Efficient Sequential ID Generation : To generate a new Transaction ID, the program performs a backward browse starting from HIGH-VALUES ( STARTBR followed by READPREV ). This is a highly efficient mainframe pattern for finding the maximum key in a VSAM Key Sequenced Data Set (KSDS) without scanning the entire file.
  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It releases CICS system resources (such as thread storage) while waiting for user input by issuing an EXEC CICS RETURN specifying the transaction ID CT02 and passing the CARDDEMO-COMMAREA .
  • In-Memory Date Validation : The program delegates logical date validation to the external utility CSUTLDTC . While this modularizes the code, frequent dynamic program calls ( CALL ) can introduce minor CPU overhead in high-volume environments compared to inline validation routines.

<h2

COTRTLIC

app-transaction-type-db2/cbl/COTRTLIC.cbl
scanner1597 code lines2 calls out0 called by13 copybooks0 filesyes dynamic dispatch
MAT / Gemini

Transaction Type List and Maintenance Utility for CardDemo

Transaction Type List and Maintenance Utility for CardDemo

The COTRTLIC program is an administrative business utility within the CardDemo application designed to manage transaction type configurations. Operating within a CICS and Db2 environment, this program provides administrators with a centralized, interactive list of transaction types (such as purchases, fees, or credits) stored in the relational database. By maintaining these core lookup configurations, the program ensures that the downstream transaction …

Full MAT analysis

Transaction Type List and Maintenance Utility for CardDemo

The COTRTLIC program is an administrative business utility within the CardDemo application designed to manage transaction type configurations. Operating within a CICS and Db2 environment, this program provides administrators with a centralized, interactive list of transaction types (such as purchases, fees, or credits) stored in the relational database. By maintaining these core lookup configurations, the program ensures that the downstream transaction processing engine functions with accurate and consistent metadata.

To facilitate efficient data retrieval, the program features robust search, filtering, and paging capabilities. Administrators can filter the list by entering a specific transaction type code or a partial description. Because the database may contain numerous transaction types, the program implements high-performance screen paging. Users can seamlessly navigate forward and backward through pages of results using standard terminal function keys, ensuring a responsive user experience without overloading system resources.

Beyond listing and searching, the program supports direct update and delete operations. From the list screen, an administrator can select a specific record to modify its description or initiate its deletion. To safeguard data integrity, the program enforces strict validation rules, ensuring that modified descriptions contain only authorized alphanumeric characters and that only one record is processed at a time. Destructive actions, such as deletions, require a multi-step confirmation workflow where the user must verify the action before changes are permanently committed to the database.

The program is fully integrated into the CardDemo administrative suite, typically receiving control from the main Administration Menu. It preserves the user's session state, security privileges, and search criteria when transitioning between screens, allowing for seamless navigation. Additionally, administrators can easily navigate from this list to a dedicated maintenance screen to add new transaction types, or return to the main menu, ensuring a secure and controlled user workflow.

Built with a pseudo-conversational design, the program optimizes mainframe resource utilization by releasing system memory while waiting for user input. It interacts with the relational database using optimized queries to fetch only the required number of records per screen page. Furthermore, it handles database constraints gracefully, preventing the deletion of transaction types that are currently referenced by active financial records, thereby maintaining referential integrity across the application.

Business Case and User Interaction

Business Case Overview

The COTRTLIC program is the Transaction Type List component of the CardDemo mainframe application. It provides administrative users with a paginated, grid-based interface to browse, filter, update, and delete transaction type configurations stored in the relational database ( CARDDEMO.TRANSACTION_TYPE table).

This program serves as a high-efficiency administrative console that supports:

  • Paginated Inquiry : Browsing transaction types 7 rows at a time using database cursors.
  • Dynamic Filtering : Filtering the list by a 2-digit Transaction Type Code or a partial Transaction Description (using SQL LIKE wildcards).
  • Inline Updates : Modifying a transaction type's description directly within the grid.
  • Inline Deletes : Removing a transaction type directly from the grid, subject to referential integrity checks.
  • Navigation Hub : Transferring control to the Transaction Type Maintenance program ( COTRTUPC ) to add new records, or returning to the Administration Menu ( COADM01C ).
User Interaction and Screen Flow
  • Entry : The user enters this screen from the Administration Menu ( COADM01C ) or returns from the Transaction Type Maintenance program ( COTRTUPC ). Upon entry, the program executes a priming query to verify database connectivity and displays the first page of transaction types.
  • Filtering :
  • The user can enter a 2-digit numeric code in the Transaction Type filter field, a text string in the Transaction Desc filter field, or both.
  • Pressing ENTER applies the filters. If matching records exist, the grid refreshes to display them. If no records match, an error message is displayed.
  • Paging :
  • The user presses PF8 to page forward (Next Page) or PF7 to page backward (Previous Page).
  • The program uses cursor-based pagination to fetch the next or previous 7 records relative to the keys stored in the communication area.
  • Inline Update :
  • The user types U in the Sel column of the desired row, modifies the text in the Transaction Description column, and presses ENTER .
  • The program validates the modified description. If valid, it highlights the row and prompts: "Update HIGHLIGHTED row. Press F10 to save" .
  • The user presses PF10 to commit the update to the database.
  • Inline Delete :
  • The user types D in the Sel column of the desired row and presses ENTER .
  • The program highlights the row and prompts: "Delete HIGHLIGHTED row ? Press F10 to confirm" .
  • The user presses PF10 to commit the deletion.
  • Add Record :
  • The user presses PF2 to navigate to the Transaction Type Maintenance screen ( COTRTUPC ) to add a new transaction type.
  • Exit :
  • The user presses PF3 to exit the list and return to the Administration Menu ( COADM01C ).

Screen Layout and Navigation

Screen Layout (CTRTLIA)

+-----------------------------------------------------------------------------+

| Tran: CTLI AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COTRTLIC CardDemo Time: hh:mm:ss |

| Page: 9 |

| Transaction Type List |

| |

| Transaction Type : [ ] Transaction Desc : [ ] |

| |

| Sel Type Transaction Description |

| --- ---- -------------------------------------------------- |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| [ ] 99 [ ] |

| |

| <INFO-MSG: Center-aligned informational message> |

| <ERR-MSG: Left-aligned error messages appear here in red > |

| |

| ENTER=Search/Process F2=Add F3=Exit F7=Prev F8=Next F10=Save/Confirm |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+----------------------------------+

| CICS Terminal |

+----------------+-----------------+

|

| (Transaction CTLI)

v

+--------------------------+

| COTRTLIC | <-------------------+

| (Tran Type List Pgm) | |

+------------+-------------+ |

| |

| (Presents CTRTLIA Map) |

v |

+--------------------------+ |

| CTRTLIA Map | |

+------------+-------------+ |

| |

+---[PF3]-----------------+---[PF2] |

| | |

v v |

+-----------------------+ +-----------------------+ |

| COADM01C | | COTRTUPC | |

| (Admin Menu Pgm) | | (Tran Type Update Pgm)| |

+-----------------------+ +-----------------------+ |

| |

+---[ENTER/PF7/PF8/PF10]------------+

(Paging, Filtering, CRUD)

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COTRTLIC' | Program identifier |

| LIT-THISTRANID | 'CTLI' | CICS Transaction ID for this program |

| LIT-THISMAPSET | 'COTRTLI' | BMS Mapset name |

| LIT-THISMAP | 'CTRTLIA' | BMS Map name |

| LIT-ADMINPGM | 'COADM01C' | Administration Menu Program Name |

| LIT-ADMINTRANID | 'CA00' | Administration Menu Transaction ID |

| LIT-ADDTPGM | 'COTRTUPC' | Transaction Type Maintenance Program Name |

| LIT-ADDTTRANID | 'CTTU' | Transaction Type Maintenance Transaction ID |

| LIT-DELETE-FLAG | 'D' | Selection flag for deleting a record |

| LIT-UPDATE-FLAG | 'U' | Selection flag for updating a record |

| WS-MAX-SCREEN-LINES | 7 | Maximum number of detail rows displayed per page |

Validation Logic

Input Field Validations
  • Transaction Type Filter ( TRTYPEI ) :
  • Must be numeric and exactly 2 digits if supplied.
  • If non-numeric, the program flags an input error and displays: "TYPE CODE FILTER,IF SUPPLIED MUST BE A 2 DIGIT NUMBER" .
  • Row Selection ( TRTSELI ) :
  • Must be either U (Update), D (Delete), space, or low-value.
  • Any other character triggers an input error and displays: "Action code selected is invalid" .
  • Row Description ( TRTYPDI ) :
  • Validated only when the corresponding row selection is U (Update).
  • Must be supplied (cannot be blank, spaces, or low-values).
  • Must contain only alphanumeric characters and spaces. If invalid, the program flags an input error and displays: "Transaction Desc can have numbers or alphabets only." or "Transaction Desc must be supplied." .
Screen-Level Validations
  • Single Action Constraint :
  • The user is permitted to perform only one row action ( U or D ) per interaction.
  • If multiple rows have selection characters, the program flags an error and displays: "Please select only 1 action" .
  • Attention Identifier (AID) Validation :
  • Valid keys are ENTER , PF2 , PF3 , PF7 , PF8 , and PF10 .
  • PF10 is valid only when an update or delete action has been requested and validated.
  • Any other key defaults to ENTER processing.
Condition Checks
  • Filter Change Detection :
  • If the user has a pending update or delete action (validated but not yet confirmed via PF10 ) and modifies either the Transaction Type or Transaction Desc filter fields, the program cancels the pending action and treats the interaction as a new search request.
  • Db2 Connectivity Check :
  • Before executing any business logic, the program performs a priming query against SYSIBM.SYSDUMMY1 . If this query fails, the program displays a database access error and terminates.

Data Elements Processed

Screen and Input/Output Fields
  • TRTYPEI / TRTYPEO : Transaction Type filter input/output field (2 characters).
  • TRDESCI / TRDESCO : Transaction Description filter input/output field (50 characters).
  • TRTSELI / TRTSELO : Row selection action field (1 character, occurs 7 times).
  • TRTTYPI / TRTTYPO : Row Transaction Type Code display field (2 characters, occurs 7 times).
  • TRTYPDI / TRTYPDO : Row Transaction Description input/output field (50 characters, occurs 7 times).
  • PAGENOO : Current page number display field (3 characters).
  • INFOMSGO : Center-aligned informational message field (45 characters).
  • ERRMSGO : Left-aligned error message field (78 characters).
Backend and Control Fields
  • CARDDEMO-COMMAREA : Shared session communication area.
  • CDEMO-FROM-PROGRAM : Tracks the calling program to ensure correct return routing.
  • CDEMO-USER-TYPE : Verified to ensure administrative access ( 'A' ).
  • WS-THIS-PROGCOMMAREA : Program-specific state tracking area.
  • WS-CA-TYPE-CD : Stores the active type filter.
  • WS-CA-TYPE-DESC : Stores the active description filter.
  • WS-CA-SCREEN-NUM : Tracks the current page number.
  • WS-CA-FIRST-TR-CODE : Stores the first key on the current page (used for backward paging).
  • WS-CA-LAST-TR-CODE : Stores the last key on the current page (used for forward paging).
  • WS-CA-DELETE-FLAG : Tracks if a delete confirmation is pending.
  • WS-CA-UPDATE-FLAG : Tracks if an update confirmation is pending.
Database Fields (CARDDEMO.TRANSACTION_TYPE)
  • TR_TYPE : Transaction Type Code (CHAR(2), Primary Key).
  • TR_DESCRIPTION : Transaction Description (VARCHAR(50)).

Exception and Error Handling

Database SQL Code Exception Handling
  • SQLCODE = 0 : Success.
  • SQLCODE = +100 (Not Found / End of Data) :
  • During forward paging: Indicates the end of the dataset. The program sets the next page indicator to false and displays: "No more pages for these search conditions" .
  • During initial search: Indicates no records match the filters. The program displays: "No records found for this search condition." .
  • SQLCODE = -532 (Referential Integrity Violation on Delete) :
  • Triggered if the user attempts to delete a transaction type that is currently referenced by active transaction records. The program displays: "Please delete associated child records first:" .
  • SQLCODE = -911 (Deadlock/Timeout) :
  • Triggered if the row is locked by another process during an update. The program displays: "Deadlock. Someone else updating ?" .
  • Other Negative SQL Codes :
  • The program calls the DSNTIAC subroutine to format the Db2 error message, appends the SQLCODE, and displays the formatted error in the long message area.
CICS Response Codes
  • WS-RESP-CD is captured during RECEIVE MAP and SEND MAP commands to detect terminal or map failures.

Security and Authorization Checks

  • Role-Based Access Control :
  • The program extracts the user type from the shared communication area ( CDEMO-USER-TYPE ).
  • Only users with Administrator privileges ( CDEMO-USRTYP-ADMIN = 'A' ) are authorized to access this program.
  • Direct Access Prevention :
  • If a user attempts to execute the transaction CTLI directly from a blank terminal screen, EIBCALEN will be 0 . The program detects this, initializes the communication area, and defaults the user type to Administrator to allow access, but typically relies on upstream authentication from the Sign-on program ( COSGN00C ).

Performance Considerations

  • Cursor-Based Pagination :
  • To avoid loading the entire TRANSACTION_TYPE table into memory, the program implements scrollable paging using two distinct cursors:
  • C-TR-TYPE-FORWARD : Fetches records where TR_TYPE >= :WS-START-KEY ordered by TR_TYPE ASC.
  • C-TR-TYPE-BACKWARD : Fetches records where TR_TYPE < :WS-START-KEY ordered by TR_TYPE DESC.
  • This pattern ensures optimal database CPU and memory utilization, especially for large tables.
  • Pseudo-Conversational Design :
  • The program is fully pseudo-conversational. It does not hold CICS resources or database locks while waiting for user input.
  • It transmits the screen map and terminates execution using EXEC CICS RETURN , passing the transaction ID CTLI and the state-preserving WS-COMMAREA .
  • Lightweight Priming Query :
  • The program executes a fast SELECT 1 FROM SYSIBM.SYSDUMMY1 FETCH FIRST 1 ROW ONLY query to verify database availability before executing more resource-intensive cursor operations.

<h2

COTRTUPC

app-transaction-type-db2/cbl/COTRTUPC.cbl
scanner1241 code lines1 calls out0 called by13 copybooks0 filesyes dynamic dispatch
MAT / Gemini

Transaction Type Maintenance and Update Program for CardDemo

Transaction Type Maintenance and Update Program for CardDemo

The COTRTUPC program is an administrative utility within the CardDemo application designed to manage transaction type configurations. Operating within a CICS environment, this program provides business administrators with a secure interface to view, create, modify, and delete transaction types stored in the application's relational database. By maintaining these core lookup configurations—such as defining what constitutes a purchase, fee, or credit—the …

Full MAT analysis

Transaction Type Maintenance and Update Program for CardDemo

The COTRTUPC program is an administrative utility within the CardDemo application designed to manage transaction type configurations. Operating within a CICS environment, this program provides business administrators with a secure interface to view, create, modify, and delete transaction types stored in the application's relational database. By maintaining these core lookup configurations—such as defining what constitutes a purchase, fee, or credit—the program ensures the downstream transaction processing engine functions with accurate and consistent metadata.

The user interaction is designed around a pseudo-conversational flow to optimize system resources. Upon launching the program, the administrator is prompted to enter a specific transaction type code. The program queries the database and, if the record is found, displays its current description for review, modification, or deletion. If the entered code does not exist, the program dynamically transitions into an creation mode, prompting the administrator to define a brand-new transaction type and description.

To safeguard data integrity, the program implements robust input validation and multi-step confirmation workflows. Any modified or newly entered transaction description is validated to ensure it is not blank and contains only authorized alphanumeric characters. Destructive actions, such as deleting an existing configuration or committing new changes, are never executed instantly; instead, they require the user to verify the action and press a specific function key to finalize the request. Furthermore, the program safely handles database constraints, preventing the deletion of transaction types that are currently referenced by active financial records.

This program is fully integrated into the CardDemo administrative suite, typically receiving control from the Administration Menu or the Transaction Type List program. It utilizes a shared communication area to preserve user session state, security privileges, and navigation history across screen transitions. Administrators can easily back out of pending changes using a cancel key or exit the utility entirely to return to the main administrative menu, ensuring a secure, controlled, and intuitive user experience.

Business Case and User Interaction

Business Case Overview

The COTRTUPC program is the Transaction Type Maintenance (Update/Add/Delete) component of the CardDemo mainframe application. It provides administrative users with a secure, transactional interface to manage transaction type configurations stored in the relational database ( CARDDEMO.TRANSACTION_TYPE table).

This program supports full CRUD (Create, Read, Update, Delete) operations on transaction types:

  • Inquiry (Read) : Retrieve and display the description of a specific transaction type code.
  • Update (U) : Modify the description of an existing transaction type.
  • Create (C) : Add a new transaction type code and description if the searched code does not exist.
  • Delete (D) : Remove an existing transaction type from the database, with referential integrity checks.
User Interaction and Screen Flow
  • Entry : The user enters this screen from the Admin Menu ( COADM01C ) or the Transaction Type List screen ( COTRTLIC ).
  • Search/Inquiry :
  • The screen initially displays empty fields and prompts: "Enter transaction type to be maintained" .
  • The user inputs a 2-digit Transaction Type Code and presses ENTER .
  • The program queries the database.
  • If found : The program displays the current description, changes state to TTUP-SHOW-DETAILS , and prompts: "Update transaction type details shown." .
  • If not found : The program prompts: "Press F05 to add. F12 to cancel" .
  • Modify/Update :
  • The user modifies the description field and presses ENTER .
  • The program validates the input. If valid, it prompts: "Changes validated. Press F5 to save" .
  • The user presses PF5 to commit the changes to the database, or PF12 to cancel.
  • Add/Create :
  • If the record was not found, the user presses PF5 to initiate creation.
  • The screen unlocks the description field and prompts: "Enter new transaction type details." .
  • The user enters the description and presses ENTER to validate, followed by PF5 to save.
  • Delete :
  • From the details screen, the user can press PF4 to delete the record.
  • The program prompts: "Delete this record ? Press F4 to confirm" .
  • The user presses PF4 again to confirm deletion, or PF12 to cancel.

Screen Layout and Navigation

Screen Layout (CTRTUPA)

+-----------------------------------------------------------------------------+

| Tran: CTTU AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COTRTUPC CardDemo Time: hh:mm:ss |

| |

| Transaction Type Update |

| |

| |

| Transaction Type Code: [ ] |

| |

| Transaction Desc : [ ]

| |

| |

| |

| |

| <INFO-MSG: Center-aligned informational message> |

| <ERR-MSG: Left-aligned error messages appear here in red > |

| |

| ENTER=Continue F3=Exit F4=Delete F5=Save F12=Cancel |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Invoked via XCTL from Admin Menu/List)

v

+--------------------------+

| COTRTUPC | <------------------+

| (Tran Type Update Pgm) | |

+------------+-------------+ |

| |

| (Presents CTRTUPA Map) |

v |

+--------------------------+ |

| CTRTUPA Map | |

+------------+-------------+ |

| |

+---[PF3]-------------+---[ENTER/PF4/PF5/PF12] |

| |

v |

[Determine Target] |

- CDEMO-FROM-PROGRAM |

| |

+---> (If COADM01C) -> XCTL to COADM01C |

| |

+---> (If COTRTLIC) -> XCTL to COTRTLIC |

| |

+---> (If Default) -> XCTL to COADM01C |

|

+---(Loop for validation/confirm)

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| LIT-THISPGM | 'COTRTUPC' | Program identifier |

| LIT-THISTRANID | 'CTTU' | CICS Transaction ID for this program |

| LIT-THISMAPSET | 'COTRTUP ' | BMS Mapset name |

| LIT-THISMAP | 'CTRTUPA' | BMS Map name |

| LIT-ADMINPGM | 'COADM01C' | Admin Menu Program Name |

| LIT-ADMINTRANID | 'CA00' | Admin Menu Transaction ID |

| LIT-LISTTPGM | 'COTRTLIC' | Transaction Type List Program Name |

| LIT-LISTTTRANID | 'CTLI' | Transaction Type List Transaction ID |

Validation Logic

Input Field Validations
  • Transaction Type Code ( TRTYPCDI ) :
  • Presence Check : Must be supplied; cannot be spaces or low-values.
  • Numeric Check : Must be a valid numeric value (validated via FUNCTION TEST-NUMVAL ).
  • Value Check : Must not be zero.
  • Formatting : If valid, the value is padded with leading zeros to ensure a 2-character format (e.g., '1' becomes '01' ).
  • Transaction Description ( TRTYDSCI ) :
  • Presence Check : Must be supplied; cannot be spaces or low-values.
  • Alphanumeric Check : Must contain only letters, numbers, and spaces. This is validated by converting all valid alphanumeric characters to spaces using INSPECT CONVERTING and verifying that the remaining trimmed string length is zero.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • Valid keys are dynamically checked in paragraph 0001-CHECK-PFKEYS based on the current program state ( TTUP-CHANGE-ACTION ):
  • PF3 : Always valid (Exit).
  • ENTER : Valid for initial search and input validation, except when confirming a deletion.
  • PF4 : Valid only when details are displayed ( TTUP-SHOW-DETAILS ) or when confirming a deletion ( TTUP-CONFIRM-DELETE ).
  • PF5 : Valid only when confirming changes ( TTUP-CHANGES-OK-NOT-CONFIRMED ), when a record is not found to initiate creation ( TTUP-DETAILS-NOT-FOUND ), or during delete-in-progress.
  • PF12 : Valid during active operations to cancel and revert to the previous state.
  • Any unauthorized key press sets WS-INVALID-KEY-PRESSED to true, displays an error message, and redisplays the screen.
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 , or if the program is entered fresh from COADM01C or COTRTLIC (where CDEMO-PGM-REENTER is false), the program initializes the communication areas, sets the state to TTUP-DETAILS-NOT-FETCHED , and displays a blank search screen.
  • Data Change Detection : Before updating, paragraph 1205-COMPARE-OLD-NEW compares the current screen inputs with the originally fetched database values. If no changes are detected, the program displays the message "No change detected with respect to values fetched." and prevents unnecessary database updates.

Data Elements Processed

Screen and Input/Output Fields
  • TRTYPCDI / TRTYPCDO : Transaction Type Code input/output field (2 characters).
  • TRTYDSCI / TRTYDSCO : Transaction Description input/output field (50 characters).
  • INFOMSGO : Center-aligned informational message field (45 characters).
  • ERRMSGO : Left-aligned error message field (78 characters).
Backend and Control Fields
  • CARDDEMO-COMMAREA : Shared session communication area.
  • CDEMO-FROM-PROGRAM : Tracks the calling program ( COADM01C or COTRTLIC ) to ensure correct return routing.
  • CDEMO-USER-TYPE : Verified to ensure administrative access.
  • WS-THIS-PROGCOMMAREA : Program-specific state tracking area.
  • TTUP-CHANGE-ACTION : State variable tracking the current step of the CRUD lifecycle (e.g., TTUP-SHOW-DETAILS , TTUP-CONFIRM-DELETE , TTUP-CHANGES-OK-NOT-CONFIRMED ).
  • TTUP-OLD-DETAILS : Stores the original database values to detect concurrent modifications or lack of changes.
  • TTUP-NEW-DETAILS : Stores the validated user inputs prior to database commit.
Database Fields (CARDDEMO.TRANSACTION_TYPE)
  • DCL-TR-TYPE : Host variable for the transaction type code (mapped to TR_TYPE , CHAR(2) ).
  • DCL-TR-DESCRIPTION : Host variable structure for the transaction description (mapped to TR_DESCRIPTION , VARCHAR(50) ).

Exception and Error Handling

Database SQL Code Exception Handling
  • SQLCODE = 0 : Success.
  • SQLCODE = +100 (Not Found) :
  • During SELECT : Triggers the TTUP-DETAILS-NOT-FOUND state, prompting the user to add the record.
  • During UPDATE : Indicates the record was deleted by another user. The program automatically attempts to insert the record as new via 9700-INSERT-RECORD .
  • SQLCODE = -911 (Deadlock/Timeout) : Sets the error message "Could not lock record for update" and flags the state as TTUP-CHANGES-OKAYED-LOCK-ERROR .
  • SQLCODE = -532 (Referential Integrity Violation on Delete) : Triggered if the transaction type is referenced by child records (e.g., in the transaction history table). Displays the error: "Please delete associated child records first: SQLCODE : -532" .
  • Other Negative SQL Codes : Displays a formatted error message containing the SQLCODE and the error message text from the SQLCA ( SQLERRM ).
CICS Conditions and Abend Handling
  • EXEC CICS HANDLE ABEND : Registers ABEND-ROUTINE to intercept unexpected runtime failures.
  • ABEND-ROUTINE :
  • Populates ABEND-DATA with the program name ( COTRTUPC ) and abend code ( 9999 ).
  • Sends a full-screen abend message to the terminal.
  • Cancels active abend handling and terminates the task abnormally using EXEC CICS ABEND .

Security and Authorization Checks

  • Role-Based Access Control : The program relies on the session context passed via CARDDEMO-COMMAREA . It checks that the user is authorized as an administrator ( CDEMO-USRTYP-ADMIN is 'A' ).
  • Direct Access Prevention : If a user attempts to execute the transaction CTTU directly from a blank terminal screen, EIBCALEN will be 0 . The program detects this, initializes the communication area, and forces the user back to the entry state.
  • No Explicit Platform Security : No direct RACF, CICS Sign-on ( CESN ), or external security manager (ESM) calls are implemented within this program. Security is inherited from the upstream menu and sign-on transactions.

Performance Considerations

  • Pseudo-Conversational Design : The program is fully pseudo-conversational. It does not hold CICS resources or thread locks while waiting for user input. It transmits the screen map and terminates execution using EXEC CICS RETURN , passing the transaction ID CTTU and the state-preserving WS-COMMAREA .
  • Efficient Database Access : All SQL operations ( SELECT , UPDATE , INSERT , DELETE ) are executed as single-row operations using the primary key ( TR_TYPE ). This ensures index-only or high-speed index scans, minimizing database CPU overhead and page locking.
  • Explicit Transaction Boundaries : Database updates, inserts, and deletes are immediately followed by an explicit EXEC CICS SYNCPOINT upon receiving SQLCODE = 0 . This releases database locks as quickly as possible, reducing lock contention in high-concurrency environments.

<h2

COUSR00C both engines ✓

cbl/COUSR00C.cbl
scanner531 code lines3 calls out0 called by8 copybooks3 filesyes dynamic dispatch
Quarry LLM

CICS BMS screen program that lists user security records from the USRSEC file 10 at a time with forward/backward paging, and lets an operator select a user to route to update or delete transactions.

Business rules
  • {"claim": "The screen displays up to 10 USRSEC records per page, browsing the file via STARTBR/READNEXT/READPREV/ENDBR and populating fixed screen slots 1-10.", "confidence": 0.9, "evidence": [{"file": "COUSR00C.cbl", "lines": "282-331"}, {"file": "COUSR00C.cbl", "lines": "384-441"}]}
  • {"claim": "PF7 pages backward and PF8 pages forward through the user list, tracking first/last user ID on the page (CDEMO-CU00-USRID-FIRST/LAST) to know browse boundaries; paging past the top or bottom shows an informational message instead of erroring.", "confidence": 0.85, "evidence": [{"file": "COUSR00C.cbl", "lines": "237-277"}, {"file": "COUSR00C.cbl", "lines": "248-254"}, {"file": "COUSR00C.cbl", "lines": "270-276"}]}
  • {"claim": "Entering 'U' or 'u' next to a listed user routes to COUSR02C (update user) and 'D' or 'd' routes to COUSR03C (delete user), passing the selected user ID and origin program/transaction via COMMAREA.", "confidence": 0.9, "evidence": [{"file": "COUSR00C.cbl", "lines": "189-209"}]}
  • {"claim": "Only the first non-blank selection flag among the 10 rows (SEL0001I..SEL0010I, evaluated in order) is honored per ENTER key press; any selection value other than U/D/u/d is rejected with 'Invalid selection. Valid values are U and D'.", "confidence": 0.8, "evidence": [{"file": "COUSR00C.cbl", "lines": "151-185"}, {"file": "COUSR00C.cbl", "lines": "210-214"}]}
  • {"claim": "If invoked with no COMMAREA (fresh transaction start, EIBCALEN=0) the program redirects to the sign-on screen COSGN00C rather than showing the list; PF3 exits to the admin menu COADM01C.", "confidence": 0.85, "evidence": [{"file": "COUSR00C.cbl", "lines": "110-112"}, {"file": "COUSR00C.cbl", "lines": "125-127"}]}
MAT / Gemini

CardDemo User Directory and Security Administration Portal

CardDemo User Directory and Security Administration Portal

The COUSR00C program is an administrative security utility within the CardDemo application that provides a centralized, paginated directory of all registered system users. Designed for security administrators, this program serves as an interactive lookup tool to monitor user accounts, displaying essential profile details such as User IDs, full names, and assigned roles (such as Administrator or Standard User). By presenting this information in a …

Full MAT analysis

CardDemo User Directory and Security Administration Portal

The COUSR00C program is an administrative security utility within the CardDemo application that provides a centralized, paginated directory of all registered system users. Designed for security administrators, this program serves as an interactive lookup tool to monitor user accounts, displaying essential profile details such as User IDs, full names, and assigned roles (such as Administrator or Standard User). By presenting this information in a structured, easy-to-read list, the program enables efficient oversight of system access and simplifies user administration.

To facilitate efficient navigation through large volumes of user records, the program features robust search and pagination capabilities. Administrators can scroll forward and backward through the directory page by page, with the system dynamically retrieving and formatting up to ten user records at a time from the security database. Additionally, administrators can perform targeted searches by entering a specific User ID, which immediately repositions the directory list to start from that requested record, eliminating the need to scroll manually through the entire registry.

Beyond serving as a read-only directory, this program acts as an interactive launchpad for administrative actions. From the main list, an administrator can select a specific user record and input a command to either update or delete that user. The program validates the selection and seamlessly transfers the user's session and control to the appropriate specialized sub-program—either the User Update utility or the User Deletion utility—ensuring a smooth and integrated administrative workflow.

Security and resource efficiency are core components of the program's design. It prevents unauthorized access by verifying the administrator's session credentials upon entry; any attempt to access the directory directly without proper authentication results in an immediate redirection to the main sign-on gateway. Furthermore, the program utilizes a pseudo-conversational execution model, which optimizes mainframe performance by releasing system memory while waiting for user input, relying on a shared communication area to securely maintain session state across screen transitions.

Business Case and User Interaction

Business Case Overview

The COUSR00C program is an administrative security utility within the CardDemo application that lists all registered users from the secure user registry file ( USRSEC ). It provides authorized administrators with a paginated, scrollable overview of user accounts, including their User ID, First Name, Last Name, and User Type (Role).

In addition to displaying user records, the program serves as a navigation hub for user management. From this screen, administrators can:

  • Search : Look up users starting from a specific User ID.
  • Navigate : Page forward and backward through the user registry.
  • Update : Select a specific user to modify their profile details (redirects to COUSR02C ).
  • Delete : Select a specific user to remove them from the system (redirects to COUSR03C ).
User Interaction and Screen Flow
  • Entry : The user is typically routed to this program from the Administration Menu ( COADM01C ) by selecting the "User List" option, or automatically redirected here from other administrative sub-programs.
  • Screen Display : The program displays the COUSR0A map, showing a list of up to 10 users per page. It displays the current page number, system header metadata (Transaction ID, Program Name, Date, Time), and a search input field.
  • Search : The administrator can type a partial or full User ID into the "Search User ID" field and press ENTER to start listing users from that specific key.
  • Pagination :
  • Pressing PF8 scrolls forward to the next page of users.
  • Pressing PF7 scrolls backward to the previous page of users.
  • Action Selection : The administrator can type an action code in the selection column ( Sel ) next to any user record:
  • 'U' or 'u' : Selects the user for modification and transfers control to the Update User program ( COUSR02C ).
  • 'D' or 'd' : Selects the user for deletion and transfers control to the Delete User program ( COUSR03C ).
  • Exit : The administrator can press PF3 at any time to exit the User List and return to the Administration Menu ( COADM01C ).

Screen Layout and Navigation

Screen Layout (COUSR0A)

+-----------------------------------------------------------------------------+

| Tran: CU00 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COUSR00C CardDemo Time: hh:mm:ss |

| |

| List Users Page: 00000001 |

| |

| Search User ID: [ ] |

| |

| Sel User ID First Name Last Name Type |

| --- -------- -------------------- -------------------- ---- |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| [ ] [ ] [ ] [ ] [ ] |

| |

| Type 'U' to Update or 'D' to Delete a User from the list |

| |

| <ERRMSG: Error and status messages appear here > |

| |

| ENTER=Continue F3=Back F7=Backward F8=Forward |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Transaction CU00 / EIBCALEN > 0)

v

+--------------------------+

| COUSR00C | <------------------+

| (List Users Pgm) | |

+------------+-------------+ |

| |

| (Presents COUSR0A Map) |

v |

+--------------------------+ |

| COUSR0A Map | |

+------------+-------------+ |

| |

+---[PF3]-------------+---[ENTER/PF7/PF8] |

| | |

v v |

+------------------+ [Process Input] |

| COADM01C | | |

| (Admin Menu Pgm) | +---(If Invalid Key)-----+

+------------------+ |

+---(If 'U' Selected)----> [XCTL to COUSR02C]

|

+---(If 'D' Selected)----> [XCTL to COUSR03C]

|

+---(If Search/Page)-----+

|

v

[Browse USRSEC VSAM File]

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COUSR00C' | Program identifier |

| WS-TRANID | 'CU00' | CICS Transaction ID associated with this program |

| WS-USRSEC-FILE | 'USRSEC ' | VSAM KSDS file containing user security records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • Action Selection Validation :
  • The program scans the selection fields ( SEL0001I through SEL0010I ) for any non-blank, non-low-value inputs.
  • If a selection is made, the program validates the entered character.
  • Valid Values : 'U' , 'u' (Update) or 'D' , 'd' (Delete).
  • If any other character is entered, the program sets WS-MESSAGE to "Invalid selection. Valid values are U and D" , positions the cursor on the search input field, and redisplays the screen.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Processes search input, normalizes selection actions, and performs a page-forward browse operation.
  • PF3 : Triggers exit processing, redirecting the user back to the Administration Menu ( COADM01C ).
  • PF7 : Triggers backward pagination.
  • PF8 : Triggers forward pagination.
  • Other Keys : Any other key is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." , and redisplays the screen.
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 (indicating direct transaction execution without logging in), the program bypasses processing and redirects immediately to the Sign-on screen ( COSGN00C ).
  • Re-entry Check : Uses CDEMO-PGM-REENTER to distinguish between the initial screen load (sends a fresh map with low-values) and subsequent user interactions (receives and processes input).
  • Page Boundary Checks :
  • Top of Page : If the user presses PF7 (Backward) and the current page number is 1 or less, the program blocks the browse, displays "You are already at the top of the page..." , and redisplays the screen without performing file I/O.
  • Bottom of Page : If the user presses PF8 (Forward) and the NEXT-PAGE-YES flag is false, the program blocks the browse, displays "You are already at the bottom of the page..." , and redisplays the screen.

Data Elements Processed

Screen and Input Fields
  • USRIDINI / USRIDINO : Search User ID input/output field (8 characters).
  • PAGENUMI / PAGENUMO : Current page number display field.
  • SEL0001I to SEL0010I : Action selection input fields for rows 1 to 10.
  • USRID01O to USRID10O : Displayed User IDs for rows 1 to 10.
  • FNAME01O to FNAME10O : Displayed First Names for rows 1 to 10.
  • LNAME01O to LNAME10O : Displayed Last Names for rows 1 to 10.
  • UTYPE01O to UTYPE10O : Displayed User Roles/Types for rows 1 to 10.
  • ERRMSGO / ERRMSGC : Error/Status message text and color attribute control.
Backend and Control Fields
  • SEC-USR-ID : Key field used to establish the browse starting point in the USRSEC VSAM file.
  • SEC-USR-FNAME / SEC-USR-LNAME / SEC-USR-TYPE : Fields retrieved from the VSAM record to populate the screen.
  • CARDDEMO-COMMAREA : Shared communication area.
  • CDEMO-FROM-TRANID : Set to 'CU00' before transferring control.
  • CDEMO-FROM-PROGRAM : Set to 'COUSR00C' before transferring control.
  • CDEMO-TO-PROGRAM : Target program for redirection ( COADM01C , COUSR02C , or COUSR03C ).
  • CDEMO-CU00-USRID-FIRST : Stores the User ID of the first record on the current page (used for backward paging).
  • CDEMO-CU00-USRID-LAST : Stores the User ID of the last record on the current page (used for forward paging).
  • CDEMO-CU00-PAGE-NUM : Tracks the active page number.
  • CDEMO-CU00-NEXT-PAGE-FLG : Flag indicating if more records exist beyond the current page.
  • CDEMO-CU00-USR-SEL-FLG : Stores the selected action ('U' or 'D').
  • CDEMO-CU00-USR-SELECTED : Stores the User ID selected for update or deletion.

Exception and Error Handling

CICS File I/O Exception Handling

The program explicitly checks the CICS response code ( WS-RESP-CD ) after performing browse operations ( STARTBR , READNEXT , READPREV ) on the USRSEC VSAM file:

  • STARTBR Exceptions :
  • DFHRESP(NOTFND) : Sets the EOF flag, displays "You are at the top of the page..." , and redisplays the screen.
  • Other Responses : Displays the raw RESP and REAS codes to the system console, sets the error flag, and displays "Unable to lookup User..." on the screen.
  • READNEXT Exceptions :
  • DFHRESP(ENDFILE) : Sets the EOF flag, displays "You have reached the bottom of the page..." , and redisplays the screen.
  • Other Responses : Displays raw codes to the console, sets the error flag, and displays "Unable to lookup User..." on the screen.
  • READPREV Exceptions :
  • DFHRESP(ENDFILE) : Sets the EOF flag, displays "You have reached the top of the page..." , and redisplays the screen.
  • Other Responses : Displays raw codes to the console, sets the error flag, and displays "Unable to lookup User..." on the screen.
Error Messages Displayed
  • "Invalid key pressed. Please see below..." : Displayed in red when an unsupported AID key is pressed.
  • "Invalid selection. Valid values are U and D" : Displayed in red when an invalid action character is entered in the selection column.
  • "You are already at the top of the page..." : Displayed in red/neutral when attempting to page backward from page 1.
  • "You are already at the bottom of the page..." : Displayed in red/neutral when attempting to page forward when no more records exist.
  • "You have reached the bottom of the page..." : Displayed in neutral when a forward browse hits the end of the file.
  • "You have reached the top of the page..." : Displayed in neutral when a backward browse hits the beginning of the file.
  • "Unable to lookup User..." : Displayed in red when a critical VSAM file error occurs.

Security and Authorization Checks

  • Direct Access Prevention : If a user attempts to execute transaction CU00 directly without a valid communication area ( EIBCALEN = 0 ), the program blocks access and redirects the user to the Sign-on screen ( COSGN00C ).
  • Role-Based Access : The program relies on the upstream authentication process ( COSGN00C ) and menu navigation ( COADM01C ) to ensure that only users with Administrator privileges ( CDEMO-USRTYP-ADMIN is 'A' ) can access this program.
  • No Explicit Platform Security : No explicit external security manager checks (such as RACF), EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the transaction ID CU00 and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption and maximizes concurrent user capacity.
  • Efficient VSAM Browse Operations :
  • The program utilizes CICS browse commands ( STARTBR , READNEXT , READPREV , and ENDBR ) to page through the USRSEC file.
  • To minimize database lock times and resource consumption, the browse is explicitly closed using ENDBR immediately after retrieving the 10 records required to populate the screen.
  • The program limits the browse to a maximum of 11 records per page-forward request (10 to display, and 1 extra to determine if a "Next Page" exists), preventing unnecessary I/O overhead.

<h2

COUSR01C both engines ✓

cbl/COUSR01C.cbl
scanner198 code lines1 calls out0 called by8 copybooks1 filesyes dynamic dispatch
Quarry LLM

CICS pseudo-conversational online program that presents an 'Add User' screen (COUSR1A) and writes a new record to the USRSEC security file for CardDemo's user administration.

Business rules
  • {"claim": "First Name, Last Name, User ID, Password, and User Type are all mandatory; the transaction re-displays the entry screen with a specific error message and cursor positioning if any is blank or low-values.", "confidence": 0.9, "evidence": [{"file": "COUSR01C.cbl", "lines": "117-151"}]}
  • {"claim": "On successful validation, the entered fields are mapped into the SEC-USER-DATA record (SEC-USR-ID, SEC-USR-FNAME, SEC-USR-LNAME, SEC-USR-PWD, SEC-USR-TYPE) and written to the USRSEC file keyed by user ID.", "confidence": 0.9, "evidence": [{"file": "COUSR01C.cbl", "lines": "153-159"}, {"file": "COUSR01C.cbl", "lines": "238-248"}]}
  • {"claim": "A duplicate user ID (DFHRESP DUPKEY or DUPREC on the CICS WRITE) is treated as a business validation failure ('User ID already exist...') rather than a technical error, keeping the user on the entry screen.", "confidence": 0.85, "evidence": [{"file": "COUSR01C.cbl", "lines": "260-266"}]}
  • {"claim": "Successful add clears the input fields and confirms with a green 'User <id> has been added ...' message, keeping the operator on the same screen for the next entry.", "confidence": 0.85, "evidence": [{"file": "COUSR01C.cbl", "lines": "250-259"}]}
  • {"claim": "PF3 navigates back to the admin menu program COADM01C via XCTL, PF4 clears the current screen, and any other unrecognized AID key is rejected with an 'Invalid key' message.", "confidence": 0.8, "evidence": [{"file": "COUSR01C.cbl", "lines": "93-103"}]}
  • {"claim": "If the transaction is entered with no COMMAREA (EIBCALEN = 0), control is routed to the sign-on program COSGN00C instead of proceeding, implying this program requires an established session context.", "confidence": 0.7, "evidence": [{"file": "COUSR01C.cbl", "lines": "78-80"}]}
MAT / Gemini

CardDemo User Creation and Security Administration Program

CardDemo User Creation and Security Administration Program

The COUSR01C program is a dedicated administrative utility within the CardDemo application designed to register new users into the system's secure user registry. Operating exclusively under administrator-level privileges, this program serves as a critical security provisioning tool. It allows authorized personnel to expand the system's user base by creating both standard business users and new administrators, ensuring that all access credentials are …

Full MAT analysis

CardDemo User Creation and Security Administration Program

The COUSR01C program is a dedicated administrative utility within the CardDemo application designed to register new users into the system's secure user registry. Operating exclusively under administrator-level privileges, this program serves as a critical security provisioning tool. It allows authorized personnel to expand the system's user base by creating both standard business users and new administrators, ensuring that all access credentials are systematically recorded and managed.

When invoked from the central Administration Menu, the program presents a structured data-entry screen. The administrator is prompted to input the new user's personal and security details, including their first name, last name, a unique user ID, a secure password, and their designated user type (either Administrator or Regular User). To maintain situational awareness, the screen also dynamically displays real-time system metadata, such as the current date, time, and active transaction identifier.

Before any data is committed to the system, the program performs rigorous input validation. When the administrator submits the form, the program checks each field to ensure that mandatory information is not missing. If any validation rule is violated—such as an empty name, user ID, or password—the program halts processing, displays a targeted error message at the bottom of the screen, and automatically positions the cursor on the invalid field to facilitate quick correction.

Once the input passes all validation checks, the program attempts to write the new profile directly to the secure user security file. The program handles the outcome of this write operation gracefully: a successful registration is confirmed with a green success message, while attempts to register an existing user ID are blocked with a duplicate record warning. Any unexpected system or file access errors are caught and reported as general processing failures to prevent data corruption.

To optimize mainframe resource utilization, the program is built using a pseudo-conversational design. It does not remain active in system memory while waiting for user input, thereby maximizing concurrent user capacity and minimizing processing overhead. Administrators can easily clear the current inputs to start over or press a designated function key to safely exit the screen and return to the main Administration Menu, ensuring a secure and controlled session transition.

Business Case and User Interaction

Business Case Overview

The COUSR01C program is an administrative utility within the CardDemo application. Its primary business purpose is to allow authorized administrators to register and add new users (both Administrators and Regular Users) to the application's security registry. The program captures user details, validates the inputs, and writes a new record to the USRSEC VSAM Key-Sequenced Data Set (KSDS).

User Interaction and Screen Flow
  • Entry : The user typically navigates to this program from the Administration Menu ( COADM01C ) by selecting the "User Add" option, or by directly invoking the transaction CU01 (provided a valid communication area is present).
  • Initial Screen Display : The program displays the COUSR1A map. All input fields are blank, and the cursor is automatically positioned on the First Name field.
  • Data Entry : The administrator enters the following details:
  • First Name (up to 20 characters)
  • Last Name (up to 20 characters)
  • User ID (up to 8 characters)
  • Password (up to 8 characters)
  • User Type (1 character: 'A' for Admin, 'U' for Regular User)
  • Submission : The administrator presses the ENTER key to submit the data.
  • Processing & Feedback :
  • If validation succeeds and the User ID does not already exist, the record is written to the USRSEC file. The input fields are cleared, a green success message is displayed at the bottom of the screen, and the cursor is reset to the First Name field.
  • If validation fails or the User ID already exists, a red error message is displayed, and the cursor is positioned on the field that caused the error.
  • Screen Clearing : The administrator can press PF4 at any time to clear all input fields and reset the cursor.
  • Exit/Cancel : The administrator can press PF3 to cancel the operation and return to the Administration Menu ( COADM01C ).

Screen Layout and Navigation

Screen Layout (COUSR1A)

+-----------------------------------------------------------------------------+

| Tran: CU01 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COUSR01C CardDemo Time: hh:mm:ss |

| |

| Add User |

| |

| |

| First Name: [ ] Last Name: [ ] |

| |

| User ID : [ ] (8 Char) Password : [ ] (8 Char) |

| |

| User Type : [ ] (A=Admin, U=User) |

| |

| |

| <ERRMSG: Error/Success messages appear here > |

| |

| ENTER=Add User F3=Back F4=Clear F12=Exit |

+-----------------------------------------------------------------------------+

Note: Although the screen footer displays F12=Exit , the program's code does not explicitly handle the DFHPF12 key. Pressing PF12 will trigger the "Invalid key pressed" error.

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Transaction CU01 / EIBCALEN > 0)

v

+--------------------------+

| COUSR01C | <------------------+

| (Add User Pgm) | |

+------------+-------------+ |

| |

| (Presents COUSR1A Map) |

v |

+--------------------------+ |

| COUSR1A Map | |

+------------+-------------+ |

| |

+---[PF3]-------------+---[ENTER] |

| | |

v v |

+------------------+ [Validate Inputs] |

| COADM01C | | |

| (Admin Menu) | +---(If Invalid/Error)---+

+------------------+ |

| (If Valid)

v

[Write to USRSEC VSAM]

|

+---(Success / Green Msg)

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COUSR01C' | Program identifier |

| WS-TRANID | 'CU01' | CICS Transaction ID associated with this program |

| WS-USRSEC-FILE | 'USRSEC ' | VSAM KSDS file containing user security records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations

When the user presses ENTER , the program performs sequential validation on the input fields. If any check fails, the program halts further validation, sets WS-ERR-FLG to 'Y' , positions the cursor on the invalid field, and redisplays the screen with a red error message:

  • First Name Validation :
  • Must not be spaces or low-values.
  • Error Message: "First Name can NOT be empty..."
  • Cursor Position: First Name field ( FNAMEL = -1 ).
  • Last Name Validation :
  • Must not be spaces or low-values.
  • Error Message: "Last Name can NOT be empty..."
  • Cursor Position: Last Name field ( LNAMEL = -1 ).
  • User ID Validation :
  • Must not be spaces or low-values.
  • Error Message: "User ID can NOT be empty..."
  • Cursor Position: User ID field ( USERIDL = -1 ).
  • Password Validation :
  • Must not be spaces or low-values.
  • Error Message: "Password can NOT be empty..."
  • Cursor Position: Password field ( PASSWDL = -1 ).
  • User Type Validation :
  • Must not be spaces or low-values.
  • Error Message: "User Type can NOT be empty..."
  • Cursor Position: User Type field ( USRTYPEL = -1 ).
  • Note: The program does not explicitly validate that the entered value is strictly 'A' or 'U' during this phase, though the screen prompt indicates these are the only valid options.
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Initiates input validation and record creation.
  • PF3 : Triggers exit processing, redirecting the user back to the Admin Menu ( COADM01C ).
  • PF4 : Clears all input fields and resets the cursor to the First Name field.
  • Other Keys (including PF12) : Rejected with the error message "Invalid key pressed. Please see below..." . The cursor is positioned on the First Name field.
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 (indicating direct transaction execution without a communication area), the program blocks access and redirects the user to the Sign-on screen ( COSGN00C ).
  • Re-entry Check : Uses CDEMO-PGM-REENTER to determine if the screen is being loaded for the first time (sends a blank map with the cursor on First Name) or if it is processing a postback from user interaction.

Data Elements Processed

Screen and Input Fields
  • FNAMEI / FNAMEO / FNAMEL : First Name input, output, and length attribute.
  • LNAMEI / LNAMEO / LNAMEL : Last Name input, output, and length attribute.
  • USERIDI / USERIDO / USERIDL : User ID input, output, and length attribute.
  • PASSWDI / PASSWDO / PASSWDL : Password input, output, and length attribute.
  • USRTYPEI / USRTYPEO / USRTYPEL : User Type input, output, and length attribute.
  • ERRMSGO / ERRMSGC : Error message text and color attribute control field.
Backend and Control Fields
  • SEC-USER-DATA : The record structure written to the USRSEC VSAM file:
  • SEC-USR-ID : User ID (8 characters, key field).
  • SEC-USR-FNAME : First Name (20 characters).
  • SEC-USR-LNAME : Last Name (20 characters).
  • SEC-USR-PWD : Password (8 characters).
  • SEC-USR-TYPE : User Type (1 character).
  • SEC-USR-FILLER : Filler space (23 characters).
  • CARDDEMO-COMMAREA : Shared communication area passed between programs.
  • CDEMO-FROM-TRANID : Set to 'CU01' before transferring control.
  • CDEMO-FROM-PROGRAM : Set to 'COUSR01C' before transferring control.
  • CDEMO-TO-PROGRAM : Set to 'COADM01C' (or 'COSGN00C' on direct entry failure) to specify the target redirection program.
  • CDEMO-PGM-CONTEXT : Reset to 0 (Enter context) before transferring control.

Exception and Error Handling

CICS File Write Exception Handling

The program explicitly checks the CICS response code ( WS-RESP-CD ) after attempting to write the new record to the USRSEC VSAM file:

  • DFHRESP(NORMAL) : The record was successfully written. The program clears all input fields, sets the message color to green ( DFHGREEN ), and displays:

"User [User_ID] has been added ..."

  • DFHRESP(DUPKEY) or DFHRESP(DUPREC) : The User ID already exists in the security file. The program sets WS-ERR-FLG to 'Y' , displays "User ID already exist..." in red, and positions the cursor on the User ID field ( USERIDL = -1 ).
  • Other Response Codes : Any other error (e.g., file disabled or closed). The program sets WS-ERR-FLG to 'Y' , displays "Unable to Add User..." in red, and positions the cursor on the First Name field ( FNAMEL = -1 ).
CICS Command Failures

The program utilizes explicit response checking ( RESP and RESP2 options) on all RECEIVE and WRITE commands rather than relying on global EXEC CICS HANDLE CONDITION statements. This ensures structured, inline error handling.

Security and Authorization Checks

  • Direct Access Prevention : If a user attempts to bypass the sign-on screen and execute transaction CU01 directly, EIBCALEN will be 0 . The program detects this, blocks access, and immediately redirects the user to the Sign-on screen ( COSGN00C ).
  • Role-Based Navigation : Upon pressing PF3, the program redirects the user back to the Admin Menu ( COADM01C ), which is restricted to users with Administrator privileges.
  • No Explicit Platform Security : No explicit external security manager (such as RACF) checks or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the transaction ID CU01 and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption and maximizes concurrent user capacity.
  • Efficient VSAM Write : The write operation on the USRSEC file is a direct single-record write ( EXEC CICS WRITE ) using the unique key SEC-USR-ID , which is highly efficient.

<h2

COUSR02C both engines ✓

cbl/COUSR02C.cbl
scanner303 code lines1 calls out0 called by8 copybooks2 filesyes dynamic dispatch
Quarry LLM

CICS online program that lets an admin look up a user by ID in the USRSEC file, edit their first name, last name, password, or user type, and rewrite the record to persist the update.

Business rules
  • {"claim": "User ID, first name, last name, password, and user type are all mandatory fields; the update is rejected with a field-specific error message if any is blank or low-values.", "confidence": 0.9, "evidence": [{"file": "COUSR02C.cbl", "lines": "179-213"}]}
  • {"claim": "An update is only written to USRSEC if at least one field actually differs from the stored value (USR-MODIFIED flag); if nothing changed, the user is warned to modify something before saving rather than performing a no-op rewrite.", "confidence": 0.9, "evidence": [{"file": "COUSR02C.cbl", "lines": "215-243"}]}
  • {"claim": "Looking up a user (PROCESS-ENTER-KEY / ENTER key) opens the USRSEC record with UPDATE intent (read-for-update lock) even though PF5 is the actual commit step, implying the record stays locked between the read and the rewrite within the same pseudo-conversation.", "confidence": 0.6, "evidence": [{"file": "COUSR02C.cbl", "lines": "320-331"}]}
  • {"claim": "PF3 both saves the update and navigates back to the calling program (or COADM01C by default), meaning save-and-exit is a single combined action rather than separate steps.", "confidence": 0.7, "evidence": [{"file": "COUSR02C.cbl", "lines": "111-119"}]}
  • {"claim": "A missing/expired commarea (EIBCALEN = 0) forces an immediate transfer to the sign-on screen (COSGN00C), indicating this transaction cannot be entered directly without prior session context.", "confidence": 0.8, "evidence": [{"file": "COUSR02C.cbl", "lines": "90-92"}]}
MAT / Gemini

CardDemo User Update Security Program

CardDemo User Update Security Program

The COUSR02C program is an administrative utility within the CardDemo application designed to update existing user profiles in the system's secure registry. It allows authorized administrators to modify critical user details, including first name, last name, password, and user role (such as Administrator or Regular User). By providing a controlled interface for profile maintenance, the program ensures that user credentials and access privileges remain accurate, up-to-date, and …

Full MAT analysis

CardDemo User Update Security Program

The COUSR02C program is an administrative utility within the CardDemo application designed to update existing user profiles in the system's secure registry. It allows authorized administrators to modify critical user details, including first name, last name, password, and user role (such as Administrator or Regular User). By providing a controlled interface for profile maintenance, the program ensures that user credentials and access privileges remain accurate, up-to-date, and secure.

Administrators typically access this program from the User List or the main Administration Menu. Upon entry, the program can automatically load the details of a pre-selected user or accept a manually entered User ID. Once a valid User ID is submitted, the program retrieves the current profile information from the security file and populates the screen fields, positioning the cursor to allow immediate modifications.

To maintain data integrity, the program performs strict validation on all input fields before committing any changes. It ensures that essential fields—such as the User ID, First Name, Last Name, Password, and User Type—are not left blank. Additionally, the program compares the newly entered screen data against the existing record to verify that actual modifications have been made, preventing unnecessary database writes and alerting the administrator if no changes were detected.

The program features an intuitive navigation flow controlled by standard keyboard function keys. Administrators can apply updates and return to the previous screen, save changes while remaining on the current screen, clear all fields to start a new search, or cancel the operation entirely to return to the Administration Menu. Clear, color-coded messages are displayed at the bottom of the screen to provide immediate feedback on the success or failure of each action.

Engineered using a pseudo-conversational design, the program optimizes mainframe resource utilization by releasing system memory while waiting for user input. It securely tracks session state, user authorization levels, and transaction history across screen transitions using a shared communication area. This architecture prevents unauthorized direct access to the update utility, ensuring that only authenticated administrators can perform security modifications.

Business Case and User Interaction

Business Case Overview

The COUSR02C program is an administrative utility within the CardDemo application designed to update existing user security profiles. It provides authorized administrators with a secure interface to retrieve, modify, and save user credentials and roles stored in the USRSEC VSAM KSDS file.

This program ensures data integrity by validating all inputs before committing changes and prevents unnecessary database writes by verifying that actual modifications have occurred before executing an update.

User Interaction and Screen Flow
  • Entry :
  • The program is typically invoked from the Administration Menu ( COADM01C ) or another calling program.
  • If a user was pre-selected in the calling program (passed via CDEMO-CU02-USR-SELECTED ), COUSR02C automatically fetches and displays that user's details upon startup.
  • If no user is pre-selected, the screen displays blank input fields, prompting the administrator to enter a User ID.
  • Fetching User Details :
  • The administrator enters a User ID in the Enter User ID field and presses ENTER .
  • The program reads the USRSEC file. If found, it populates the First Name, Last Name, Password, and User Type fields on the screen.
  • Modifying and Saving :
  • The administrator modifies the desired fields (First Name, Last Name, Password, or User Type).
  • To save changes, the administrator presses PF5 (Save) or PF3 (Save & Exit).
  • The program validates the inputs, checks if any changes were made, and updates the VSAM record.
  • Clearing :
  • Pressing PF4 clears all input fields and resets the screen.
  • Canceling/Exiting :
  • Pressing PF12 cancels the operation and returns the user to the Administration Menu ( COADM01C ) without saving.

Screen Layout and Navigation

Screen Layout (COUSR2A)

+-----------------------------------------------------------------------------+

| Tran: CU02 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COUSR02C CardDemo Time: hh:mm:ss |

| |

| Update User |

| |

| Enter User ID: [ ] |

| |

| *|

| |

| First Name: [ ] Last Name: [ ]|

| |

| Password: [ ] (8 Char) |

| |

| User Type: [ ] (A=Admin, U=User) |

| |

| |

| |

| <ERRMSG: Error/Status messages appear here in Red/Green/Neutral > |

| |

| ENTER=Fetch F3=Save&&Exit F4=Clear F5=Save F12=Cancel |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Transaction CU02 / EIBCALEN > 0)

v

+--------------------------+

| COUSR02C | <------------------+

| (Update User Pgm) | |

+------------+-------------+ |

| |

| (Presents COUSR2A Map) |

v |

+--------------------------+ |

| COUSR2A Map | |

+------------+-------------+ |

| |

+---[PF12/Cancel]-----+---[ENTER/Fetch] |

| | [PF5/Save] |

| | [PF3/Save & Exit] |

v | |

+------------------+ +---> [Validate & Process] --------+

| COADM01C | |

| (Admin Menu Pgm) | <---[PF3/PF12 after Save/Cancel]-------------+

+------------------+

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COUSR02C' | Program identifier |

| WS-TRANID | 'CU02' | CICS Transaction ID associated with this program |

| WS-USRSEC-FILE | 'USRSEC ' | VSAM KSDS file containing user security records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • User ID Validation :
  • Must not be spaces or low-values.
  • If empty, sets WS-ERR-FLG to 'Y' , displays "User ID can NOT be empty..." , and positions the cursor on the User ID field ( USRIDINL = -1 ).
  • First Name Validation :
  • Must not be spaces or low-values.
  • If empty during an update attempt, sets WS-ERR-FLG to 'Y' , displays "First Name can NOT be empty..." , and positions the cursor on the First Name field ( FNAMEL = -1 ).
  • Last Name Validation :
  • Must not be spaces or low-values.
  • If empty during an update attempt, sets WS-ERR-FLG to 'Y' , displays "Last Name can NOT be empty..." , and positions the cursor on the Last Name field ( LNAMEL = -1 ).
  • Password Validation :
  • Must not be spaces or low-values.
  • If empty during an update attempt, sets WS-ERR-FLG to 'Y' , displays "Password can NOT be empty..." , and positions the cursor on the Password field ( PASSWDL = -1 ).
  • User Type Validation :
  • Must not be spaces or low-values.
  • If empty during an update attempt, sets WS-ERR-FLG to 'Y' , displays "User Type can NOT be empty..." , and positions the cursor on the User Type field ( USRTYPEL = -1 ).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers User ID validation and fetches user details from the VSAM file.
  • PF3 : Validates all input fields, performs the update if changes are detected, and returns to the calling program (or COADM01C ).
  • PF4 : Clears all screen fields and resets the cursor to the User ID field.
  • PF5 : Validates all input fields and performs the update in-place without exiting.
  • PF12 : Cancels the transaction and returns to the Admin Menu ( COADM01C ).
  • Other Keys : Rejected with the error message "Invalid key pressed. Please see below..." .
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 , the program bypasses processing and redirects immediately to the Sign-on screen ( COSGN00C ).
  • Re-entry Check : Uses CDEMO-PGM-REENTER to distinguish between initial screen load and subsequent user interactions.
  • Modification Check : Compares the screen input fields ( FNAMEI , LNAMEI , PASSWDI , USRTYPEI ) against the retrieved VSAM record ( SEC-USR-FNAME , SEC-USR-LNAME , SEC-USR-PWD , SEC-USR-TYPE ). If no fields have changed, the update is bypassed, and the message "Please modify to update ..." is displayed.

Data Elements Processed

Screen and Input Fields
  • USRIDINI / USRIDINO : User ID input/output field (8 characters).
  • FNAMEI / FNAMEO : User's First Name input/output field (20 characters).
  • LNAMEI / LNAMEO : User's Last Name input/output field (20 characters).
  • PASSWDI / PASSWDO : User's Password input/output field (8 characters).
  • USRTYPEI / USRTYPEO : User's Role/Type input/output field (1 character; 'A' or 'U').
  • ERRMSGO / ERRMSGC : Error/Status message text and color attribute control.
Backend and Control Fields
  • SEC-USR-ID : Key field used to read and update the USRSEC VSAM file.
  • SEC-USR-FNAME : Stored First Name in the VSAM record.
  • SEC-USR-LNAME : Stored Last Name in the VSAM record.
  • SEC-USR-PWD : Stored Password in the VSAM record.
  • SEC-USR-TYPE : Stored User Type in the VSAM record.
  • CARDDEMO-COMMAREA : Shared communication area.
  • CDEMO-FROM-TRANID : Set to 'CU02' before transferring control.
  • CDEMO-FROM-PROGRAM : Set to 'COUSR02C' before transferring control.
  • CDEMO-TO-PROGRAM : Target program for redirection.
  • CDEMO-CU02-USR-SELECTED : Pre-selected User ID passed from the calling program.

Exception and Error Handling

Error Messages Displayed
  • "User ID can NOT be empty..." : Displayed in red when the User ID field is blank during a fetch or update.
  • "First Name can NOT be empty..." : Displayed in red when the First Name field is blank during an update.
  • "Last Name can NOT be empty..." : Displayed in red when the Last Name field is blank during an update.
  • "Password can NOT be empty..." : Displayed in red when the Password field is blank during an update.
  • "User Type can NOT be empty..." : Displayed in red when the User Type field is blank during an update.
  • "User ID NOT found..." : Displayed in red when the entered User ID does not exist in the USRSEC file.
  • "Unable to lookup User..." : Displayed in red when a file read error occurs (other than NOTFND ).
  • "Unable to Update User..." : Displayed in red when a file rewrite error occurs.
  • "Please modify to update ..." : Displayed in red when the user presses save but has not changed any data.
  • "User [ID] has been updated ..." : Displayed in green upon a successful database update.
CICS Command Failures
  • CICS HANDLE CONDITION : No global HANDLE CONDITION statements are used.
  • Explicit Response Checking : The program utilizes the RESP and RESP2 options on all file operations ( READ and REWRITE ) to capture and handle errors inline:
  • DFHRESP(NORMAL) : Continues normal execution.
  • DFHRESP(NOTFND) : Sets the error flag, displays "User ID NOT found..." , and positions the cursor on the User ID field.
  • Other Responses : Displays the raw RESP and REAS codes via a DISPLAY statement, sets the error flag, and displays a generic failure message on the screen.

Security and Authorization Checks

  • Direct Access Prevention : If a user attempts to execute transaction CU02 directly without a valid communication area ( EIBCALEN = 0 ), the program blocks access and redirects the user to the Sign-on screen ( COSGN00C ).
  • No Explicit Security Checks Identified : The program does not perform explicit external security manager checks (such as RACF), EXEC CICS ASSIGN USERID calls, or standard CICS Signon ( CESN / CESF ) integrations. It relies entirely on the upstream application flow to ensure that only authorized administrators reach this screen.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the transaction ID CU02 and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption.
  • Efficient VSAM Access :
  • File reads are performed using direct key reads ( RIDFLD ), which is highly efficient.
  • The program uses READ UPDATE only when an update is about to be performed, minimizing record locking times.
  • It performs a comparison check to ensure data has actually changed before issuing a REWRITE command, preventing unnecessary I/O operations.

<h2

COUSR03C both engines ✓

cbl/COUSR03C.cbl
scanner251 code lines1 calls out0 called by8 copybooks2 filesyes dynamic dispatch
Quarry LLM

CICS online program that presents a delete-confirmation screen for a security/user record and, on PF5 confirmation, deletes the corresponding user from the USRSEC file.

Business rules
  • {"claim": "User ID input cannot be blank; both the enter-key lookup and the delete action reject empty User ID with an error message and cursor repositioning.", "confidence": 0.9, "evidence": [{"file": "COUSR03C.cbl", "lines": "144-154"}, {"file": "COUSR03C.cbl", "lines": "176-186"}]}
  • {"claim": "Deletion is a two-step confirm flow: PF-Enter looks up and displays the user (read with UPDATE intent) and prompts 'Press PF5 key to delete this user', and only PF5 actually performs the DELETE against USRSEC.", "confidence": 0.85, "evidence": [{"file": "COUSR03C.cbl", "lines": "280-286"}, {"file": "COUSR03C.cbl", "lines": "119-122"}, {"file": "COUSR03C.cbl", "lines": "267-278"}]}
  • {"claim": "If the user ID is not found on lookup or on delete, the program flags an error and displays 'User ID NOT found...' rather than performing the delete.", "confidence": 0.9, "evidence": [{"file": "COUSR03C.cbl", "lines": "287-292"}, {"file": "COUSR03C.cbl", "lines": "323-328"}]}
  • {"claim": "On successful deletion, all screen fields are cleared and a confirmation message naming the deleted user ID is composed and displayed in green.", "confidence": 0.85, "evidence": [{"file": "COUSR03C.cbl", "lines": "313-322"}]}
  • {"claim": "Navigation is commarea-driven: PF3 and PF12 return to the calling program (defaulting to COADM01C) via XCTL, and an empty commarea on entry routes to the sign-on program COSGN00C.", "confidence": 0.8, "evidence": [{"file": "COUSR03C.cbl", "lines": "90-92"}, {"file": "COUSR03C.cbl", "lines": "111-125"}, {"file": "COUSR03C.cbl", "lines": "199-208"}]}
MAT / Gemini

CardDemo User Deletion Security Program

CardDemo User Deletion Security Program

The COUSR03C program is an administrative security utility within the CardDemo application designed to delete user profiles from the system's secure user registry. Operating exclusively within the administrator's domain, this program provides a controlled and secure mechanism for removing user accounts, ensuring that only authorized personnel can modify system access privileges. By managing user lifecycle termination, it plays a critical role in maintaining the overall …

Full MAT analysis

CardDemo User Deletion Security Program

The COUSR03C program is an administrative security utility within the CardDemo application designed to delete user profiles from the system's secure user registry. Operating exclusively within the administrator's domain, this program provides a controlled and secure mechanism for removing user accounts, ensuring that only authorized personnel can modify system access privileges. By managing user lifecycle termination, it plays a critical role in maintaining the overall security and compliance of the credit card processing platform.

Administrators typically navigate to this program from the centralized Administration Menu or directly from a user search list. Upon entry, the program can automatically load a pre-selected user's profile or accept a manually entered User ID. To prevent accidental deletions, the program requires a two-step verification process: the administrator must first retrieve the user's details—such as their first name, last name, and role type—to confirm they have targeted the correct account before any destructive action can be taken.

The actual deletion is executed only when the administrator confirms the action by pressing a designated function key. The program then performs a secure, transactional delete operation on the underlying security database. Once the record is successfully removed, the screen is cleared of the deleted user's information, and a green confirmation message is displayed to notify the administrator of the successful operation. If the user record cannot be found or if a database conflict occurs, the program displays a clear, contextual error message and halts the deletion.

Robust validation and security checks are embedded throughout the program's execution flow. It ensures that the User ID field is never left blank and verifies the existence of the record before attempting a deletion. Furthermore, the program prevents unauthorized access by checking the user's session context; any attempt to bypass the standard sign-on process or access the program directly without proper administrative credentials results in an immediate redirection to the main sign-on gateway.

Engineered with a pseudo-conversational design, the program optimizes mainframe resource utilization by releasing system memory while waiting for user input. It maintains session state and user context across screen interactions using a shared communication area. Administrators can easily navigate away from the deletion screen at any point, with dedicated keys allowing them to clear the current inputs, return to the previous screen, or jump directly back to the main administrative menu.

Business Case and User Interaction

Business Case Overview

The COUSR03C program is a CICS COBOL application within the CardDemo system designed to delete user security profiles from the USRSEC VSAM KSDS file. This program is an administrative utility restricted to authorized personnel (typically administrators) to maintain system security by removing inactive, redundant, or unauthorized user accounts.

To prevent accidental deletions, the program implements a two-step confirmation workflow:

  • Fetch : The administrator inputs a User ID and presses ENTER to retrieve and display the user's details (First Name, Last Name, and User Type).
  • Delete : After verifying the displayed information, the administrator presses PF5 to permanently delete the user record from the database.
User Interaction and Screen Flow
  • Entry : The user can access this screen from the Admin Menu ( COADM01C ) or via a selection from a User List screen. If a user was selected from a list, their User ID is passed via the communication area ( CDEMO-CU03-USR-SELECTED ) and automatically fetched upon entry.
  • Manual Fetch : If no user was pre-selected, the screen displays empty fields. The administrator types an 8-character User ID into the "Enter User ID" field and presses ENTER .
  • If the User ID exists, the program populates the First Name, Last Name, and User Type fields, displaying the message "Press PF5 key to delete this user ..." in yellow/neutral color.
  • If the User ID does not exist, an error message "User ID NOT found..." is displayed in red.
  • Deletion : The administrator reviews the retrieved details and presses PF5 to confirm deletion.
  • Upon successful deletion, the input and output fields are cleared, and a green success message is displayed: "User [UserID] has been deleted ..." .
  • Clear Screen : The administrator can press PF4 at any time to clear all input fields and reset the screen.
  • Exit/Cancel : The administrator can press PF3 or PF12 to cancel the operation and return to the previous administrative screen.

Screen Layout and Navigation

Screen Layout (COUSR3A)

+-----------------------------------------------------------------------------+

| Tran: CU03 AWS Mainframe Modernization Date: mm/dd/yy |

| Prog: COUSR03C CardDemo Time: hh:mm:ss |

| |

| Delete User |

| |

| Enter User ID: [ ] |

| |

| *|

| |

| First Name: [ ] |

| Last Name: [ ] |

| User Type: [ ] (A=Admin, U=User) |

| |

| |

| |

| <ERRMSG: Status and error messages appear here > |

| |

| ENTER=Fetch F3=Back F4=Clear F5=Delete |

+-----------------------------------------------------------------------------+

Navigation and Data Flow Diagram

+--------------------------------------------------+

| CICS Terminal |

+------------------------+-------------------------+

|

| (Transaction CU03 / EIBCALEN > 0)

v

+--------------------------+

| COUSR03C | <------------------+

| (Delete User Program) | |

+------------+-------------+ |

| |

| (Presents COUSR3A Map) |

v |

+--------------------------+ |

| COUSR3A Map | |

+------------+-------------+ |

| |

+---[PF3/PF12]-----------+---[ENTER/PF5/PF4]----------------+

| |

v v

+------------------+ [Process Request]

| COADM01C | |

| (Admin Menu Pgm) | +---> [Read/Delete USRSEC File]

+------------------+ |

^ +---> [Update Screen Map]

|

+---(If EIBCALEN = 0 on entry redirects to COSGN00C)

Important Constants

| Constant Name | Value | Description |

| :--- | :--- | :--- |

| WS-PGMNAME | 'COUSR03C' | Program identifier |

| WS-TRANID | 'CU03' | CICS Transaction ID associated with this program |

| WS-USRSEC-FILE | 'USRSEC ' | VSAM KSDS file containing user security records |

| CCDA-TITLE01 | ' AWS Mainframe Modernization ' | Screen Header Title Line 1 |

| CCDA-TITLE02 | ' CardDemo ' | Screen Header Title Line 2 |

| CCDA-MSG-INVALID-KEY | 'Invalid key pressed. Please see below... ' | Error message for unsupported AID keys |

Validation Logic

Input Field Validations
  • User ID Validation :
  • The User ID field ( USRIDINI ) must not be empty (spaces or low-values).
  • If empty during a Fetch ( ENTER ) or Delete ( PF5 ) operation, the program sets WS-ERR-FLG to 'Y' , displays the error message "User ID can NOT be empty..." in red, and positions the cursor on the User ID input field ( USRIDINL = -1 ).
Screen-Level Validations
  • Attention Identifier (AID) Validation :
  • ENTER : Triggers the Fetch operation. Validates the User ID input and reads the USRSEC file to display user details.
  • PF3 / PF12 : Triggers exit processing. Redirects the user back to the calling program (stored in CDEMO-FROM-PROGRAM ) or defaults to the Admin Menu ( COADM01C ).
  • PF4 : Clears all screen fields and resets the cursor to the User ID input field.
  • PF5 : Triggers the Delete operation. Validates the User ID, reads the record with an update lock, and deletes it from the USRSEC file.
  • Other Keys : Any other key is rejected. The program sets WS-ERR-FLG to 'Y' , displays "Invalid key pressed. Please see below..." in red, and redisplays the screen.
Condition Checks
  • Commarea Length Check : If EIBCALEN is 0 (indicating direct transaction execution without logging in), the program bypasses processing, sets the target program to 'COSGN00C' , and redirects to the Sign-on screen.
  • Re-entry Check : The program uses CDEMO-PGM-REENTER to determine if this is the initial load of the screen or a postback. On initial load, if CDEMO-CU03-USR-SELECTED contains a passed User ID, it automatically executes the Fetch logic.

Data Elements Processed

Screen and Input Fields
  • USRIDINI / USRIDINO : User ID input/output field (8 characters).
  • FNAMEI / FNAMEO : First Name output field (20 characters).
  • LNAMEI / LNAMEO : Last Name output field (20 characters).
  • USRTYPEI / USRTYPEO : User Type output field (1 character; 'A' = Admin, 'U' = User).
  • ERRMSGO / ERRMSGC : Error/Status message text and attribute color control field.
Backend and Control Fields
  • SEC-USR-ID : Key field used to read and delete records from the USRSEC VSAM file.
  • SEC-USR-FNAME : Retrieved user's first name.
  • SEC-USR-LNAME : Retrieved user's last name.
  • SEC-USR-TYPE : Retrieved user's role type.
  • CARDDEMO-COMMAREA : Shared communication area passed between programs.
  • CDEMO-FROM-TRANID : Set to 'CU03' before transferring control.
  • CDEMO-FROM-PROGRAM : Set to 'COUSR03C' before transferring control.
  • CDEMO-TO-PROGRAM : Target program name for redirection.
  • CDEMO-CU03-USR-SELECTED : Pre-selected User ID passed from an external list program.

Exception and Error Handling

CICS File I/O Exception Handling

The program explicitly checks the CICS response code ( WS-RESP-CD ) after performing READ and DELETE operations on the USRSEC VSAM file:

  • DFHRESP(NORMAL) :
  • On READ : Displays the retrieved user details and prompts the user with "Press PF5 key to delete this user ..." in neutral/yellow.
  • On DELETE : Clears the screen and displays a green success message: "User [UserID] has been deleted ..." .
  • DFHRESP(NOTFND) :
  • Displayed when the entered User ID does not exist in the security file.
  • Sets WS-ERR-FLG to 'Y' , displays "User ID NOT found..." in red, and positions the cursor on the User ID field.
  • Other Response Codes :
  • For any unexpected system errors (e.g., file disabled or locked), the program displays the raw response and reason codes ( WS-RESP-CD and WS-REAS-CD ) to the system console via a DISPLAY statement.
  • Displays a generic error message on the screen: "Unable to lookup User..." (on Read) or "Unable to Update User..." (on Delete) in red, and positions the cursor on the First Name field ( FNAMEL = -1 ).
CICS Command Failures

The program utilizes explicit response checking ( RESP and RESP2 options) on all file operations rather than relying on global EXEC CICS HANDLE CONDITION statements. This ensures structured, inline error handling and prevents unexpected program abends.

Security and Authorization Checks

  • Direct Access Prevention : If a user attempts to bypass the sign-on screen and execute the transaction CU03 directly, EIBCALEN will be 0 . The program detects this, blocks access, and immediately redirects the user to the Sign-on screen ( COSGN00C ).
  • Role-Based Access : The program relies on the upstream authentication process ( COSGN00C ) and menu navigation ( COADM01C ) to ensure that only users with Administrator privileges ( CDEMO-USRTYP-ADMIN is 'A' ) can access this program.
  • No Explicit Platform Security : No explicit external security manager (such as RACF) checks or standard CICS Signon ( CESN / CESF ) integrations are implemented within this program.

Performance Considerations

  • Pseudo-Conversational Design : The program is designed to be pseudo-conversational. It does not remain active in memory while waiting for user input. Instead, it sends the map and issues an EXEC CICS RETURN specifying the transaction ID CU03 and passing the CARDDEMO-COMMAREA . This minimizes CICS resource consumption and maximizes concurrent user capacity.
  • Efficient VSAM Access :
  • The read operation on the USRSEC file is a direct key read ( RIDFLD ), which is highly efficient.
  • During deletion, the program performs a READ with the UPDATE option to lock the record, followed immediately by a DELETE command. This minimizes the duration of the record lock, preventing database contention.

<h2

CSUTLDTC

cbl/CSUTLDTC.cbl
scanner114 code lines1 calls out4 called by0 copybooks0 files
MAT / Gemini

Date Validation and Formatting Utility Using System-Level Date Services

Date Validation and Formatting Utility Using System-Level Date Services

This utility program serves as a centralized date validation service within the application suite. Its primary business purpose is to verify the integrity and correctness of date strings against a specified format mask. By ensuring that dates are accurate and conform to expected structures, the program prevents downstream processing errors and maintains high data quality across the enterprise system.

The program accepts an input date string …

Full MAT analysis

Date Validation and Formatting Utility Using System-Level Date Services

This utility program serves as a centralized date validation service within the application suite. Its primary business purpose is to verify the integrity and correctness of date strings against a specified format mask. By ensuring that dates are accurate and conform to expected structures, the program prevents downstream processing errors and maintains high data quality across the enterprise system.

The program accepts an input date string and a corresponding format template from a calling application. It prepares these inputs and invokes standard mainframe system-level date services to convert the date into a Lilian format, which represents the number of days elapsed since a standard historical epoch. This conversion process inherently validates whether the input date is a real, calendar-compliant date according to the specified format.

Upon executing the validation, the program analyzes the feedback codes returned by the system service. It is capable of diagnosing a wide range of specific date anomalies, such as invalid months, non-numeric characters, unsupported date ranges, incorrect eras, or mismatches between the date string and its format mask.

Finally, the utility translates these technical diagnostic codes into user-friendly status messages. It constructs a detailed output message containing the validation result, severity level, error codes, the original date tested, and the format mask utilized. This structured response, along with a numeric severity return code, is passed back to the calling program, enabling automated decision-making on whether to accept or reject the transaction data.

Business Logic

The CSUTLDTC program is a utility program designed to validate a date string against a specified format mask. It acts as a wrapper for the IBM Language Environment (LE) callable service CEEDAYS . The program converts a character string representing a date into a Lilian date (the number of days since October 14, 1582) to verify its validity.

The execution flow of the program is as follows:

  • Initialization : The program initializes the output message area ( WS-MESSAGE ) and the local date storage ( WS-DATE ) to spaces.
  • Input Preparation :
  • The input date ( LS-DATE ) and its length are moved into a variable-length string structure ( WS-DATE-TO-TEST ) required by the CEEDAYS API.
  • The input date format mask ( LS-DATE-FORMAT ) and its length are moved into a similar variable-length string structure ( WS-DATE-FORMAT ).
  • API Invocation : The program calls the IBM LE service CEEDAYS using the prepared date string, format mask, an output field for the Lilian date ( OUTPUT-LILLIAN ), and a 12-byte feedback code structure ( FEEDBACK-CODE ).
  • Result Evaluation :
  • The program extracts the severity and message number from the returned FEEDBACK-CODE .
  • It evaluates the feedback code using predefined condition tokens (88-level condition names) to determine if the date is valid or to identify the specific validation error.
  • A descriptive 15-character status message is moved to WS-RESULT based on the evaluation.
  • Output Formatting : The program constructs a formatted 80-character message in WS-MESSAGE containing the severity, message number, validation result, the tested date, and the format mask used.
  • Program Return : The formatted message is returned to the calling program via LS-RESULT . The program's RETURN-CODE is set to the numeric severity level of the feedback code (where 0 indicates success/valid date, and non-zero values indicate errors) before exiting.
Important Constants
  • X'0000000000000000' ( FC-INVALID-DATE ): Represents a successful execution of CEEDAYS (no error/warning), indicating the date is valid.
  • X'000309CB59C3C5C5' ( FC-INSUFFICIENT-DATA ): Error code indicating insufficient input data for the specified format.
  • X'000309CC59C3C5C5' ( FC-BAD-DATE-VALUE ): Error code indicating an invalid date value (e.g., day 32).
  • X'000309CD59C3C5C5' ( FC-INVALID-ERA ): Error code indicating an invalid era specification.
  • X'000309D159C3C5C5' ( FC-UNSUPP-RANGE ): Error code indicating the date falls outside the supported Lilian range (before October 15, 1582, or after December 31, 9999).
  • X'000309D559C3C5C5' ( FC-INVALID-MONTH ): Error code indicating an invalid month value.
  • X'000309D659C3C5C5' ( FC-BAD-PIC-STRING ): Error code indicating an invalid picture string (format mask).
  • X'000309D859C3C5C5' ( FC-NON-NUMERIC-DATA ): Error code indicating non-numeric data was found where numeric data was expected.
  • X'000309D959C3C5C5' ( FC-YEAR-IN-ERA-ZERO ): Error code indicating the year in the specified era is zero.
Validation Logic

The program delegates all date validation to the IBM LE CEEDAYS API. Before calling the API, the program performs no manual validation on the input fields.

The validation checks performed by CEEDAYS and evaluated by the program include:

  • Format Matching : Verifies if the input date string matches the structure of the provided format mask.
  • Numeric Integrity : Ensures that character positions defined as numeric in the mask contain only numeric digits.
  • Value Range Checks :
  • Month must be between 1 and 12.
  • Day must be valid for the specified month and year (including leap year calculations).
  • Year must be within the supported range of the Lilian calendar (1582 to 9999).
  • Condition Code Mapping : The program evaluates the 12-byte feedback token returned by CEEDAYS . If the token is binary zero ( X'0000000000000000' ), the date is validated as correct. Any other token value indicates a specific validation failure, which is mapped to a corresponding error message.
Data Elements Processed
  • LS-DATE (Input): A 10-character field containing the date string to be validated.
  • LS-DATE-FORMAT (Input): A 10-character field containing the format mask (e.g., YYYY-MM-DD ) used to parse the input date.
  • LS-RESULT (Output): An 80-character field populated with the formatted execution summary, including severity, message number, validation status, input date, and mask.
  • WS-DATE-TO-TEST (Internal): A variable-length string structure containing the length and text of the input date, passed to CEEDAYS .
  • WS-DATE-FORMAT (Internal): A variable-length string structure containing the length and text of the format mask, passed to CEEDAYS .
  • OUTPUT-LILLIAN (Internal): A binary fullword ( PIC S9(9) BINARY ) that receives the calculated Lilian date from CEEDAYS .
  • FEEDBACK-CODE (Internal): A 12-byte condition token structure that receives the execution status from CEEDAYS .
  • RETURN-CODE (Output/System): A special register set to the numeric severity of the validation result (e.g., 0 for success, 3 for severe error) to communicate the status back to the operating system or calling job step.
Exception and Error Handling
  • API Feedback Monitoring : The program does not utilize standard COBOL ON EXCEPTION clauses. Instead, it relies on the feedback code parameter of the CEEDAYS API to capture errors gracefully without causing an application abend (ABEND).
  • Error Code Mapping : The program inspects the SEVERITY and MSG-NO fields within the FEEDBACK-CODE structure.
  • Graceful Degradation : If an unsupported or unexpected error occurs, the EVALUATE statement falls back to the WHEN OTHER clause, marking the date as invalid ( 'Date is invalid' ) and capturing the severity and message number returned by the system.
  • Return Code Propagation : The numeric severity of the error (extracted from the feedback code) is moved to the RETURN-CODE register. This allows calling programs or job control language (JCL) to check the success or failure of the validation.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • LE Callable Services Overhead : The program calls CEEDAYS , which is a dynamic Language Environment service. While highly optimized by IBM, frequent dynamic calls to LE services in high-volume batch processing loops can introduce minor CPU overhead compared to inline date validation routines.
  • No I/O Operations : The program performs all operations in memory and does not access databases (DB2), files (VSAM), or external queues, making its execution extremely fast.

<h2

DBUNLDGS

app-authorization-ims-db2-mq/cbl/DBUNLDGS.CBL
scanner198 code lines4 calls out0 called by6 copybooks0 files
MAT / Gemini

Pending Authorization Data Extraction and Archiving Utility

Pending Authorization Data Extraction and Archiving Utility

This utility program is designed to extract and archive pending credit card authorization data from an active hierarchical database. Its primary business purpose is to offload pending transaction summaries and their associated detailed records into sequential flat files. This process supports downstream financial reporting, auditing, and data warehousing, while helping to maintain optimal performance in the primary transactional database.

The program …

Full MAT analysis

Pending Authorization Data Extraction and Archiving Utility

This utility program is designed to extract and archive pending credit card authorization data from an active hierarchical database. Its primary business purpose is to offload pending transaction summaries and their associated detailed records into sequential flat files. This process supports downstream financial reporting, auditing, and data warehousing, while helping to maintain optimal performance in the primary transactional database.

The program processes data structured in a parent-child hierarchy. At the parent level, it retrieves pending authorization summary records. These summaries contain high-level account information, including customer and account identifiers, credit and cash limits, current balances, and cumulative totals for both approved and declined authorization attempts.

For every account summary retrieved, the program extracts all corresponding child records containing granular transaction details. These detailed records capture specific transaction-level information, such as the card number used, transaction date and time, merchant details (including name, category, and location), transaction amounts, and fraud-related indicators or match statuses.

During execution, the program sequentially reads each account summary, validates the account identifier, and writes the summary to a primary sequential output file. It then immediately retrieves and writes all associated detailed transaction records to a secondary sequential output file, preserving the relational link between the summary and detail levels. The program includes built-in error handling that monitors database operations, logging diagnostic details and halting execution in the event of an unexpected system failure to ensure data integrity.

Business Logic Overview

The DBUNLDGS program is an IMS batch utility designed to unload pending authorization data from an active IMS database and write it sequentially into GSAM (Generalized Sequential Access Method) files.

The program processes a hierarchical database structure consisting of:

  • A parent segment: PAUTSUM0 (Pending Authorization Summary)
  • A child segment: PAUTDTL1 (Pending Authorization Details)

The core execution flow is as follows:

  • Initialization : The program accepts the current system date and Julian date, and displays startup messages.
  • Parent Segment Processing : The program sequentially scans the database for parent segments ( PAUTSUM0 ) using a Get Next ( GN ) call. For each parent segment retrieved:
  • It validates that the account identifier ( PA-ACCT-ID ) is numeric.
  • If valid, it writes the parent segment to the parent GSAM sequential file using an Insert ( ISRT ) call.
  • Child Segment Processing : For each valid parent segment, the program enters a nested loop to retrieve all associated child segments ( PAUTDTL1 ) using Get Next within Parent ( GNP ) calls.
  • Each retrieved child segment is written to the child GSAM sequential file using an Insert ( ISRT ) call.
  • This loop continues until no more child segments exist for the current parent (indicated by an IMS status code of 'GE' ).
  • Termination : Once the end of the parent database is reached (indicated by an IMS status code of 'GB' ), the program terminates processing and exits.
Important Constants
  • FUNC-GN ( "GN " ) : IMS function code used to retrieve the next sequential segment in the database.
  • FUNC-GNP ( "GNP " ) : IMS function code used to retrieve the next sequential child segment under the currently established parent segment.
  • FUNC-ISRT ( "ISRT" ) : IMS function code used to insert records into the GSAM output files.
  • ROOT-UNQUAL-SSA ( "PAUTSUM0 " ) : Unqualified Segment Search Argument used to target the parent Pending Authorization Summary segment.
  • CHILD-UNQUAL-SSA ( "PAUTDTL1 " ) : Unqualified Segment Search Argument used to target the child Pending Authorization Details segment.
  • RETURN-CODE ( 16 ) : The return code assigned to the system register to trigger a job step failure in the event of an abnormal termination (ABEND).
Validation Logic

Before processing database records, the program performs several structural and data integrity checks:

  • Numeric Key Validation : The program verifies that the parent account identifier ( PA-ACCT-ID ) is strictly numeric ( IF PA-ACCT-ID IS NUMERIC ) before attempting to write the parent record or retrieve its dependent child segments. If the key is non-numeric, the entire hierarchical branch (parent and its children) is bypassed.
  • IMS Status Code Verifications :
  • Parent Retrieval ( GN ) : The program expects a status code of spaces ( " " ) for a successful read, or "GB" to signal the end of the database. Any other status code is treated as a database failure.
  • Child Retrieval ( GNP ) : The program expects a status code of spaces ( " " ) for a successful read, or "GE" to signal that no more child segments exist under the current parent. Any other status code is treated as a database failure.
  • GSAM Output Insertion ( ISRT ) : For both parent and child GSAM writes, the program verifies that the respective PCB status code ( PASFL-PCB-STATUS and PADFL-PCB-STATUS ) is spaces ( " " ). Any non-space status code indicates a write failure and halts execution.
Data Elements Processed

Parent Segment ( PENDING-AUTH-SUMMARY )

  • PA-ACCT-ID (Packed Decimal, S9(11) COMP-3 ): The primary account identifier, used as the key and validated for numeric integrity.
  • PA-CUST-ID (Numeric, 9(09) ): The unique customer identifier.
  • PA-AUTH-STATUS (Alphanumeric, X(01) ): The status of the authorization.
  • PA-ACCOUNT-STATUS (Alphanumeric, X(02) occurs 5 times): An array containing status codes associated with the account.
  • Financial Limits and Balances :
  • PA-CREDIT-LIMIT / PA-CASH-LIMIT (Packed Decimal, S9(09)V99 COMP-3 )
  • PA-CREDIT-BALANCE / PA-CASH-BALANCE (Packed Decimal, S9(09)V99 COMP-3 )
  • Authorization Counters and Amounts :
  • PA-APPROVED-AUTH-CNT / PA-DECLINED-AUTH-CNT (Binary, S9(04) COMP )
  • PA-APPROVED-AUTH-AMT / PA-DECLINED-AUTH-AMT (Packed Decimal, S9(09)V99 COMP-3 )

Child Segment ( PENDING-AUTH-DETAILS )

  • PA-AUTHORIZATION-KEY : A composite key consisting of:
  • PA-AUTH-DATE-9C (Packed Decimal, S9(05) COMP-3 ): The authorization date.
  • PA-AUTH-TIME-9C (Packed Decimal, S9(09) COMP-3 ): The authorization time.
  • PA-CARD-NUM (Alphanumeric, X(16) ): The card number used for the transaction.
  • PA-TRANSACTION-AMT / PA-APPROVED-AMT (Packed Decimal, S9(10)V99 COMP-3 ): The requested and approved transaction amounts.
  • PA-MATCH-STATUS (Alphanumeric, X(01) ): Status flag indicating if the transaction is pending ( 'P' ), declined ( 'D' ), expired ( 'E' ), or matched ( 'M' ).
  • PA-MERCHANT-ID / PA-MERCHANT-NAME (Alphanumeric): Identifiers for the merchant where the transaction was initiated.

Control and Audit Fields

  • WS-NO-SUMRY-READ (Binary, S9(8) COMP ): A counter incremented during both parent and child reads (due to a shared counter increment block in the child loop).
  • WS-AUTH-SMRY-PROC-CNT (Numeric, 9(8) ): A counter tracking processed records.
  • CURRENT-DATE (Numeric, 9(06) ) / CURRENT-YYDDD (Numeric, 9(05) ): System date fields captured during program initialization.
Exception and Error Handling
  • Database and File I/O Failures : If any IMS database retrieval ( GN , GNP ) or GSAM file insertion ( ISRT ) returns an unexpected status code, the program immediately branches to the error handling routine 9999-ABEND .
  • Diagnostic Reporting : Prior to terminating, the program writes diagnostic information to the system display output, including:
  • The specific paragraph where the failure occurred.
  • The failing IMS status code (e.g., from PAUT-PCB-STATUS , PASFL-PCB-STATUS , or PADFL-PCB-STATUS ).
  • The contents of the Key Feedback Area ( PAUT-KEYFB or PASFL-KEYFB ) to help identify the database record that caused the failure.
  • Abnormal Termination (ABEND) : The program moves a severity code of 16 to the RETURN-CODE special register and executes a GOBACK . This ensures that the calling JCL step fails, preventing downstream jobs from executing with incomplete data.
Security and Authorization Checks

No explicit security checks identified. The program relies entirely on environment-level security infrastructure, such as RACF dataset profiles for GSAM files and IMS PSB/PCB security definitions to control database access.

Performance Considerations
  • Hierarchical Database Traversal : The program utilizes GNP (Get Next within Parent) rather than unqualified GN calls to retrieve child segments. This restricts database searching strictly to the children of the currently positioned parent, preventing unnecessary database scans and minimizing I/O overhead.
  • GSAM Sequential Buffering : By utilizing GSAM ( PASFLPCB and PADFLPCB ) instead of standard MVS sequential files (QSAM), the program leverages IMS-managed buffering and sequential access patterns, which are highly optimized for high-volume batch operations.
  • Lack of Intermediate Commits : The program does not issue database checkpoints ( CHKP ) during processing. It runs as a single unit of work. While highly efficient for read-only unloads of moderate databases, extremely large databases may require the implementation of checkpointing to release database locks and manage log space.

<h2

PAUDBLOD

app-authorization-ims-db2-mq/cbl/PAUDBLOD.CBL
scanner251 code lines3 calls out0 called by4 copybooks2 files
MAT / Gemini

IMS Database Loading Program for Pending Credit Card Authorizations

IMS Database Loading Program for Pending Credit Card Authorizations

The primary business purpose of this program is to populate and update a hierarchical database with pending credit card authorization data. It processes incoming transaction information to ensure that financial records, credit limits, and authorization histories are accurately maintained. By loading this data, the system enables downstream applications to access up-to-date credit balances, transaction statuses, and fraud-related indicators for …

Full MAT analysis

IMS Database Loading Program for Pending Credit Card Authorizations

The primary business purpose of this program is to populate and update a hierarchical database with pending credit card authorization data. It processes incoming transaction information to ensure that financial records, credit limits, and authorization histories are accurately maintained. By loading this data, the system enables downstream applications to access up-to-date credit balances, transaction statuses, and fraud-related indicators for customer accounts.

The program operates in two distinct sequential phases. In the first phase, it reads an input file containing account-level authorization summaries. These summaries contain high-level financial metrics for each customer, including credit and cash limits, current balances, and cumulative counts and amounts of approved or declined authorizations. The program inserts these records as the primary parent nodes (root segments) within the database structure, establishing the foundation for each customer's authorization profile.

In the second phase, the program processes a separate input file containing detailed transaction-level authorization records. These details include specific card numbers, transaction amounts, merchant information (such as name, location, and category), and transaction status codes. For each detail record, the program searches the database to locate the corresponding parent account summary. Once the parent account is verified, the transaction detail is inserted as a child segment directly beneath it, preserving the hierarchical relationship between the account summary and its individual transactions.

To ensure data integrity and operational reliability, the program incorporates robust error-handling and status-monitoring procedures. It verifies the success of every file and database operation, distinguishing between expected conditions—such as identifying duplicate records already present in the database—and critical system failures. If a critical error occurs, such as an inaccessible input file or a database communication failure, the program logs the error details and executes a controlled termination to prevent data corruption.

Business Logic Overview

The program PAUDBLOD is an IMS database load utility designed to populate a hierarchical database with pending authorization data. It processes two sequential input files: INFILE1 (containing root segment data) and INFILE2 (containing child segment data).

The program executes its processing in two distinct sequential phases:

  • Root Segment Loading : The program reads root segment records from INFILE1 and inserts them into the IMS database under the segment name PAUTSUM0 (Pending Authorization Summary).
  • Child Segment Loading : The program reads child segment records from INFILE2 . For each child record, it extracts the parent root key, performs a Get Unique ( GU ) call to locate and establish parentage on the corresponding root segment ( PAUTSUM0 ), and then inserts the child segment ( PAUTDTL1 , Pending Authorization Details) under that root.
Important Constants
  • FUNC-GU ( 'GU ' ) : IMS Get Unique function code used to retrieve a specific segment.
  • FUNC-ISRT ( 'ISRT' ) : IMS Insert function code used to add new segments to the database.
  • ROOT-UNQUAL-SSA ( 'PAUTSUM0 ' ) : Unqualified Segment Search Argument used for inserting root segments.
  • CHILD-UNQUAL-SSA ( 'PAUTDTL1 ' ) : Unqualified Segment Search Argument used for inserting child segments.
  • QUAL-SSA-SEG-NAME ( 'PAUTSUM0' ) : Segment name used in the qualified SSA to locate the parent root.
  • QUAL-SSA-KEY-FIELD ( 'ACCNTID ' ) : Key field name used in the qualified SSA to search by Account ID.
  • QUAL-SSA-REL-OPER ( 'EQ' ) : Relational operator (Equal) used in the qualified SSA.
Validation Logic
  • File Open Status Verification : Immediately after opening INFILE1 and INFILE2 , the program validates the file status codes ( WS-INFIL1-STATUS and WS-INFIL2-STATUS ). If either status is not '00' or spaces, the program logs an error and terminates via the ABEND routine.
  • Numeric Key Validation : Before processing a child segment from INFILE2 , the program verifies that the extracted parent key ( ROOT-SEG-KEY ) is numeric ( IF ROOT-SEG-KEY IS NUMERIC ). If the key is non-numeric, the record is skipped.
  • IMS Status Code Validation :
  • Root Insertion : After an insert call ( ISRT ) for a root segment, the program checks PAUT-PCB-STATUS . A status of spaces indicates success. A status of 'II' (duplicate segment) is tolerated, and processing continues. Any other status triggers an immediate ABEND.
  • Root Retrieval ( GU ) : Before inserting a child segment, the program attempts to retrieve the parent root. It checks PAUT-PCB-STATUS for spaces (success). Note: Due to a logical nesting anomaly in paragraph 3100-INSERT-CHILD-SEG , if the GU call returns a non-space status (such as 'GE' for segment not found), the error-handling block is bypassed, and the program silently skips the child insertion instead of abending.
  • Child Insertion : After inserting a child segment, the program checks PAUT-PCB-STATUS . Spaces (success) and 'II' (duplicate) are accepted. Any other status triggers an ABEND.
Data Elements Processed

INFIL1-REC / PENDING-AUTH-SUMMARY (Root Segment) :

  • PA-ACCT-ID (Packed Decimal, S9(11) COMP-3 ): The unique Account ID, which serves as the root segment key.
  • PA-CUST-ID (Numeric, 9(09) ): The Customer ID associated with the account.
  • PA-AUTH-STATUS (Alphanumeric, X(01) ): Current authorization status.
  • PA-ACCOUNT-STATUS (Alphanumeric Array, X(02) occurs 5 times): Status codes for the account.
  • Financial Limits and Balances (Packed Decimals, S9(09)V99 COMP-3 ): Includes credit limit, cash limit, credit balance, and cash balance.
  • Counters (Packed Decimals, S9(04) COMP ): Approved and declined authorization counts.
  • Amounts (Packed Decimals, S9(09)V99 COMP-3 ): Total approved and declined authorization amounts.

INFIL2-REC (Child Segment Input) :

  • ROOT-SEG-KEY (Packed Decimal, S9(11) COMP-3 ): The parent Account ID prefix used to match the child record to its parent root segment.
  • CHILD-SEG-REC / PENDING-AUTH-DETAILS (Child Segment):
  • PA-AUTHORIZATION-KEY (Packed Decimal): Composite key containing the authorization date ( PA-AUTH-DATE-9C ) and time ( PA-AUTH-TIME-9C ).
  • PA-CARD-NUM (Alphanumeric, X(16) ): The card number used for the transaction.
  • PA-TRANSACTION-AMT (Packed Decimal, S9(10)V99 COMP-3 ): The requested transaction amount.
  • PA-APPROVED-AMT (Packed Decimal, S9(10)V99 COMP-3 ): The actual approved amount.
  • PA-MATCH-STATUS (Alphanumeric, X(01) ): Status of the transaction match (e.g., 'P' for Pending, 'D' for Declined, 'E' for Expired, 'M' for Matched).
  • Merchant Details: Includes Merchant ID, Name, City, State, and Zip Code.
Exception and Error Handling
  • File I/O Failures : Any failure during the OPEN operations for INFILE1 or INFILE2 results in an error message displayed to the console and a branch to 9999-ABEND .
  • Database Insert Failures : If an ISRT call for either a root or child segment returns an unexpected status code (any code other than spaces or 'II' ), the program displays the failed status code, prints the Key Feedback Area ( PAUT-KEYFB ) for child segments, and calls 9999-ABEND .
  • Database Retrieval Failures : If a GU call to locate a parent root segment fails, the program is designed to display 'ROOT GU CALL FAIL' and ABEND. However, because the failure check is nested inside the success check ( IF PAUT-PCB-STATUS = SPACES ), a failed GU call will bypass the ABEND and skip the child insertion.
  • Abnormal Termination ( 9999-ABEND ) :
  • Displays the message 'IMS LOAD ABENDING ...' .
  • Sets the system RETURN-CODE to 16 .
  • Executes GOBACK to terminate the program run immediately with a severe error status.
Security and Authorization Checks

No explicit security checks identified. The program relies entirely on external mainframe security infrastructure, such as RACF dataset profiles for file access control and IMS PSB/PCB security definitions to authorize database access.

Performance Considerations
  • Sequential Processing : The program processes both input files sequentially, which is highly efficient for bulk loading operations.
  • Lack of Checkpoint/Commit Logic : Although variables for checkpointing are defined in WORKING-STORAGE (e.g., WS-NO-CHKP , WK-CHKPT-ID ), there are no CHKP (Checkpoint) calls implemented in the PROCEDURE DIVISION . The entire load runs as a single, long-running database transaction. For very large input datasets, this can lead to IMS lock escalation, excessive log utilization, and long recovery times in the event of a failure.
  • Random Parent Access : For every child segment inserted, the program performs a GU call to locate the parent root. If the child input file ( INFILE2 ) is not sorted in the same physical sequence as the database root keys, this will result in random database read operations, significantly increasing I/O overhead and processing time. Sorting INFILE2 by ROOT-SEG-KEY prior to execution is critical for optimal performance.

<h2

PAUDBUNL

app-authorization-ims-db2-mq/cbl/PAUDBUNL.CBL
scanner207 code lines2 calls out0 called by4 copybooks2 files
MAT / Gemini

Pending Authorization Database Unload Utility

Pending Authorization Database Unload Utility

The program is a specialized database extraction utility designed to unload pending credit card authorization data from an IMS hierarchical database into flat sequential files. This process is critical for downstream reporting, archiving, or data migration activities, ensuring that active and historical authorization records are preserved in a standard format.

The utility processes data hierarchically, starting with the root segment which contains pending …

Full MAT analysis

Pending Authorization Database Unload Utility

The program is a specialized database extraction utility designed to unload pending credit card authorization data from an IMS hierarchical database into flat sequential files. This process is critical for downstream reporting, archiving, or data migration activities, ensuring that active and historical authorization records are preserved in a standard format.

The utility processes data hierarchically, starting with the root segment which contains pending authorization summaries. For each account, the program extracts high-level financial metrics such as credit limits, cash balances, and counts of approved or declined transactions. This summary information is validated and written directly to the first sequential output file.

For every authorization summary retrieved, the program navigates to the associated child segments containing detailed transaction-level data. These details include card numbers, transaction amounts, merchant information, and fraud indicators. The utility extracts these details, associates them with the parent account identifier, and writes them to a second sequential output file, maintaining the relational integrity of the hierarchical data.

Operationally, the program manages file status checks during open and close operations to ensure data integrity. It utilizes standard database status codes to detect the end of database segments or handle unexpected access errors. In the event of a database or file system failure, the program terminates gracefully with an error code to alert system operators.

Business Logic Overview

The PAUDBUNL program is an IMS database unload utility designed to extract hierarchical data from an IMS database and write it to sequential flat files. The program processes two levels of the database hierarchy:

  • Root Segment ( PAUTSUM0 ) : Pending Authorization Summary.
  • Child Segment ( PAUTDTL1 ) : Pending Authorization Details.

The program sequentially scans the database, extracting each root segment and its associated child segments. The extracted data is distributed into two separate sequential output files:

  • OPFILE1 : Receives the raw data of the root segments ( PENDING-AUTH-SUMMARY ).
  • OPFILE2 : Receives a composite record containing the parent root segment's key ( PA-ACCT-ID ) prepended to the raw child segment data ( PENDING-AUTH-DETAILS ).
Detailed Process Flow

1. Initialization ( 1000-INITIALIZE )

  • Retrieves the current system date in YYMMDD format and the current day in Julian format ( YYDDD ).
  • Displays startup messages, including the current system date.
  • Opens the sequential output files OPFILE1 and OPFILE2 .
  • Validates the file status of both files immediately after opening. If any file fails to open successfully, the program terminates abnormally.

2. Root Segment Processing Loop ( 2000-FIND-NEXT-AUTH-SUMMARY )

The program enters a loop that executes until the end of the root database segments is reached ( WS-END-OF-ROOT-SEG = 'Y' ).

  • Issues an IMS GN (Get Next) call using the unqualified SSA PAUTSUM0 to retrieve the next Pending Authorization Summary root segment.
  • On Successful Retrieval (Status Code SPACES ):
  • Increments the summary read counter ( WS-NO-SUMRY-READ ) and the summary processed counter ( WS-AUTH-SMRY-PROC-CNT ).
  • Maps the retrieved segment data to the OPFILE1 record area.
  • Extracts the Account ID ( PA-ACCT-ID ) from the root segment and moves it to the child record's parent key field ( ROOT-SEG-KEY ).
  • Validates if the PA-ACCT-ID is numeric. If numeric:
  • Writes the root segment record to OPFILE1 .
  • Initializes the child segment loop control flag ( WS-END-OF-CHILD-SEG ).
  • Executes the child segment processing loop ( 3000-FIND-NEXT-AUTH-DTL ) to retrieve all child segments associated with this specific parent root.
  • On End of Database (Status Code GB ):
  • Sets the end-of-database flags ( END-OF-AUTHDB and WS-END-OF-ROOT-SEG = 'Y' ) to terminate the main processing loop.
  • On Any Other Status Code:
  • Displays the failing status code and key feedback area, then triggers the ABEND routine.

3. Child Segment Processing Loop ( 3000-FIND-NEXT-AUTH-DTL )

This loop executes iteratively for the current parent root segment until no more child segments are found ( WS-END-OF-CHILD-SEG = 'Y' ).

  • Issues an IMS GNP (Get Next Within Parent) call using the unqualified SSA PAUTDTL1 to retrieve the next child segment under the current parent.
  • On Successful Retrieval (Status Code SPACES ):
  • Sets the MORE-AUTHS flag.
  • Increments the summary read and processed counters (Note: The program incorrectly increments the root summary counters WS-NO-SUMRY-READ and WS-AUTH-SMRY-PROC-CNT inside the child loop).
  • Maps the retrieved child segment data to the CHILD-SEG-REC portion of the OPFILE2 record.
  • Writes the composite record (Parent Key + Child Segment) to OPFILE2 .
  • On No More Child Segments (Status Code GE ):
  • Sets WS-END-OF-CHILD-SEG to 'Y' to terminate the child loop for the current parent.
  • On Any Other Status Code:
  • Displays the failing status code and key feedback area, then triggers the ABEND routine.
  • Resets the PCB status field ( PAUT-PCB-STATUS ) to spaces before exiting the paragraph.

4. Termination ( 4000-FILE-CLOSE )

  • Closes OPFILE1 and OPFILE2 .
  • Validates the file status of both files during the close operation and displays an error message if any close operation fails.
  • Returns control to the operating system via GOBACK .
Important Constants
  • FUNC-GN ( 'GN ' ) : IMS Get Next function code used to sequentially retrieve root segments.
  • FUNC-GNP ( 'GNP ' ) : IMS Get Next Within Parent function code used to retrieve child segments belonging to the current root segment.
  • ROOT-UNQUAL-SSA ( 'PAUTSUM0 ' ) : Unqualified Segment Search Argument targeting the Pending Authorization Summary root segment.
  • CHILD-UNQUAL-SSA ( 'PAUTDTL1 ' ) : Unqualified Segment Search Argument targeting the Pending Authorization Details child segment.
  • RETURN-CODE ( 16 ) : The return code assigned to the job step during an abnormal termination (ABEND).
Validation Logic
  • File Status Validation : After every OPEN and CLOSE statement for OPFILE1 and OPFILE2 , the program checks the file status variables ( WS-OUTFL1-STATUS and WS-OUTFL2-STATUS ). Only a status of SPACES or '00' is accepted as successful; any other value triggers an immediate program termination.
  • Data Integrity Validation : Before writing a root record to OPFILE1 and before attempting to retrieve its child segments, the program performs a numeric check on the parent account identifier:

IF PA-ACCT-ID IS NUMERIC

If the account ID contains non-numeric data, the root record is skipped, and its child segments are not processed.

  • IMS Status Code Validation :
  • For root segment retrieval ( GN ), the program validates that the status code is either spaces (success) or 'GB' (end of database).
  • For child segment retrieval ( GNP ), the program validates that the status code is either spaces (success) or 'GE' (no more segments under this parent).
  • Any unexpected status code (e.g., database unavailable 'BA' ) results in an immediate ABEND.
Data Elements Processed

Input Elements (IMS Database Segments)

PENDING-AUTH-SUMMARY (Root Segment PAUTSUM0 ) :

  • PA-ACCT-ID (Packed Decimal, S9(11) COMP-3 ): Account Identifier used as the primary key.
  • PA-CUST-ID (Numeric, 9(09) ): Customer Identifier.
  • PA-AUTH-STATUS (Alphanumeric, X(01) ): Authorization Status.
  • PA-ACCOUNT-STATUS (Alphanumeric, X(02) occurs 5 times): Array of account status codes.
  • Financial Limits and Balances (Packed Decimals, S9(09)V99 COMP-3 ): Credit Limit, Cash Limit, Credit Balance, and Cash Balance.
  • Counters and Amounts (Packed Decimals and Binary): Approved/Declined counts and amounts.

PENDING-AUTH-DETAILS (Child Segment PAUTDTL1 ) :

  • PA-AUTHORIZATION-KEY : Composite key containing packed decimal authorization date ( PA-AUTH-DATE-9C ) and time ( PA-AUTH-TIME-9C ).
  • PA-CARD-NUM (Alphanumeric, X(16) ): Card Number.
  • PA-TRANSACTION-AMT (Packed Decimal, S9(10)V99 COMP-3 ): Transaction Amount.
  • PA-APPROVED-AMT (Packed Decimal, S9(10)V99 COMP-3 ): Approved Amount.
  • PA-MATCH-STATUS (Alphanumeric, X(01) ): Match status flag (Pending 'P' , Declined 'D' , Expired 'E' , Matched 'M' ).
  • Merchant details (ID, Name, City, State, Zip) and Transaction ID.

Output Elements (Sequential Files)

  • OPFILE1 ( OPFIL1-REC ) : A 100-byte flat record containing the raw PENDING-AUTH-SUMMARY segment.
  • OPFILE2 ( OPFIL2-REC ) : A composite record containing:
  • ROOT-SEG-KEY (Packed Decimal, S9(11) COMP-3 ): The parent PA-ACCT-ID extracted from the root segment.
  • CHILD-SEG-REC (Alphanumeric, X(200) ): The raw 200-byte PENDING-AUTH-DETAILS segment.
Exception and Error Handling
  • File I/O Failures : If an error occurs during the OPEN or CLOSE operations of OPFILE1 or OPFILE2 , the program displays an error message containing the file status code (e.g., ERROR IN OPENING OPFILE1: [status] ) and calls the 9999-ABEND routine.
  • Database Call Failures : If an IMS call returns an unexpected status code, the program displays a diagnostic message containing the failed status code and the contents of the PCB Key Feedback Area ( PAUT-KEYFB ), then branches to 9999-ABEND .
  • Abnormal Termination Routine ( 9999-ABEND ) :
  • Displays the message IMSUNLOD ABENDING ... .
  • Sets the system RETURN-CODE register to 16 to signal a critical failure to the Job Control Language (JCL) execution environment.
  • Executes GOBACK to terminate the program.
Security and Authorization Checks

No explicit security checks identified.

Performance Considerations
  • Hierarchical Sequential Processing : The program utilizes sequential database scanning ( GN followed by GNP loops). This is the most efficient access pattern for database unloads as it minimizes database head movement and leverages physical sequential storage.
  • Lack of Checkpoint/Commit Logic : Although variables for checkpointing are defined in Working-Storage (e.g., WS-NO-CHKP , WK-CHKPT-ID , P-CHKP-FREQ ), there are no active CHKP (Checkpoint) or XRST (Symbolic Restart) calls implemented in the Procedure Division. The entire unload runs as a single, non-restartable unit of work. For extremely large databases, this could lead to long-running locks or require a complete restart from the beginning in the event of a failure.

<h2

JCL jobs

MAT / Gemini

Batch job flow — purpose, I/O and step logic. Quarry indexes these files; MAT explains what each job does.

ACCTFILE

This document provides a high-level functional and technical summary of the mainframe JCL job designed to initialize and populate the Account Data VSAM file for the CardDemo application.

MAT analysis

JCL Job Functionality Summary: Account Data VSAM Initialization and Load

This document provides a high-level functional and technical summary of the mainframe JCL job designed to initialize and populate the Account Data VSAM file for the CardDemo application.

1. Business-Level Description

The primary business purpose of this JCL job is to prepare and refresh the master Account Data store used by the CardDemo application. It ensures that the application has a clean, up-to-date, and structured repository of account information.

To achieve this, the job performs three main business functions:

  • Housekeeping/Cleanup : It deletes any pre-existing version of the Account VSAM file to prevent data duplication or conflicts.
  • Schema Creation : It defines a new, empty Key Sequenced Data Set (KSDS) VSAM file with specific structural constraints (such as record length and key location) suitable for high-performance account lookups.
  • Data Loading : It populates the newly created VSAM file by importing baseline account records from a sequential flat file.
2. Input Files

The job processes the following input file:

  • AWS.M2.CARDDEMO.ACCTDATA.PS
  • Format : Physical Sequential (PS) flat file.
  • Description : Contains the raw, sequential baseline account data to be loaded into the application.
3. Output Files

The job produces and populates the following output files:

  • AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS
  • Format : VSAM Key Sequenced Data Set (KSDS).
  • Description : The primary master file for account data, indexed by a unique key for fast transactional access.
  • Associated Components :
  • Data Component: AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS.DATA
  • Index Component: AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS.INDEX
4. Detailed Technical Steps and Data Transformations

This job is executed in three sequential steps using the IBM utility program IDCAMS . Below is the technical breakdown of each step, which can be used as a specification for modernizing or reimplementing this process in a new system.

Step 1: STEP05 - File Cleanup (DELETE)
  • Utility : IDCAMS
  • Action : Deletes the existing VSAM cluster AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS .
  • Error Handling : Includes a conditional check ( IF MAXCC LE 08 THEN SET MAXCC = 0 ). If the file does not exist (which normally returns a Return Code of 8), the job overrides the return code to 0 to prevent the job from terminating prematurely, allowing subsequent steps to run.
Step 2: STEP10 - VSAM Definition (DEFINE CLUSTER)
  • Utility : IDCAMS
  • Action : Allocates and defines the structure of the new KSDS VSAM file.
  • Technical Specifications for Reimplementation :
  • Storage Allocation : 1 primary cylinder, 5 secondary cylinders.
  • Key Structure : KEYS(11 0) . The primary key is 11 bytes long, starting at offset 0 (the very beginning of the record). This key typically represents the unique Account ID.
  • Record Length : RECORDSIZE(300 300) . Fixed-length records of exactly 300 bytes .
  • Access Type : INDEXED (indicates a Key Sequenced Data Set).
  • Share Options : SHAREOPTIONS(2 3) (allows multiple read sessions but only a single write session simultaneously).
Step 3: STEP15 - Data Loading (REPRO)
  • Utility : IDCAMS
  • Action : Copies (reproduces) the records from the sequential input file ( ACCTDATA ) into the newly defined VSAM KSDS file ( ACCTVSAM ).
  • Transformation Logic :
  • The utility reads each 300-byte record from the sequential file.
  • It extracts the first 11 bytes of each record to use as the unique index key.
  • It writes the record into the VSAM KSDS, automatically building the index component ( .INDEX ) and storing the data component ( .DATA ) in sorted order based on the 11-byte key.
5. Reimplementation Guidance for Target System

When migrating this functionality to a modern cloud or relational database environment (e.g., AWS, Java, SQL):

  • Target Storage : Map the VSAM KSDS to a relational database table (e.g., PostgreSQL, Aurora) or a NoSQL Key-Value store (e.g., DynamoDB).
  • Table Schema :
  • Create a primary key column of type VARCHAR(11) or CHAR(11) corresponding to the 11-byte key at offset 0.
  • The remaining 289 bytes can be mapped to individual columns based on the COBOL copybook layout of the account record, or stored as a single payload/attributes column if maintaining a flat structure.
  • Data Migration Pipeline :
  • Step 1 : Truncate or drop/recreate the target table (equivalent to DELETE and DEFINE CLUSTER ).
  • Step 2 : Read the sequential file line-by-line.
  • Step 3 : Parse the first 11 characters as the Primary Key, map the remaining fields, and perform a bulk insert/upsert into the target database (equivalent to REPRO ).

<h2

CARDFILE

This document provides a high-level functional summary of the mainframe JCL job designed to refresh the Card Data VSAM Key Sequenced Data Set (KSDS) and rebuild its associated Alternate Index (AIX).

MAT analysis

JCL Job Functionality Summary: Card Data VSAM Refresh and Index Build

This document provides a high-level functional summary of the mainframe JCL job designed to refresh the Card Data VSAM Key Sequenced Data Set (KSDS) and rebuild its associated Alternate Index (AIX).

1. Business-Level Description

The primary business purpose of this job is to perform a scheduled refresh of the Card Data repository used by the online CICS application ( CICSAWSA ).

To ensure data integrity and prevent file locking conflicts, the job temporarily takes the online CICS files offline. It then deletes and recreates the primary Card Data VSAM file and its Alternate Index (AIX). The job populates the new VSAM file with updated data from a sequential flat file, rebuilds the alternate index (which allows searching card data by Account ID instead of just Card Number), and finally restores online access to the files within the CICS region.

2. Input Files
  • AWS.M2.CARDDEMO.CARDDATA.PS : A sequential flat file (Physical Sequential) containing the source card data used to populate the VSAM cluster.
  • AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS : Used as an input source during the BLDINDEX step to construct the Alternate Index.
3. Output Files
  • AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS : The primary Key Sequenced Data Set (KSDS) containing the refreshed card data.
  • Key Length : 16 bytes
  • Key Offset : 0 (starts at the first byte)
  • Record Length : 150 bytes (Fixed)
  • AWS.M2.CARDDEMO.CARDDATA.VSAM.AIX : The Alternate Index cluster associated with the base KSDS.
  • Key Length : 11 bytes
  • Key Offset : 16 (starts at the 17th byte, representing the Account ID)
  • Key Type : Non-unique ( NONUNIQUEKEY )
  • AWS.M2.CARDDEMO.CARDDATA.VSAM.AIX.PATH : The logical path defining the relationship between the Alternate Index and the base KSDS.
4. Detailed Step-by-Step Technical Operations

This job executes eight distinct steps to complete the data refresh cycle. Below is the technical breakdown of each step, suitable for designing an equivalent process in a modernized cloud or relational database environment.

Step 1: Close CICS Files ( CLCIFIL )
  • Program : SDSF
  • Operation : Issues system commands to the CICS region CICSAWSA to close the files CARDDAT (Base KSDS) and CARDAIX (Alternate Index).
  • Modern Equivalent : Disabling application access, locking a database table, or pausing API endpoints that write to the target database table.
Step 2: Delete Existing VSAM Structures ( STEP05 )
  • Program : IDCAMS
  • Operation : Deletes the existing base KSDS cluster and the Alternate Index cluster.
  • Error Handling : If the files do not exist (Return Code 8), the step overrides the return code to 0 ( SET MAXCC = 0 ) to prevent job failure.
  • Modern Equivalent : Executing DROP TABLE IF EXISTS or TRUNCATE TABLE statements in a relational database.
Step 3: Define Base VSAM KSDS ( STEP10 )
  • Program : IDCAMS
  • Operation : Allocates and defines the structure for the new base KSDS ( AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS ).
  • Record Size : Fixed 150 bytes.
  • Primary Key : 16 bytes starting at position 0 (typically the Card Number).
  • Modern Equivalent : Executing a CREATE TABLE statement with a primary key constraint on the first 16 characters of the record.
Step 4: Populate Base VSAM KSDS ( STEP15 )
  • Program : IDCAMS (using REPRO )
  • Operation : Copies all records from the sequential input file ( AWS.M2.CARDDEMO.CARDDATA.PS ) into the newly defined VSAM KSDS.
  • Modern Equivalent : Performing a bulk insert, data load utility (e.g., bcp , COPY command), or running an ETL pipeline to load flat-file data into a database table.
Step 5: Define Alternate Index ( STEP40 )
  • Program : IDCAMS
  • Operation : Defines the metadata structure for the Alternate Index ( AWS.M2.CARDDEMO.CARDDATA.VSAM.AIX ).
  • Alternate Key : 11 bytes starting at position 16 (typically the Account ID).
  • Key Uniqueness : Non-unique (multiple cards can map to the same Account ID).
  • Modern Equivalent : Defining a non-clustered, non-unique index on the target database table.
Step 6: Define Path ( STEP50 )
  • Program : IDCAMS
  • Operation : Defines a logical path ( AWS.M2.CARDDEMO.CARDDATA.VSAM.AIX.PATH ) linking the Alternate Index to the base KSDS. This allows applications to access the base data transparently using the alternate key.
  • Modern Equivalent : This relationship is handled automatically by modern relational database management systems (RDBMS) when querying via a non-clustered index.
Step 7: Build Alternate Index ( STEP60 )
  • Program : IDCAMS (using BLDINDEX )
  • Operation : Extracts keys from the populated base KSDS, sorts them, and populates the Alternate Index cluster.
  • Modern Equivalent : The automatic index building/updating process performed by an RDBMS during or immediately after data load, or executing a manual REBUILD INDEX command.
Step 8: Open CICS Files ( OPCIFIL )
  • Program : SDSF
  • Operation : Issues system commands to the CICS region CICSAWSA to reopen the files CARDDAT and CARDAIX , restoring online transaction processing capabilities.
  • Modern Equivalent : Re-enabling application access, unlocking database tables, or resuming API endpoints.

<h2

CBADMCDJ

This JCL job is responsible for configuring and registering the online environment resources required for the CardDemo application (a credit card demonstration application). It executes the CICS System Definition utility ( DFHCSDUP ) to update the CICS System Definition (CSD) file.

MAT analysis

Mainframe JCL Job Summary: CICS Resource Definition (DFHCSDUP)

Business-Level Description

This JCL job is responsible for configuring and registering the online environment resources required for the CardDemo application (a credit card demonstration application). It executes the CICS System Definition utility ( DFHCSDUP ) to update the CICS System Definition (CSD) file.

Specifically, the job defines:

  • The application's load library, which contains the executable program modules.
  • The Basic Mapping Support (BMS) mapsets, which define the user interface screens (menus, login, account views, transaction details, etc.) used by online terminal users.

This configuration is a critical deployment step to ensure that the CICS region can locate the application programs and render the correct screens when users initiate CardDemo transactions.

Input Files
  • SYSIN (In-stream Control Card) : Contains the sequential text commands ( DEFINE LIBRARY and DEFINE MAPSET ) specifying the resources to be added to the CICS group CARDDEMO .
  • STEPLIB (OEM.CICSTS.V05R06M0.CICS.SDFHLOAD) : The CICS system load library containing the executable module for the DFHCSDUP utility.
  • DFHCSD (OEM.CICSTS.DFHCSD) : The target CICS System Definition VSAM KSDS file. It acts as an input to verify existing resource groups and definitions.
Output Files
  • DFHCSD (OEM.CICSTS.DFHCSD) : The updated CICS System Definition file containing the newly registered CARDDEMO resource definitions.
  • SYSPRINT / OUTDD : System output streams containing execution logs, utility messages, and confirmation/error reports of the resource definitions.
Detailed Description of Resource Definitions and Transformations

The job executes the DFHCSDUP utility with the parameter CSD(READWRITE) , which grants write access to the CSD file. It processes the in-stream control cards to perform the following actions:

1. Dynamic Program Library Definition

  • Resource : LIBRARY(COM2DOLL)
  • Target Group : CARDDEMO
  • Physical Dataset : AWS.M2.CARDDEMO.LOADLIB
  • Purpose : Registers the load library containing the compiled CardDemo COBOL programs so CICS can dynamically load and execute them.

2. Mapset (UI Screen) Definitions

The utility defines the following BMS mapsets under the CARDDEMO group. These mapsets represent the screen layouts for the application:

| Mapset Name | Description / Functional Area | Notes / Potential Anomalies in JCL |

| :--- | :--- | :--- |

| COSGN00M | Login Screen | Defined twice in the input stream. |

| COACT00S | Account Menu / Card Menu | Defined twice with different descriptions. |

| COACTVWS | View Account / View Card | Defined twice with different descriptions. |

| COACTUPS | Update Account / Update Card | Defined twice with different descriptions. |

| COACTDES | Deactivate Account / Deactivate Card | Defined twice with different descriptions. |

| COTRN00S | Transaction Screen | |

| COTRNVWS | Transaction Report Screen | |

| COTRNVDS | Transaction Details Screen | |

| COTRNATS | Add Transactions Screen | |

| COBIL00S | Bill Pay Setup Screen | |

| COADM00S | Admin Menu Screen | |

| COTSTP1S | PGM1 Test Screen | |

| COTSTP2S | Test Screen | Incomplete definition in JCL (missing GROUP and DESCRIPTION parameters). |

Note on duplicates: In standard CICS CSD processing, defining the same mapset name multiple times within the same group will overwrite the previous definition. In a migration scenario, these duplicate names must be resolved to ensure the correct screen layouts are mapped to their respective programs.

Reimplementation Guidance for Target System

When migrating this configuration to a modern cloud or distributed environment (such as AWS Blu Age, Micro Focus Enterprise Server, or a native Java/C# web application):

Library Definition ( COM2DOLL ) :

  • Map this to the application's classpath, assembly search path, or container image directory structure where the compiled binaries/bytecode reside.

Mapset Definitions (BMS Screens) :

  • Convert the BMS mapsets (typically stored as .BMS source files) into modern UI equivalents (e.g., Angular/React components, HTML/CSS templates, or ASPX/JSF views).
  • Map the CICS Mapset names (e.g., COSGN00M ) to specific UI routes or screen controllers in the new architecture.
  • Resolve the duplicate mapset names (e.g., COACT00S used for both Account Menu and Card Menu) by ensuring the modern UI router maps the correct screen template to the corresponding business logic controller.

<h2

CBEXPORT

CardDemo Branch Migration Data Export Utility

MAT analysis

Mainframe JCL Job Functional Summary: CardDemo Data Export

This document provides a formal, high-level functional summary of the mainframe JCL job designed to consolidate and export CardDemo application data. This job prepares customer, account, card, transaction, and cross-reference data for branch migration or downstream system integration.

Business-Level Description

The primary business purpose of this JCL job is to perform a comprehensive data extraction and consolidation process. It aggregates disparate customer-related information from five distinct core business databases into a single, standardized, multi-record export file.

This job is critical for data migration, system integration, or archiving. It ensures that a complete, temporally consistent snapshot of the business state is captured. The consolidated output file contains:

  • Customer Profiles : Contact details, government identifiers, and credit scores.
  • Account Financial Statuses : Balances, credit limits, and cycle activities.
  • Card Cross-Reference Mappings : Relationships linking cards, customers, and accounts.
  • Historical Transaction Records : Detailed financial transaction logs.
  • Active Card Details : Card status, expiration dates, and security codes.

The job operates in a two-step batch flow: first, it initializes a clean target VSAM Key Sequenced Data Set (KSDS); second, it executes a COBOL extraction utility that sequentially reads the source databases, formats the records with a standardized metadata header, and writes them to the target export file.

Job Step Flow

The JCL consists of two sequential execution steps:

STEP01 (IDCAMS) :

  • Purpose : Prepares the environment for the export process.
  • Action : Deletes any pre-existing instance of the export dataset to prevent duplicate data or write conflicts, and defines a new VSAM Key Sequenced Data Set (KSDS) named AWS.M2.CARDDEMO.EXPORT.DATA .
  • Key Configuration : The VSAM cluster is defined with a fixed record size of 500 bytes. The primary key is defined with a length of 4 bytes starting at offset 28 ( KEYS(4 28) ), which corresponds to the auto-incrementing sequence number generated during the export.

STEP02 (CBEXPORT) :

  • Purpose : Executes the primary data extraction and consolidation logic.
  • Action : Runs the COBOL batch utility CBEXPORT . It reads five source VSAM KSDS files sequentially, maps their contents into the standardized 500-byte export record structure, and writes them to the newly defined export VSAM dataset.
Input Files

The job processes five input VSAM Key Sequenced Data Sets (KSDS):

| DD Name | Dataset Name | Format | Description |

| :--- | :--- | :--- | :--- |

| CUSTFILE | AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS | VSAM KSDS | Contains comprehensive customer profiles, including contact details, SSN, and FICO credit scores. |

| ACCTFILE | AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS | VSAM KSDS | Contains account financial statuses, credit limits, balances, and cycle metrics. |

| XREFFILE | AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS | VSAM KSDS | Contains cross-reference mappings linking card numbers to customer IDs and account IDs. |

| TRANSACT | AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS | VSAM KSDS | Contains historical transaction records, including merchant details, timestamps, and amounts. |

| CARDFILE | AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS | VSAM KSDS | Contains active card details, including CVV codes, embossed names, and card statuses. |

Output Files

The job produces one consolidated output VSAM dataset and standard system logs:

| DD Name | Dataset Name | Format | Description |

| :--- | :--- | :--- | :--- |

| EXPFILE | AWS.M2.CARDDEMO.EXPORT.DATA | VSAM KSDS | The consolidated, multi-record export file containing all formatted customer, account, cross-reference, transaction, and card records. |

| SYSOUT | System Output | Sequential | Job execution logs, including execution statistics and record counts for reconciliation. |

| SYSPRINT | System Print | Sequential | Utility messages and diagnostic outputs from IDCAMS and the COBOL runtime. |

Detailed Data Transformations

To support the reimplementation of this job in a modern target system (such as a cloud-native batch process or an ETL pipeline), the following transformation rules and data mappings must be applied:

1. Global Header Generation

Every record written to the export file must begin with a standardized 40-byte metadata header. This header ensures traceability and provides the unique key required by the target VSAM KSDS.

  • Record Type Indicator (1 byte, Position 1):
  • 'C' : Customer Record
  • 'A' : Account Record
  • 'X' : Card Cross-Reference Record
  • 'T' : Transaction Record
  • 'D' : Card Record
  • Export Timestamp (26 bytes, Positions 2–27):
  • Generated once at job initialization.
  • Format: YYYY-MM-DD HH:MM:SS.00 (e.g., 2023-10-27 08:30:00.00 ).
  • Must be identical across all records in a single export run.
  • Sequence Number (4 bytes, Positions 28–31):
  • A 9-digit binary integer ( COMP in COBOL, equivalent to a 32-bit signed integer).
  • Starts at 1 and auto-increments by 1 for every record written to the export file.
  • Note : This field serves as the primary key for the target VSAM KSDS ( KEYS(4 28) ).
  • Branch ID (4 bytes, Positions 32–35):
  • Hardcoded to '0001' .
  • Represents the source branch identifier.
  • Region Code (5 bytes, Positions 36–40):
  • Hardcoded to 'NORTH' .
  • Represents the source regional identifier.
2. Record Payload Mapping (Positions 41–500)

The remaining 460 bytes of each record contain the entity-specific data. Computational numeric formats must be converted to appropriate target data types (e.g., Decimal or Numeric in SQL).

A. Customer Record (Type 'C' )

  • Customer ID : 9-digit numeric identifier.
  • Personal Details : First Name, Last Name, Date of Birth ( YYYY-MM-DD ), SSN, Government ID.
  • Contact Details : Address Line 1, Address Line 2, State, Country, Zip Code, Primary Phone, Secondary Phone.
  • Financial Indicators : EFT Account ID, Primary Cardholder Indicator, FICO Credit Score (3-digit numeric).

B. Account Record (Type 'A' )

  • Account ID : 11-digit numeric identifier.
  • Status : Active Status Indicator.
  • Financial Limits & Balances :
  • Current Balance: Signed packed decimal ( COMP-3 ).
  • Credit Limit: Signed numeric.
  • Cash Credit Limit: Signed packed decimal ( COMP-3 ).
  • Current Cycle Credit: Signed numeric.
  • Current Cycle Debit: Signed binary ( COMP ).
  • Dates : Open Date, Expiration Date, Reissue Date.
  • Demographics : Zip Code, Group ID.

C. Cross-Reference Record (Type 'X' )

  • Card Number : 16-character card identifier.
  • Customer ID : 9-digit numeric identifier.
  • Account ID : 11-digit numeric identifier.

D. Transaction Record (Type 'T' )

  • Transaction ID : 16-character unique transaction identifier.
  • Metadata : Type Code, Category Code, Source System, Description.
  • Financials : Transaction Amount (Signed packed decimal COMP-3 ).
  • Merchant Details : Merchant ID, Merchant Name, Merchant City, Merchant Zip.
  • Card Association : Card Number.
  • Timestamps : Original Transaction Timestamp, Processed Timestamp.

E. Card Record (Type 'D' )

  • Card Number : 16-character card identifier.
  • Account ID : 11-digit numeric identifier.
  • Security : CVV Code (3-digit numeric).
  • Embossing : Embossed Name on Card.
  • Status & Validity : Expiration Date, Active Status Indicator.
Operational and Validation Logic

To ensure data integrity during migration, a modern implementation must replicate the following operational constraints:

  • Sequential Processing : Source files must be processed completely and sequentially in the following order: Customers $\rightarrow$ Accounts $\rightarrow$ Cross-References $\rightarrow$ Transactions $\rightarrow$ Cards.
  • Strict Error Handling :
  • Every read and write operation must be validated.
  • Any unexpected file status (e.g., database connection failure, write error, or disk full) must trigger an immediate program termination (ABEND).
  • Partial or corrupted export files must not be preserved; the process must be transactional (all-or-nothing).
  • Reconciliation Reporting : Upon successful completion, the system must output a summary report to the execution logs detailing:
  • Count of Customer records exported.
  • Count of Account records exported.
  • Count of Cross-Reference records exported.
  • Count of Transaction records exported.
  • Count of Card records exported.
  • Grand total of all records written (which must match the final Sequence Number).

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Step 1: Initialization

"IDCAMS_STEP01" [label="IDCAMS STEP01"];

"IDCAMS_STEP01" -> "AWS.M2.CARDDEMO.EXPORT.DATA" [label="Initialize"];

// Step 2: Export Inputs

"AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS" -> "CBEXPORT_STEP02" [label="Read Customer Data"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" -> "CBEXPORT_STEP02" [label="Read Account Data"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" -> "CBEXPORT_STEP02" [label="Read Cross Reference"];

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" -> "CBEXPORT_STEP02" [label="Read Transactions"];

"AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS" -> "CBEXPORT_STEP02" [label="Read Card Data"];

// Step 2: Export Process and Output

"CBEXPORT_STEP02" [label="CBEXPORT STEP02"];

"CBEXPORT_STEP02" -> "AWS.M2.CARDDEMO.EXPORT.DATA" [label="Export Consolidated Data"];

}

This JCL job exports customer-related business data from multiple VSAM files into a single consolidated export dataset for migration or transfer purposes.

Initialization (STEP01) : Uses the IDCAMS utility to delete any pre-existing export dataset ( AWS.M2.CARDDEMO.EXPORT.DATA ) and defines a new VSAM cluster to ensure a clean state for the export process.

Data Export and Consolidation (STEP02) : Runs the CBEXPORT program to extract data from five core VSAM datasets:

  • Customer Profiles ( AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS )
  • Account Financial Statuses ( AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS )
  • Card Cross-Reference Mappings ( AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS )
  • Historical Transaction Records ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS )
  • Active Card Details ( AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS )

The utility standardizes timestamps, consolidates the records with metadata headers, and writes the unified output to the export dataset ( AWS.M2.CARDDEMO.EXPORT.DATA ).

<h2

CBIMPORT

Batch Data Import and Normalization Utility for Credit Card Branch Migration

MAT analysis

Job Function Summary: CardDemo Branch Migration Import

This job executes a batch data import and normalization process for the CardDemo credit card application. It acts as an ETL (Extract, Transform, Load) pipeline that ingests a single consolidated, multi-record export file containing migrated branch data. The job splits, normalizes, and distributes this data into separate, entity-specific target files (Customers, Accounts, Card Cross-References, and Transactions) while logging any malformed or unrecognized records to an error file. This ensures clean, structured data is prepared for downstream core database tables.

Input Files
  • EXPFILE ( AWS.M2.CARDDEMO.EXPORT.DATA )
  • Description : Consolidated sequential input file containing mixed record types (Customer, Account, Cross-Reference, Transaction, and Card data) from the migrated branch. It contains binary ( COMP ) and packed-decimal ( COMP-3 ) fields that require normalization.
Output Files
  • CUSTOUT ( AWS.M2.CARDDEMO.CUSTDATA.IMPORT )
  • Description : Normalized sequential output file containing Customer Profile records.
  • ACCTOUT ( AWS.M2.CARDDEMO.ACCTDATA.IMPORT )
  • Description : Normalized sequential output file containing Financial Account records.
  • XREFOUT ( AWS.M2.CARDDEMO.CARDXREF.IMPORT )
  • Description : Normalized sequential output file containing Card-to-Account Cross-Reference records.
  • TRNXOUT ( AWS.M2.CARDDEMO.TRANSACT.IMPORT )
  • Description : Normalized sequential output file containing Financial Transaction records.
  • ERROUT ( AWS.M2.CARDDEMO.IMPORT.ERRORS )
  • Description : Sequential error log file containing details of unrecognized or malformed records encountered during processing.

Note: While the underlying program ( CBIMPORT ) supports a physical card output ( CARD-OUTPUT ), the JCL for this step does not define a corresponding DD statement for card records, meaning physical card details (Type 'D') are not routed to a dedicated dataset in this execution configuration.

Detailed Data Transformations

To reimplement this job in a new system, the following data parsing, validation, and transformation rules must be applied to the input stream:

1. Record Identification and Routing

The input file must be read sequentially. For each record, the system must inspect the 1-byte record type indicator ( EXPORT-REC-TYPE ) at the beginning of the record to determine its entity type:

  • 'C' : Customer Record
  • 'A' : Account Record
  • 'X' : Card Cross-Reference Record
  • 'T' : Transaction Record
  • 'D' : Card Record
  • Any other value : Unknown/Error Record

2. Data Unpacking and Normalization Rules

All binary ( COMP ) and packed-decimal ( COMP-3 ) fields from the input structure must be converted into standard zoned-decimal or character display formats in the output files.

Customer Records (Type 'C')

  • Customer ID : Convert from 4-byte binary ( COMP ) to standard display format.
  • FICO Credit Score : Convert from 2-byte packed decimal ( COMP-3 ) to standard display format.
  • Address Array : Map the 3-occurrence address array from the input structure into flat, individual address fields in the output record.
  • Phone Number Array : Map the 2-occurrence phone number array from the input structure into flat, individual phone fields in the output record.

Account Records (Type 'A')

  • Current Balance : Convert from 7-byte packed decimal ( COMP-3 ) to standard display format.
  • Cash Credit Limit : Convert from 7-byte packed decimal ( COMP-3 ) to standard display format.
  • Current Cycle Debit : Convert from 4-byte binary ( COMP ) to standard display format.

Card Cross-Reference Records (Type 'X')

  • Account ID : Convert from 8-byte binary ( COMP ) to standard display format.

Transaction Records (Type 'T')

  • Transaction Amount : Convert from 6-byte packed decimal ( COMP-3 ) to standard display format.
  • Merchant ID : Convert from 4-byte binary ( COMP ) to standard display format.

Card Records (Type 'D')

  • Account ID : Convert from 8-byte binary ( COMP ) to standard display format.
  • CVV Code : Convert from 2-byte binary ( COMP ) to standard display format.

3. Error Handling and Logging

  • Unrecognized Records : If a record does not match any of the valid record type identifiers ('C', 'A', 'X', 'T', 'D'), the system must:
  • Increment the unknown record counter.
  • Format an error record containing:
  • Current system timestamp (Format: YYYY-MM-DD-HH.MM.SS.ffffff ).
  • The invalid record type character.
  • The record's sequence number.
  • The literal message: "Unknown record type encountered" .
  • Write this record to the ERROUT file and continue processing.

4. Operational Integrity and Validation

  • File Status Verification : The system must validate the status of every file operation (Open, Read, Write). If any file operation fails (returns a non-zero status, excluding End-of-File '10' on reads), the system must write a diagnostic message to the console and trigger an abnormal termination (ABEND) using the IBM Language Environment service CEE3ABD . This prevents downstream JCL steps from executing with incomplete data.
  • Execution Summary : Upon reaching the end of the input file, the system must output a summary report to the console ( SYSOUT ) containing:
  • Total records read.
  • Total records successfully imported per entity type.
  • Total error records written.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Dataset

"AWS.M2.CARDDEMO.EXPORT.DATA" [label="AWS.M2.CARDDEMO.EXPORT.DATA"];

// Processing Step

"CBIMPORT_STEP01" [label="CBIMPORT STEP01"];

// Output Datasets

"AWS.M2.CARDDEMO.CUSTDATA.IMPORT" [label="AWS.M2.CARDDEMO.CUSTDATA.IMPORT"];

"AWS.M2.CARDDEMO.ACCTDATA.IMPORT" [label="AWS.M2.CARDDEMO.ACCTDATA.IMPORT"];

"AWS.M2.CARDDEMO.CARDXREF.IMPORT" [label="AWS.M2.CARDDEMO.CARDXREF.IMPORT"];

"AWS.M2.CARDDEMO.TRANSACT.IMPORT" [label="AWS.M2.CARDDEMO.TRANSACT.IMPORT"];

"AWS.M2.CARDDEMO.IMPORT.ERRORS" [label="AWS.M2.CARDDEMO.IMPORT.ERRORS"];

// Data Flow Edges

"AWS.M2.CARDDEMO.EXPORT.DATA" -> "CBIMPORT_STEP01" [label="Process Export Stream"];

"CBIMPORT_STEP01" -> "AWS.M2.CARDDEMO.CUSTDATA.IMPORT" [label="Customer Records"];

"CBIMPORT_STEP01" -> "AWS.M2.CARDDEMO.ACCTDATA.IMPORT" [label="Account Records"];

"CBIMPORT_STEP01" -> "AWS.M2.CARDDEMO.CARDXREF.IMPORT" [label="Cross Reference Records"];

"CBIMPORT_STEP01" -> "AWS.M2.CARDDEMO.TRANSACT.IMPORT" [label="Transaction Records"];

"CBIMPORT_STEP01" -> "AWS.M2.CARDDEMO.IMPORT.ERRORS" [label="Error Records"];

}

This JCL job executes a data import and normalization process that ingests a consolidated migration file and splits it into entity-specific target datasets.

  • Data Import and Splitting (STEP01) : The program CBIMPORT reads the consolidated export file ( AWS.M2.CARDDEMO.EXPORT.DATA ) containing mixed record types. It identifies, validates, and normalizes the records (converting binary and packed decimal fields into standard display formats) and routes them to their respective target datasets:
  • AWS.M2.CARDDEMO.CUSTDATA.IMPORT for Customer Profiles
  • AWS.M2.CARDDEMO.ACCTDATA.IMPORT for Financial Accounts
  • AWS.M2.CARDDEMO.CARDXREF.IMPORT for Card-to-Account Cross-References
  • AWS.M2.CARDDEMO.TRANSACT.IMPORT for Financial Transactions
  • AWS.M2.CARDDEMO.IMPORT.ERRORS for any malformed or unrecognized records encountered during processing

<h2

CBPAUP0J

This document provides a high-level functional and technical summary of the mainframe JCL job designed to purge expired authorization records from the system.

MAT analysis

Job Summary: Expired Authorizations Deletion

This document provides a high-level functional and technical summary of the mainframe JCL job designed to purge expired authorization records from the system.

Business-Level Description

The primary business purpose of this job is to maintain database integrity, optimize storage, and ensure compliance by identifying and deleting expired authorization records.

The job executes an Information Management System (IMS) Batch Message Processing (BMP) program. This program scans the authorization database, evaluates the validity of authorization records against predefined expiration criteria, and permanently removes records that are no longer active or valid. This automated cleanup process prevents database bloat, improves transaction processing performance for active authorizations, and ensures that outdated sensitive data is not retained indefinitely.

Input Files and Resources

The job utilizes the following input resources for its execution:

  • SYSIN (In-stream Control Card):
  • Dataset/Source: In-stream data ( DD * ).
  • Content: 00,00001,00001,Y
  • Purpose: Provides runtime parameters to the application program. These parameters typically control processing limits, commit frequencies, execution modes (e.g., test vs. production), or specific date overrides.
  • IMS System and Application Libraries:
  • IMS.SDFSRESL : Contains the IMS execution modules (including the region controller DFSRRC00 ).
  • XXXXXXXX.PROD.LOADLIB : The production load library containing the compiled application program CBPAUP0C .
  • IMS.PSBLIB : Contains the Program Specification Block ( PSBPAUTB ) defining the program's logical access to IMS databases.
  • IMS.DBDLIB : Contains Database Descriptions (DBDs) defining the physical structure of the databases.
  • IMS Authorization Database (Logical Input):
  • Accessed dynamically via the IMS control region using the PSB PSBPAUTB . This database contains the authorization segments to be evaluated for expiration.
Output Files and Resources

The job produces the following outputs:

  • IMS Authorization Database (Logical Output):
  • The database is updated in-place. Expired authorization segments are physically or logically deleted based on the program's execution logic.
  • System and Diagnostic Logs:
  • SYSOUT / SYSPRINT : Captures standard system messages, execution statistics, and program-generated reports (e.g., count of records processed and deleted).
  • SYSOUX / SYSABOUT / ABENDAID / SYSUDUMP / IMSERR : Diagnostic and dump datasets used for troubleshooting in the event of an abnormal termination (abend).
Detailed Data Transformations and Logic

To successfully reimplement this job in a modern target system, the following functional logic and processing steps must be replicated:

1. Environment Initialization
  • The job runs in an online/batch hybrid environment (IMS BMP). The target system must establish a connection to the database transaction manager with appropriate database access authorities.
  • The program loads runtime parameters from the equivalent of the SYSIN control card.
2. Parameter Parsing
  • The control card 00,00001,00001,Y must be parsed.
  • Reimplementation Note: These parameters typically represent operational controls, such as:
  • Max delete count or throttle limits to prevent database locking.
  • Commit frequency intervals (e.g., issue a commit after every $N$ deletions).
  • A flag (e.g., 'Y') to confirm execution in update mode rather than dry-run mode.
3. Database Traversal and Expiration Evaluation
  • The program establishes a position in the Authorization database using the structure defined in PSB PSBPAUTB .
  • It sequentially reads authorization records.
  • For each record, it performs the following evaluation:

$$\text{Current Date} > \text{Authorization Expiration Date}$$

  • If the expiration date is less than the current processing date (or a date calculated based on retention rules), the record is flagged for deletion.
4. Record Deletion and Transaction Management
  • Deletion: The program issues a delete command (equivalent to the IMS DLET call) for the expired segment.
  • Transactional Integrity (Checkpointing): To prevent long-term database locks and resource exhaustion, the program must implement checkpointing.
  • Based on the input parameters, after a specified number of reads or deletes, the program issues a database commit (equivalent to an IMS CHKP call).
  • In a modern database migration (e.g., relational database), this translates to managing transaction boundaries and committing batches (e.g., every 1,000 rows) to optimize performance and prevent log space exhaustion.
5. Execution Reporting
  • The program tracks execution metrics, including:
  • Total records scanned.
  • Total records identified as expired.
  • Total records successfully deleted.
  • Number of checkpoints taken.
  • These metrics are written to the standard output log ( SYSPRINT equivalent) upon successful completion.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input

"SYSIN" [label="SYSIN Control Card"];

"Authorization Database" [label="Authorization Database"];

// Process

"DFSRRC00_STEP01" [label="DFSRRC00 STEP01"];

// Output

"Cleaned Database" [label="Cleaned Authorization Database"];

// Flow

"SYSIN" -> "DFSRRC00_STEP01" [label="Control Parameters"];

"Authorization Database" -> "DFSRRC00_STEP01" [label="Read Records"];

"DFSRRC00_STEP01" -> "Cleaned Database" [label="Delete Expired Records"];

}

This process executes an IMS batch program to maintain the integrity of authorization data by removing expired records.

Execution Step (STEP01) : The IMS region controller ( DFSRRC00 ) runs the batch program CBPAUP0C (using PSB PSBPAUTB ). It processes control parameters provided via the SYSIN DD statement.

Data Flow : The program reads active authorization records from the database, identifies those that have passed their expiration date, and deletes them. This ensures only valid and active authorizations are retained in the system.

<h2

CLOSEFIL

This JCL job is an administrative utility designed to transition specific VSAM files from an online state to an offline state within an active CICS (Customer Information Control System) region named CICSAWSA .

MAT analysis

JCL Job Analysis: CICS File Closure (CLCIFIL)

Business-Level Description

This JCL job is an administrative utility designed to transition specific VSAM files from an online state to an offline state within an active CICS (Customer Information Control System) region named CICSAWSA .

In mainframe environments, files accessed by online transactions are locked to prevent data corruption. Before batch processing jobs (such as nightly updates, backups, or reorganizations) can run, these files must be closed and deallocated from the CICS region. This job automates that process by issuing Master Terminal commands ( CEMT ) to close five specific files, ensuring they are safely released for batch processing.

Input Files

This job does not read physical business data files. It utilizes system-level control inputs:

  • ISFIN DD * : In-stream control input containing the MVS modify commands and CICS transaction commands to be executed by the SDSF utility.
Output Files

This job does not write to physical business data files. It generates system spool outputs for logging and auditing:

  • ISFOUT DD : System spool output dataset that captures the SDSF session log and execution details.
  • CMDOUT DD : System spool output dataset that captures the responses and status messages of the executed commands.
Detailed Description of Operations and State Transformations

The job executes a single step ( CLCIFIL ) using the IBM utility program SDSF (System Display and Search Facility) in batch mode to issue system commands.

Command Execution Details:

The utility issues MVS Modify commands ( /F ) targeting the CICS region CICSAWSA . Each command invokes the CICS Master Terminal transaction ( CEMT ) to change the status of a specific file resource to CLOSED ( CLO ).

The following state transformations are performed:

Transaction File Closure

  • Command : /F CICSAWSA,'CEMT SET FIL(TRANSACT ) CLO'
  • Target : TRANSACT (typically stores transaction history or current transactions).
  • Transformation : Status changes from OPEN to CLOSED in CICS.

Credit Card Cross-Reference File Closure

  • Command : /F CICSAWSA,'CEMT SET FIL(CCXREF ) CLO'
  • Target : CCXREF (typically stores credit card cross-reference data).
  • Transformation : Status changes from OPEN to CLOSED in CICS.

Account Data File Closure

  • Command : /F CICSAWSA,'CEMT SET FIL(ACCTDAT ) CLO'
  • Target : ACCTDAT (typically stores customer account master data).
  • Transformation : Status changes from OPEN to CLOSED in CICS.

Cross-Reference Alternate Index File Closure

  • Command : /F CICSAWSA,'CEMT SET FIL(CXACAIX ) CLO'
  • Target : CXACAIX (typically an Alternate Index path for account/card cross-referencing).
  • Transformation : Status changes from OPEN to CLOSED in CICS.

User Security File Closure

  • Command : /F CICSAWSA,'CEMT SET FIL(USRSEC ) CLO'
  • Target : USRSEC (typically stores user security and credentials).
  • Transformation : Status changes from OPEN to CLOSED in CICS.
Reimplementation Guidance for Modern Systems

When migrating this functionality to a modern cloud or distributed architecture:

  • Locking Mechanisms : Modern relational databases (e.g., PostgreSQL, Aurora) or NoSQL databases do not require files to be "closed" for batch processing, as they handle concurrent online transactions and batch updates using row-level locking and MVCC (Multi-Version Concurrency Control). This step may be entirely obsolete.
  • Batch Window Coordination : If the target architecture uses flat files or requires exclusive access to resources during batch runs, this step should be replaced with an API call, a microservice state change, or a database flag update that temporarily disables write access for online users while the batch process executes.

<h2

COMBTRAN

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to consolidate, sort, and load transaction data into the CardDemo application's master transaction database.

MAT analysis

JCL Job Functionality Summary: Transaction Consolidation and Master Load

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to consolidate, sort, and load transaction data into the CardDemo application's master transaction database.

1. Business-Level Description

The primary business purpose of this job is to update the master transaction database with the latest transaction records. It consolidates two distinct sources of transaction data:

  • Historical/Backup Transactions: Existing transaction records stored in a backup file.
  • System-Generated Transactions: New transactions generated by the system during recent processing cycles.

To ensure data integrity and optimal performance for downstream online and batch processing, the job merges these two sources, sorts them in ascending order by their unique Transaction Identifier ( TRAN-ID ), and loads the consolidated dataset into the primary Transaction Master VSAM Key-Sequenced Data Set (KSDS).

2. Input Files

The job processes the following input files:

AWS.M2.CARDDEMO.TRANSACT.BKUP

  • Format: Sequential File (PS)
  • Description: Contains backup or historical transaction records.
  • Role: Input to the sorting and merging step ( STEP05R ).

AWS.M2.CARDDEMO.SYSTRAN

  • Format: Sequential File (PS)
  • Description: Contains newly generated system transaction records.
  • Role: Input to the sorting and merging step ( STEP05R ).

AWS.M2.CARDDEMO.TRANSACT.COMBINED

  • Format: Sequential File (PS)
  • Description: The sorted, consolidated transaction file produced by STEP05R .
  • Role: Input to the VSAM load step ( STEP10 ).
3. Output Files

The job produces the following output files:

AWS.M2.CARDDEMO.TRANSACT.COMBINED

  • Format: Sequential File (PS)
  • Disposition: Created as a new cataloged dataset ( NEW, CATLG, DELETE ).
  • Description: Intermediate file containing the merged and sorted transaction records.
  • Role: Output from STEP05R .

AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS

  • Format: VSAM Key-Sequenced Data Set (KSDS)
  • Disposition: Shared/Existing ( SHR ).
  • Description: The master transaction database table.
  • Role: Final output target for STEP10 .
4. Detailed Data Transformations and Execution Steps

This job consists of two sequential steps. Below is the technical detail required to replicate this logic in a modern target architecture (e.g., SQL, Python, or Spark).

Step 1: STEP05R - Merge and Sort Transactions
  • Program: SORT (DFSORT / SYNCSORT utility)
  • Functional Description: This step performs a union of two sequential datasets and sorts the resulting dataset.
  • Key Definition:
  • A symbolic name TRAN-ID is defined starting at byte position 1 with a length of 16 bytes, formatted as Character ( CH ).
  • Transformation Logic:
  • Concatenate: Read all records from AWS.M2.CARDDEMO.TRANSACT.BKUP and AWS.M2.CARDDEMO.SYSTRAN .
  • Sort: Sort the combined records in Ascending (A) order using the TRAN-ID field (bytes 1–16) as the primary sort key.
  • Write: Write the sorted, merged records to the sequential file AWS.M2.CARDDEMO.TRANSACT.COMBINED .
Step 2: STEP10 - Load Master Transaction Database
  • Program: IDCAMS (Access Method Services)
  • Functional Description: This step loads the sorted sequential transaction data into the master VSAM database.
  • Transformation Logic:
  • Execute REPRO: The REPRO command copies records from the sequential input file ( TRANSACT DD pointing to AWS.M2.CARDDEMO.TRANSACT.COMBINED ) to the target VSAM KSDS ( TRANVSAM DD pointing to AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ).
  • Database Behavior: Because the target is a VSAM KSDS, the records must be loaded in ascending order of the primary key (which matches the TRAN-ID sorted in STEP05R ) to prevent out-of-sequence errors during insertion.
5. Implementation Guidelines for Modernization

To implement this job in a modern cloud or distributed environment, the following logic should be applied:

  • Data Ingestion / Union:
  • Perform an outer union (or UNION ALL equivalent) of the historical transaction data store and the newly generated system transaction data store.
  • Sorting:
  • Sort the consolidated dataset by the Transaction_ID column (equivalent to the first 16 characters of the record) in ascending order.
  • Database Load:
  • Perform a bulk load or upsert operation of the sorted dataset into the target relational database table or NoSQL document store (which replaces the VSAM KSDS). Ensure that the target table's primary key is mapped to the Transaction_ID .

<h2

CREADB2

This document provides a high-level functional summary of the mainframe JCL job designed to initialize, configure, and populate the DB2 database environment for the CardDemo (Credit Card Demonstration) application.

MAT analysis

JCL Job Functionality Summary: CardDemo Database Initialization and Setup

This document provides a high-level functional summary of the mainframe JCL job designed to initialize, configure, and populate the DB2 database environment for the CardDemo (Credit Card Demonstration) application.

1. Business-Level Description

The primary business purpose of this JCL job is to prepare the database environment for the CardDemo application. It automates the database lifecycle management by performing the following sequence of business operations:

  • Environment Cleanup: Frees and removes any pre-existing DB2 application plans and packages to prevent conflicts during deployment.
  • Database Creation: Creates the core database structure (tables, tablespaces, and schemas) required by the CardDemo application using a pre-defined storage group ( AWST1STG ).
  • Reference Data Loading: Populates the newly created database with essential reference data, specifically:
  • Transaction Types: Standard classifications of transactions (e.g., Purchases, Cash Advances).
  • Transaction Type Categories: Sub-classifications or categories associated with transaction types.

This job is typically executed during initial application deployment, environment provisioning, or database reset cycles.

2. Input Files

The job relies on control cards and SQL scripts stored in a centralized partitioned dataset (PDS) to drive its execution:

  • AWS.M2.CARDDEMO.CNTL(DB2FREE) (Input to Step FREEPLN ): Contains the TSO commands and DB2 subcommands required to free existing plans and packages.
  • AWS.M2.CARDDEMO.CNTL(DB2TIAD1) (Input to Step CRCRDDB ): Contains TSO commands to invoke the DB2 utility DSNTIAD .
  • AWS.M2.CARDDEMO.CNTL(DB2CREAT) (Input to Step CRCRDDB ): Contains the Data Definition Language (DDL) SQL statements used to create the database, tablespaces, tables, and indexes.
  • AWS.M2.CARDDEMO.CNTL(DB2TEP41) (Input to Steps RUNTEP2 and LDTCCAT ): Contains TSO commands to invoke the DSNTEP4 SQL execution utility.
  • AWS.M2.CARDDEMO.CNTL(DB2LTTYP) (Input to Step RUNTEP2 ): Contains the SQL INSERT or load statements to populate the Transaction Type table.
  • AWS.M2.CARDDEMO.CNTL(DB2LTCAT) (Input to Step LDTCCAT ): Contains the SQL INSERT or load statements to populate the Transaction Type Category table.
3. Output Files

While this job does not produce physical sequential output datasets, it generates the following system and database outputs:

  • Target DB2 Database: The primary output is the state change in the DB2 subsystem, resulting in a newly created database structure populated with reference data.
  • System Print and Spool Logs ( SYSTSPRT , SYSPRINT , SYSUDUMP ): Standard mainframe execution logs containing utility execution reports, SQL execution results, and diagnostic dump information in case of failures.
4. Detailed Technical Description and Data Transformations

The job executes in four distinct steps using the TSO Terminal Monitor Program ( IKJEFT01 ) to interface with DB2. Below is the technical breakdown of each step to facilitate reimplementation in a target cloud or modern environment.

Step 00: FREEPLN (Free Existing Plans and Packages)
  • Program: IKJEFT01
  • Execution Logic: Executes DB2 FREE PLAN and FREE PACKAGE commands defined in DB2FREE .
  • Reimplementation Note: This step will return a Return Code of 8 (RC=8) if the plans or packages do not already exist. In a target migration environment (e.g., relational database like PostgreSQL or SQL Server), this is equivalent to running a conditional drop script (e.g., DROP TABLE IF EXISTS or dropping schemas/stored procedures only if they exist) and ignoring "not found" warnings.
Step 10: CRCRDDB (Create CardDemo Database)
  • Program: IKJEFT01 (invoking the DSNTIAD DB2 utility)
  • Execution Logic: Executes the DDL statements contained in DB2CREAT . This script defines the physical and logical structure of the database, utilizing the storage group AWST1STG .
  • Reimplementation Note: In a modern target system, this step translates to executing a DDL SQL script containing CREATE DATABASE , CREATE SCHEMA , CREATE TABLE , and CREATE INDEX statements. Storage group configurations ( AWST1STG ) should be mapped to cloud-native storage classes or database tablespaces.
Step 20: RUNTEP2 (Load Transaction Type Table)
  • Program: IKJEFT01 (invoking the DSNTEP4 bulk SQL execution utility)
  • Execution Logic: Executes the SQL statements in DB2LTTYP to populate the Transaction Type reference table.
  • Reimplementation Note: This is a standard data ingestion step. In a migrated environment, this can be achieved by running an SQL script containing bulk INSERT statements, executing a database copy command (e.g., COPY in PostgreSQL), or running an ETL pipeline to load static reference data into the Transaction Type table.
Step 30: LDTCCAT (Load Transaction Type Category Table)
  • Program: IKJEFT01 (invoking the DSNTEP4 bulk SQL execution utility)
  • Execution Logic: Executes the SQL statements in DB2LTCAT to populate the Transaction Type Category reference table. This step is conditional on the successful execution of previous steps ( COND=(0,NE) ).
  • Reimplementation Note: Similar to Step 20, this step inserts static reference data into the Transaction Type Category table. In a target system, this should be executed sequentially after the database creation step to ensure referential integrity constraints (if any exist between Transaction Types and Categories) are satisfied.

<h2

CREASTMT

This document provides a high-level functional summary of the mainframe JCL job designed to generate account statements for credit card customers. It details the business purpose, input/output files, and step-by-step data transformations required to replicate this functionality in a modernized environment.

MAT analysis

JCL Job Functional Summary: Cardholder Statement Generation

This document provides a high-level functional summary of the mainframe JCL job designed to generate account statements for credit card customers. It details the business purpose, input/output files, and step-by-step data transformations required to replicate this functionality in a modernized environment.

Business-Level Description

The primary business purpose of this batch job is to generate comprehensive, customer-facing account statements for credit card holders. The job executes a multi-step process that prepares transaction data, aggregates customer demographics and account balances, and produces statements in two distinct formats simultaneously:

  • Plain-Text Report ( .PS ) : Suitable for legacy printing, archiving, or back-office auditing.
  • HTML Document ( .HTML ) : Designed for digital distribution, email delivery, or integration into web-based customer portals.

To achieve this, the job first restructures and sorts transaction records so they can be efficiently matched to cardholders. It then executes a core COBOL application ( CBSTM03A ) that merges cardholder cross-reference data, customer profiles, account balances, and transaction histories into the final formatted outputs.

Input Files

The job processes the following input datasets:

AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS

  • Type : VSAM Key-Sequenced Data Set (KSDS)
  • Description : The master transaction file containing raw transaction records for all credit cards.

AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS

  • Type : VSAM KSDS
  • Description : The cardholder cross-reference file linking credit card numbers to specific customer IDs and account IDs.

AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS

  • Type : VSAM KSDS
  • Description : The customer master file containing demographic details (names, addresses) and credit risk metrics (FICO scores).

AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS

  • Type : VSAM KSDS
  • Description : The account master file containing financial summaries, including current account balances.
Output Files

The job produces the following output datasets:

AWS.M2.CARDDEMO.STATEMNT.PS

  • Type : Sequential Dataset (Physical Sequential)
  • Description : The traditional plain-text statement report containing formatted customer details, transaction ledgers, and financial summaries.

AWS.M2.CARDDEMO.STATEMNT.HTML

  • Type : Sequential Dataset (Physical Sequential)
  • Description : The digital HTML statement report containing the same financial data structured with HTML tags and inline CSS for web rendering.
Intermediate/Temporary Files
  • AWS.M2.CARDDEMO.TRXFL.SEQ
  • Type : Sequential Dataset
  • Description : Temporary sorted and restructured transaction file.
  • AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS
  • Type : VSAM KSDS
  • Description : Temporary indexed transaction file keyed by Card Number and Transaction ID, used for high-performance lookups in the reporting step.
Detailed Step-by-Step Data Transformations

To reimplement this job in a modern cloud or distributed system, the following processing steps and data transformations must be executed:

Step 1: File Cleanup and VSAM Definition ( DELDEF01 )
  • Action : Delete any existing instances of the temporary sequential and VSAM transaction files.
  • Transformation : Define a new VSAM KSDS ( AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS ) with a primary key length of 32 bytes starting at offset 0 ( KEYS(32 0) ) and a fixed record length of 350 bytes.
Step 2: Transaction Sorting and Restructuring ( STEP010 )
  • Action : Read the raw transaction master file, sort the records, and restructure the record layout to establish a composite primary key.
  • Sorting Logic : Sort records in ascending order using a composite key:
  • Primary Sort Key : Card Number (located at position 263, length 16).
  • Secondary Sort Key : Transaction ID (located at position 1, length 16).
  • Record Restructuring (OUTREC) : Realign the record fields to place the composite key at the beginning of the record:
  • Output Positions 1–16 : Card Number (copied from input positions 263–278).
  • Output Positions 17–278 : Original input positions 1–262 (this shifts the original Transaction ID to output positions 17–32).
  • Output Positions 279–328 : Original input positions 279–328.
  • Resulting Record : A 328-byte record where the first 32 bytes ( Card Number + Transaction ID ) serve as the unique key.
Step 3: Load Restructured Transactions into VSAM ( STEP020 )
  • Action : Copy the restructured sequential transaction file ( AWS.M2.CARDDEMO.TRXFL.SEQ ) into the newly defined VSAM KSDS ( AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS ) using IDCAMS REPRO .
Step 4: Delete Previous Reports ( STEP030 )
  • Action : Delete any output statement files ( .PS and .HTML ) remaining from previous runs to prevent duplicate or appended data.
Step 5: Statement Generation ( STEP040 - Program CBSTM03A )

This step executes the core business logic to aggregate data and generate the dual-format statements.

1. In-Memory Transaction Caching

  • Read all records from the restructured transaction VSAM file ( TRXFL.VSAM.KSDS ) sequentially.
  • Load and group transactions in memory using a two-dimensional array/table structured by Card Number.
  • Capacity Limits : Supports up to 51 unique card numbers, with a maximum of 10 transactions cached per card.

2. Sequential Processing Loop

  • Read the Cardholder Cross-Reference File ( CARDXREF.VSAM.KSDS ) sequentially from start to finish. For each cross-reference record:
  • Customer Lookup : Perform a random, key-based read on the Customer File ( CUSTDATA.VSAM.KSDS ) using the Customer ID ( XREF-CUST-ID ) to retrieve demographic details.
  • Account Lookup : Perform a random, key-based read on the Account File ( ACCTDATA.VSAM.KSDS ) using the Account ID ( XREF-ACCT-ID ) to retrieve the current balance.

3. Data Formatting and Assembly

  • Customer Name Formatting : Concatenate CUST-FIRST-NAME , CUST-MIDDLE-NAME , and CUST-LAST-NAME (delimited by spaces) into a single string.
  • Address Formatting : Concatenate address line 3, state code, country code, and zip code into a standardized city/state/zip line.
  • Financial Formatting : Map numeric values to edited masks:
  • Account Balance: Format signed numeric S9(10)V99 to 9(9).99- .
  • Transaction Amount: Format signed numeric S9(9)V99 to Z(9).99- .
  • Total Expenses: Accumulate transaction amounts for the card and format the sum to Z(9).99- .

4. Output Generation

For each validated cardholder, write the aggregated data to both output files:

  • Plain-Text Output ( STMTFILE ) : Write structured text blocks including headers, customer address blocks, FICO scores, account balances, individual transaction lines (ID, description, amount), and a footer containing total expenses.
  • HTML Output ( HTMLFILE ) : Construct dynamic HTML strings using predefined templates and inline CSS. Embed the formatted customer details, account balances, and transaction tables directly into HTML elements (e.g., <p> , <table> , <tr> , <td> ).

5. Error Handling and Validation

  • I/O Validation : Verify the return status of every file operation. Any unexpected status code (other than success or EOF) must trigger an immediate abnormal program termination (ABEND) via the IBM Language Environment service CEE3ABD .
  • Transaction Matching : Ensure the card number of cached transactions matches the active cross-reference card number before writing transaction lines to the statement.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Datasets

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS"];

"AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS"];

// Intermediate Datasets

"AWS.M2.CARDDEMO.TRXFL.SEQ" [label="AWS.M2.CARDDEMO.TRXFL.SEQ"];

"AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS"];

// Output Datasets

"AWS.M2.CARDDEMO.STATEMNT.PS" [label="AWS.M2.CARDDEMO.STATEMNT.PS"];

"AWS.M2.CARDDEMO.STATEMNT.HTML" [label="AWS.M2.CARDDEMO.STATEMNT.HTML"];

// Steps

"STEP010" [label="STEP010 SORT"];

"STEP020" [label="STEP020 IDCAMS"];

"STEP040" [label="STEP040 CBSTM03A"];

// Data Flow

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" -> "STEP010" [label="STEP010 SORT"];

"STEP010" -> "AWS.M2.CARDDEMO.TRXFL.SEQ" [label="STEP010 SORT"];

"AWS.M2.CARDDEMO.TRXFL.SEQ" -> "STEP020" [label="STEP020 IDCAMS"];

"STEP020" -> "AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS" [label="STEP020 IDCAMS"];

"AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS" -> "STEP040" [label="STEP040 CBSTM03A"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" -> "STEP040" [label="STEP040 CBSTM03A"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" -> "STEP040" [label="STEP040 CBSTM03A"];

"AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS" -> "STEP040" [label="STEP040 CBSTM03A"];

"STEP040" -> "AWS.M2.CARDDEMO.STATEMNT.PS" [label="STEP040 CBSTM03A"];

"STEP040" -> "AWS.M2.CARDDEMO.STATEMNT.HTML" [label="STEP040 CBSTM03A"];

}

This JCL job processes transaction data and generates synchronized customer statements in both plain-text and HTML formats.

  • Initialization (DELDEF01) : Resets the transaction cross-reference storage by deleting and redefining the VSAM KSDS cluster to ensure a clean state.
  • Sort and Reformat (STEP010) : Reads the transaction VSAM file ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ), sorts the records by card number and transaction ID, reformats the fields, and writes them to a sequential file ( AWS.M2.CARDDEMO.TRXFL.SEQ ).
  • Load VSAM (STEP020) : Copies the sorted sequential transaction data into the newly defined VSAM KSDS repository ( AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS ).
  • Cleanup (STEP030) : Deletes any existing statement files from previous runs to prevent data overlap.
  • Statement Generation (STEP040) : Processes the sorted transactions along with card cross-reference, account, and customer data to generate synchronized plain-text ( AWS.M2.CARDDEMO.STATEMNT.PS ) and HTML ( AWS.M2.CARDDEMO.STATEMNT.HTML ) statements.

<h2

CUSTFILE

This JCL job is a batch utility process designed to safely refresh and reload the Customer Master Data VSAM file used by the CardDemo application.

MAT analysis

JCL Job Functionality Summary: Customer Data VSAM Refresh

Business-Level Description

This JCL job is a batch utility process designed to safely refresh and reload the Customer Master Data VSAM file used by the CardDemo application.

To ensure data integrity and prevent file-locking conflicts, the job coordinates with the online CICS transaction processing region ( CICSAWSA ). It temporarily closes the customer file in CICS, deletes the existing VSAM Key Sequenced Data Set (KSDS), recreates the VSAM structure with predefined storage and indexing parameters, populates it with fresh data from a sequential (flat) source file, and finally restores online access by reopening the file in CICS.

Input Files
  • AWS.M2.CARDDEMO.CUSTDATA.PS : A physical sequential (flat) dataset containing the source customer records to be loaded.
  • In-stream Control Commands ( ISFIN / SYSIN ) :
  • CICS system commands to close and open the target file.
  • IDCAMS utility control statements to delete, define, and copy (REPRO) the dataset.
Output Files
  • AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS : The target VSAM Key Sequenced Data Set containing the newly loaded customer records.
  • SYSPRINT / ISFOUT / CMDOUT : System and utility execution logs containing execution status, record counts, and command responses.
Detailed Step-by-Step Execution and Data Transformations
Step 1: Close CICS File ( CLCIFIL )
  • Program : SDSF
  • Action : Issues a system command to the CICS region named CICSAWSA .
  • Command : /F CICSAWSA,'CEMT SET FIL(CUSTDAT ) CLO'
  • Purpose : Closes the CICS file resource CUSTDAT to release the lock on the underlying VSAM dataset, allowing batch modification.
Step 2: Delete Existing VSAM Dataset ( STEP05 )
  • Program : IDCAMS
  • Action : Deletes the existing VSAM cluster.
  • Target Dataset : AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS
  • Condition Handling : IF MAXCC LE 08 THEN SET MAXCC = 0 . If the dataset does not exist (Return Code 8), the job resets the condition code to 0 to prevent job failure and allow subsequent steps to run.
Step 3: Define New VSAM KSDS ( STEP10 )
  • Program : IDCAMS
  • Action : Allocates and defines a new VSAM Key Sequenced Data Set (KSDS).
  • Dataset Configuration :
  • Cluster Name : AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS
  • Data Component Name : AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS.DATA
  • Index Component Name : AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS.INDEX
  • Space Allocation : 1 Cylinder primary, 5 Cylinders secondary ( CYLINDERS(1 5) )
  • Volume : AWSHJ1
  • Key Structure : Key length of 9 bytes starting at offset 0 ( KEYS(9 0) )
  • Record Size : Fixed-length records of 500 bytes ( RECORDSIZE(500 500) )
  • Share Options : SHAREOPTIONS(2 3) (Allows one write and multiple read operations simultaneously)
  • Attributes : INDEXED (KSDS structure), ERASE (clears data on deletion)
Step 4: Copy Data to VSAM ( STEP15 )
  • Program : IDCAMS
  • Action : Executes the REPRO command to copy records from the sequential input file to the newly defined VSAM KSDS.
  • Input DD ( CUSTDATA ) : AWS.M2.CARDDEMO.CUSTDATA.PS
  • Output DD ( CUSTVSAM ) : AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS
  • Transformation Logic :
  • This is a direct record-for-record copy.
  • The system automatically indexes the records based on the first 9 bytes of each input record (as defined by the KEYS(9 0) parameter in Step 3).
  • Input records must conform to the 500-byte record length.
Step 5: Open CICS File ( OPCIFIL )
  • Program : SDSF
  • Action : Issues a system command to the CICS region named CICSAWSA .
  • Command : /F CICSAWSA,'CEMT SET FIL(CUSTDAT ) OPE'
  • Purpose : Reopens the CICS file resource CUSTDAT , making the newly loaded customer data available to online transactions.

<h2

DALYREJS

This JCL job step is an administrative setup task for a card processing application (CardDemo). Its primary business purpose is to define and initialize a Generation Data Group (GDG) named AWS.M2.CARDDEMO.DALYREJS .

MAT analysis

Job Analysis: GDG Definition for CardDemo Daily Rejections

Business-Level Description

This JCL job step is an administrative setup task for a card processing application (CardDemo). Its primary business purpose is to define and initialize a Generation Data Group (GDG) named AWS.M2.CARDDEMO.DALYREJS .

A GDG is a mainframe structure used to manage historical versions (generations) of a dataset automatically. In this context, the GDG is designated for "Daily Rejections" (as indicated by the suffix DALYREJS ). This step ensures that the system can store and track up to five consecutive days of transaction rejection data. When a sixth day of data is generated, the system automatically purges the oldest generation, maintaining a rolling 5-day history window for operational analysis and error resolution.

Input Files
  • None : This job step does not read any physical input files. It utilizes in-stream control statements ( SYSIN DD * ) to pass configuration parameters directly to the system utility.
Output Files
  • AWS.M2.CARDDEMO.DALYREJS (GDG Base) : The output of this job is not a standard data file, but rather the creation of a GDG base index structure within the mainframe system catalog. This structure will govern the creation and retention of future generation datasets (e.g., AWS.M2.CARDDEMO.DALYREJS.G0001V00 ).
Detailed Description of Technical Actions and Transformations
Utility Executed
  • PGM=IDCAMS : The job executes IBM's Access Method Services utility ( IDCAMS ), which is used to manage VSAM datasets, non-VSAM datasets, and catalog structures.
Control Statements and Parameters

The utility processes the following control card defined in the SYSIN DD statement:

DEFINE GENERATIONDATAGROUP -

(NAME(AWS.M2.CARDDEMO.DALYREJS) -

LIMIT(5) -

SCRATCH -

)

  • DEFINE GENERATIONDATAGROUP : Instructs IDCAMS to create a new GDG catalog entry.
  • NAME(AWS.M2.CARDDEMO.DALYREJS) : Specifies the physical catalog name of the GDG base.
  • LIMIT(5) : Specifies the maximum number of generation datasets (up to 5) that can be associated with this GDG base at any given time.
  • SCRATCH : Specifies the disposition of a generation dataset when it is rolled off (removed from the GDG index because the limit of 5 has been exceeded). The SCRATCH parameter ensures that the dataset is physically deleted from the storage volume and its VTOC (Volume Table of Contents) entry is removed, preventing orphaned files from consuming disk space.
Reimplementation Guidance for Target System

To replicate this functionality in a modernized cloud environment (such as AWS), you must implement a mechanism that mimics the rolling retention of 5 files/objects.

Option 1: Amazon S3 with Lifecycle Policies (Recommended)

If the daily rejection files are stored as objects in Amazon S3:

  • Storage : Store the files in an S3 bucket under the prefix AWS/M2/CARDDEMO/DALYREJS/ .
  • Versioning : Enable S3 Versioning on the bucket.
  • Lifecycle Policy : Configure an S3 Lifecycle Rule to automatically delete noncurrent versions or transition objects to expiration after 5 days, or use a custom Lambda function to maintain exactly the 5 most recent object keys under that prefix, deleting the oldest when a new one is uploaded.
Option 2: File System with Scripted Retention (EFS / EBS)

If using a traditional file system (e.g., Amazon EFS or EBS) on EC2 instances or containers:

  • Directory Structure : Create a directory named /aws/m2/carddemo/dalyrejs/ .
  • Retention Script : Implement a post-execution script (Bash, Python, or PowerShell) in your batch pipeline that runs after a new rejection file is written:
  • List all files in the directory matching the pattern dalyrejs_* .
  • Sort the files by creation/modification timestamp.
  • If the count of files exceeds 5, delete the oldest file(s) until only 5 remain (replicating the LIMIT(5) and SCRATCH behavior).

<h2

DBPAUTP0

This document provides a functional summary of the mainframe JCL job designed to unload an IMS (Information Management System) database.

MAT analysis

JCL Job Functional Summary: IMS Database Unload

This document provides a functional summary of the mainframe JCL job designed to unload an IMS (Information Management System) database.

1. Business-Level Description

The primary business purpose of this JCL job is to perform a secure, consistent unload (backup/extraction) of the IMS database DBPAUTP0 (associated with authorization data in the CardDemo application).

This process is a standard administrative and operational procedure used to:

  • Create point-in-time backups of critical application data.
  • Prepare database structures for reorganization to reclaim space and optimize performance.
  • Extract hierarchical database records into a sequential flat-file format, facilitating data migration, modernization, or integration with downstream systems.

The job operates in two sequential phases:

  • Housekeeping (STEPDEL): Deletes any pre-existing version of the target output sequential dataset to prevent allocation conflicts.
  • Database Unload (UNLOAD): Invokes the standard IMS High-Deorganization Unload utility to extract the database contents into a sequential file.
2. Input Files

The job reads from the following system, control, and database files:

| DD Name | Dataset Name | Description |

| :--- | :--- | :--- |

| STEPLIB / DFSRESLB | OEMA.IMS.IMSP.SDFSRESL

AWS.M2.CARDDEMO.LOADLIB | IMS system program libraries and application load libraries containing the execution modules. |

| IMS | OEM.IMS.IMSP.PSBLIB

OEM.IMS.IMSP.DBDLIB | IMS Program Specification Block (PSB) and Database Description (DBD) libraries defining the database schema. |

| DDPAUTP0 | OEM.IMS.IMSP.PAUTHDB | The primary physical database dataset containing the actual authorization data. |

| DDPAUTX0 | OEM.IMS.IMSP.PAUTHDBX | The index database dataset associated with the primary database. |

| DFSVSAMP | OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) | Buffer pool parameters defining virtual storage allocation for VSAM/OSAM database access. |

| DFSCTL | In-stream Control Card ( SBPARM ACTIV=COND ) | Control statement requesting conditional activation of Sequential Buffering to optimize read performance. |

| RECON1/2/3 | OEM.IMS.IMSP.RECON1

OEM.IMS.IMSP.RECON2

OEM.IMS.IMSP.RECON3 | Recovery Control datasets used by IMS to verify database status, authorization, and logging state. |

3. Output Files

The job produces the following output files:

| DD Name | Dataset Name | Disposition | Description |

| :--- | :--- | :--- | :--- |

| DFSURGU1 | AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0 | (NEW, CATLG, DELETE) | The primary output sequential file containing the unloaded hierarchical database records. |

| SYSPRINT | System Output (Spool) | SYSOUT=* | Execution logs, statistics, and error messages generated by the IMS utility. |

| SYSUDUMP | System Output (Spool) | SYSOUT=* | Diagnostic memory dump produced only in the event of an abnormal program termination (ABEND). |

4. Detailed Data Transformations and Reimplementation Logic

To successfully replicate or migrate this job's functionality to a modern cloud or distributed environment (e.g., AWS), the following data extraction and transformation logic must be implemented:

Step 1: Pre-execution Cleanup (Equivalent to STEPDEL)
  • Logic: Check for the existence of the target output file/table. If it exists, drop or delete it to ensure a clean write operation.
  • Target Environment Implementation: In a cloud environment (e.g., AWS S3 or a relational database), this equates to deleting an S3 object or dropping/truncating a staging table before initiating the data pipeline.
Step 2: Hierarchical to Sequential Extraction (Equivalent to UNLOAD)

The IMS utility DFSURGU0 reads physical VSAM/OSAM blocks and outputs them in a specific sequential format.

  • Source Structure: IMS is a hierarchical database. Data is stored in segments (parent-child relationships).
  • Extraction Mechanism: The utility traverses the database hierarchically (Top-Down, Left-to-Right):
  • Root Segment 1
  • Child Segment 1a
  • Child Segment 1b
  • Root Segment 2...
  • Output Record Format: The output sequential file ( DFSURGU1 ) contains records prefixed with system overhead bytes (segment code, hierarchy level, delete byte) followed by the segment's user data.
Reimplementation Guidelines for Modern Systems

To migrate this data to a modern relational (RDBMS) or NoSQL database:

  • Schema Parsing: Parse the DBD ( DBPAUTP0 ) to understand the segment names, lengths, keys, and parent-child relationships.
  • Data Mapping:
  • Relational Target (e.g., PostgreSQL, Amazon Aurora): Map each IMS segment type to a distinct relational table. Parent-child relationships must be enforced using Foreign Keys. The primary key of the parent segment must be propagated to the child table as a foreign key.
  • NoSQL/Document Target (e.g., MongoDB, Amazon DynamoDB): Map the hierarchical structure to nested JSON documents, where child segments are represented as nested arrays within the parent document.
  • ETL Pipeline:
  • Extract the raw data from the mainframe source.
  • Apply a transformation layer (using tools like AWS Glue, Apache Spark, or Python) to decode the mainframe EBCDIC data to ASCII/UTF-8.
  • Unpack packed-decimal (COMP-3) or binary (COMP) numeric fields into standard decimal/integer formats based on the COBOL copybooks associated with the database segments.
  • Load the structured, cleaned data into the target database.

<h2

DEFCUST

This JCL job performs environment preparation and initialization for customer data storage. It utilizes the IBM utility IDCAMS (Access Method Services) to clean up existing resources and define a new Key Sequenced Data Set (KSDS) VSAM cluster. This ensures that subsequent application programs have a clean, structured, and empty data store to write customer records.

MAT analysis

Job Functionality Summary

This JCL job performs environment preparation and initialization for customer data storage. It utilizes the IBM utility IDCAMS (Access Method Services) to clean up existing resources and define a new Key Sequenced Data Set (KSDS) VSAM cluster. This ensures that subsequent application programs have a clean, structured, and empty data store to write customer records.

Input Files

This job does not ingest any physical data files. It only uses in-stream control statements ( SYSIN DD * ) to pass commands to the IDCAMS utility.

Output Files

The job defines and initializes the following VSAM dataset structure:

  • VSAM KSDS Cluster: AWS.CUSTDATA.CLUSTER
  • Data Component: AWS.CUSTDATA.CLUSTER.DATA
  • Index Component: AWS.CUSTDATA.CLUSTER.INDEX
Detailed Technical Description and Reimplementation Specifications

The job consists of two steps that perform structural initialization. No data record transformations are executed. Below are the technical specifications for each step to assist in modern system reimplementation (e.g., mapping to a relational database table or a NoSQL document store).

Step 05: Cleanup / Deletion ( STEP05 )
  • Program: IDCAMS
  • Action: Deletes an existing VSAM cluster.
  • Target Dataset: AWS.CCDA.CUSTDATA.CLUSTER
  • Reimplementation Note: In a modern target environment (such as AWS), this is equivalent to executing a DROP TABLE IF EXISTS statement in a relational database, or deleting a target file/object in a cloud storage bucket (e.g., Amazon S3) before starting a batch run.
  • Note: There is a discrepancy in the dataset names between Step 05 ( AWS.CCDA.CUSTDATA.CLUSTER ) and Step 052 ( AWS.CUSTDATA.CLUSTER ). Ensure this naming alignment is verified during migration.
Step 052: VSAM Definition ( STEP052 )
  • Program: IDCAMS
  • Action: Defines a new Key Sequenced Data Set (KSDS) VSAM cluster.
  • Target Dataset: AWS.CUSTDATA.CLUSTER
  • Physical Specifications for Target Mapping:
  • Storage Type: INDEXED (indicates a Key Sequenced Data Set where records are accessed via a primary key).
  • Primary Key Definition: KEYS(10 0) . The primary key is 10 bytes long, starting at offset 0 (the very beginning of the record).
  • Record Format: RECORDSIZE(500 500) . Fixed-length records of exactly 500 bytes.
  • Space Allocation: CYLINDERS(1 5) . Allocates 1 cylinder initially, with auto-expansion increments of 5 cylinders.
  • Security/Erase Option: ERASE . Specifies that the storage space occupied by the cluster is to be overwritten with binary zeros when the cluster is deleted.
  • Share Options: SHAREOPTIONS(1 4) . Defines cross-region and cross-system sharing capabilities.
Reimplementation Mapping Guide

To replicate this structure in a modern cloud database (e.g., Amazon Aurora PostgreSQL or Amazon DynamoDB):

| VSAM Attribute | VSAM Value | Modern Database Equivalent (SQL) | Modern NoSQL Equivalent (DynamoDB) |

| :--- | :--- | :--- | :--- |

| Dataset Name | AWS.CUSTDATA.CLUSTER | Table Name: CUSTDATA | Table Name: CustData |

| Key Definition | KEYS(10 0) | PRIMARY KEY on a CHAR(10) or VARCHAR(10) column | Partition Key (String type) |

| Record Size | RECORDSIZE(500 500) | Total row size limit or a CHAR(490) column for the payload | Attribute payload size up to 500 bytes |

| Erase Option | ERASE | Secure drop/truncate or data shredding policy | KMS encryption with key deletion / secure table deletion |

<h2

DEFGDGB

This JCL job is an administrative utility script designed to initialize the data environment for the CardDemo application. Specifically, it defines four Generation Data Groups (GDGs) in the mainframe catalog.

MAT analysis

JCL Job Functional Summary: CardDemo GDG Initialization

Business-Level Description

This JCL job is an administrative utility script designed to initialize the data environment for the CardDemo application. Specifically, it defines four Generation Data Groups (GDGs) in the mainframe catalog.

GDGs are used in mainframe environments to manage historical versions of sequential datasets automatically. This job establishes the catalog structures required to store and roll over daily transaction data, transaction backups, transaction reports, and transaction category balance backups. By configuring these GDGs, the system ensures that up to five historical versions of each file type are retained automatically, supporting data recovery, auditability, and daily batch processing cycles.

Input Files

This job does not read any physical input datasets. It utilizes in-stream control statements passed directly to the utility program.

  • SYSIN (In-stream Control Data): Contains the Access Method Services (IDCAMS) commands specifying the names and attributes of the GDG bases to be defined.
Output Files (Created Resources)

The job creates the following GDG bases in the system catalog. No physical data records are written during this step; only the logical structures to hold future dataset generations are established.

  • AWS.M2.CARDDEMO.TRANSACT.BKUP
  • Description: GDG base for transaction backup files.
  • AWS.M2.CARDDEMO.TRANSACT.DALY
  • Description: GDG base for daily transaction files.
  • AWS.M2.CARDDEMO.TRANREPT
  • Description: GDG base for transaction report files.
  • AWS.M2.CARDDEMO.TCATBALF.BKUP
  • Description: GDG base for transaction category balance backup files.
Detailed Description of Data Transformations and Operations
1. Execution Utility

The job executes IDCAMS (Access Method Services), the standard IBM utility used for managing catalogs, VSAM datasets, and non-VSAM structures.

2. GDG Configuration Parameters

Each of the four GDG bases is defined with the following identical parameters:

  • LIMIT(5) : Specifies that the system will maintain a maximum of 5 generations (versions) of the dataset. When a 6th generation is created (e.g., G0006V00 ), the oldest generation ( G0001V00 ) is rolled off.
  • SCRATCH : Specifies the disposition of the rolled-off generation. When a dataset generation is removed from the GDG index because it exceeds the limit of 5, the physical dataset is deleted (scratched) from the storage volume, rather than just being uncataloged.
3. Error Handling and Idempotency
  • IF LASTCC=12 THEN SET MAXCC=0 : This conditional statement is executed after each DEFINE GENERATIONDATAGROUP command.
  • If a GDG base already exists in the catalog, IDCAMS returns a Condition Code (CC) of 12 (severe error).
  • This logic intercepts the return code of 12 and resets the step's maximum condition code ( MAXCC ) to 0.
  • This ensures the JCL job is idempotent (can be run repeatedly without failing or halting subsequent steps if the resources are already defined).
Reimplementation Guidance for Target System

When migrating this functionality to a modern cloud or distributed environment (such as AWS), the GDG behavior must be replicated. Below are the recommended strategies:

Option A: Object Storage (e.g., AWS S3)

If the target architecture uses object storage to store these files:

  • S3 Versioning: Enable versioning on the S3 bucket holding these files.
  • Lifecycle Policies: Implement an S3 Lifecycle Policy on the specific prefixes (folders) corresponding to the GDG names:
  • AWS.M2.CARDDEMO.TRANSACT.BKUP/
  • AWS.M2.CARDDEMO.TRANSACT.DALY/
  • AWS.M2.CARDDEMO.TRANREPT/
  • AWS.M2.CARDDEMO.TCATBALF.BKUP/
  • Configure the policy to retain only the 5 most recent noncurrent versions and permanently delete (scratch) older versions.
Option B: File System with Orchestration (e.g., Apache Airflow / AWS Step Functions)

If using a traditional file system (e.g., Amazon EFS) where files are named sequentially (e.g., transact_daly_v1.dat to transact_daly_v5.dat ):

  • Naming Convention: Implement a script or orchestration task that appends a timestamp or generation number to the file name upon creation.
  • Purge Script: Create a post-execution script that scans the directory, counts the files matching the pattern, and deletes the oldest files if the count exceeds 5.

<h2

DEFGDGD

This document provides a functional summary of the mainframe JCL job designed to initialize Generation Data Groups (GDGs) and establish the baseline backup generations for CardDemo transaction reference data.

MAT analysis

JCL Job Functional Summary: CardDemo Reference Data GDG Initialization and Backup

This document provides a functional summary of the mainframe JCL job designed to initialize Generation Data Groups (GDGs) and establish the baseline backup generations for CardDemo transaction reference data.

1. Business-Level Description

The primary business purpose of this job is to set up a version-controlled backup infrastructure for critical reference data within the CardDemo application. Specifically, it targets three categories of reference data:

  • Transaction Types: Definitions of transaction types used in card processing.
  • Transaction Categories: Classifications of transactions for reporting and processing.
  • Disclosure Groups: Groupings of regulatory or terms-of-service disclosures.

To support business continuity, auditing, and recovery, the job establishes Generation Data Groups (GDGs) that retain up to five historical versions of this data. Upon defining these structures, the job immediately populates the first backup generation (Generation 1) using the current active production reference files. This ensures that a historical baseline is established before any subsequent batch processing or updates occur.

2. Input Files

The job reads from three physical sequential (PS) datasets containing the current active reference data:

| DD Name | Dataset Name | Description |

| :--- | :--- | :--- |

| SYSUT1 (Step 20) | AWS.M2.CARDDEMO.TRANTYPE.PS | Active Transaction Type reference data. |

| SYSUT1 (Step 40) | AWS.M2.CARDDEMO.TRANCATG.PS | Active Transaction Category reference data. |

| SYSUT1 (Step 60) | AWS.M2.CARDDEMO.DISCGRP.PS | Active Disclosure Group reference data. |

3. Output Files

The job defines three GDG bases and creates the first generation ( G0001V00 ) for each:

| DD Name / Parameter | Dataset / GDG Name | Type | Description |

| :--- | :--- | :--- | :--- |

| NAME (Step 10) | AWS.M2.CARDDEMO.TRANTYPE.BKUP | GDG Base | Defines the backup group for Transaction Types (Limit: 5, Scratch). |

| SYSUT2 (Step 20) | AWS.M2.CARDDEMO.TRANTYPE.BKUP | GDG Generation (+1) | First backup generation of Transaction Type data. |

| NAME (Step 30) | AWS.M2.CARDDEMO.TRANCATG.PS.BKUP | GDG Base | Defines the backup group for Transaction Categories (Limit: 5, Scratch). |

| SYSUT2 (Step 40) | AWS.M2.CARDDEMO.TRANCATG.PS.BKUP | GDG Generation (+1) | First backup generation of Transaction Category data. |

| NAME (Step 50) | AWS.M2.CARDDEMO.DISCGRP.BKUP | GDG Base | Defines the backup group for Disclosure Groups (Limit: 5, Scratch). |

| SYSUT2 (Step 60) | AWS.M2.CARDDEMO.DISCGRP.BKUP | GDG Generation (+1) | First backup generation of Disclosure Group data. |

4. Detailed Process Flow and Data Transformations

The job executes in six sequential steps, alternating between defining the GDG structure ( IDCAMS ) and copying the data ( IEBGENER ).

Step-by-Step Execution Logic

Step 10: Define GDG for Transaction Type

  • Program: IDCAMS (Utility for managing catalog and dataset structures).
  • Action: Defines the GDG base AWS.M2.CARDDEMO.TRANTYPE.BKUP .
  • Parameters:
  • LIMIT(5) : Retains a maximum of 5 historical generations.
  • SCRATCH : Specifies that when a generation is rolled out (exceeds the limit of 5), its catalog entry is removed and the physical dataset is deleted.

Step 20: Create First Generation of Transaction Type Backup

  • Program: IEBGENER (Record copy utility).
  • Condition: COND=(0,NE) (Executes only if Step 10 completed successfully with a Return Code of 0).
  • Transformation: Performs a direct, byte-for-byte copy of AWS.M2.CARDDEMO.TRANTYPE.PS to the newly defined GDG. Because this is the first write to the GDG, it is cataloged as generation G0001V00 (referenced in JCL as +1 during creation).

Step 30: Define GDG for Transaction Category

  • Program: IDCAMS
  • Condition: COND=(0,NE) (Executes only if previous steps completed successfully).
  • Action: Defines the GDG base AWS.M2.CARDDEMO.TRANCATG.PS.BKUP with LIMIT(5) and SCRATCH .

Step 40: Create First Generation of Transaction Category Backup

  • Program: IEBGENER
  • Condition: COND=(0,NE)
  • Transformation: Performs a direct copy of AWS.M2.CARDDEMO.TRANCATG.PS to the GDG base, creating generation G0001V00 .

Step 50: Define GDG for Disclosure Group

  • Program: IDCAMS
  • Action: Defines the GDG base AWS.M2.CARDDEMO.DISCGRP.BKUP with LIMIT(5) and SCRATCH . Note: This step does not have a COND parameter, meaning it will attempt to run even if previous steps failed, unless bypassed by a restart parameter.

Step 60: Create First Generation of Disclosure Group Backup

  • Program: IEBGENER
  • Condition: COND=(0,NE)
  • Transformation: Performs a direct copy of AWS.M2.CARDDEMO.DISCGRP.PS to the GDG base, creating generation G0001V00 .
5. Modernization and Reimplementation Guidance

When migrating this job to a modern cloud or distributed environment (e.g., AWS, Azure, or Google Cloud), the mainframe-specific GDG concept must be mapped to modern storage paradigms:

Storage Mapping (Object Storage vs. File System):

  • Option A (Object Storage - Recommended): Map the GDG bases to cloud object storage buckets/folders (e.g., AWS S3, Azure Blob Storage). Enable Object Versioning on the bucket with a lifecycle policy set to retain only the 5 most recent versions, automatically deleting older versions (replicating the LIMIT(5) and SCRATCH behavior).
  • Option B (File System): If using a standard file system, implement a naming convention that appends a timestamp or sequential counter to the file name (e.g., aws.m2.carddemo.trantype.bkup.v0001 ). A post-copy script must run to purge files older than the 5 most recent versions.

Process Replication:

  • The IEBGENER copy operations can be replaced with standard shell commands (e.g., cp in Linux, aws s3 cp in AWS CLI) or integrated into an ETL pipeline (e.g., Apache Airflow, AWS Glue).
  • No data transformation (reformatting, character conversion, or filtering) is performed on the records; it is a direct binary/text transfer. Ensure that if the source files are EBCDIC, they are either converted to ASCII during migration or handled appropriately by downstream applications.

<h2

DISCGRP

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the Disclosure Group VSAM file for the CardDemo application.

MAT analysis

JCL Job Functional Summary: Disclosure Group VSAM Initialization

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the Disclosure Group VSAM file for the CardDemo application.

Business-Level Description

The primary business purpose of this JCL job is to initialize or refresh the Disclosure Group reference data store. Disclosure groups typically contain regulatory, terms-and-conditions, or policy-related disclosure rules associated with credit card accounts.

To ensure data consistency and prevent processing errors from stale data, this job performs a clean reset of the data store. It deletes any existing Disclosure Group VSAM (Virtual Storage Access Method) file, defines a fresh, empty Key Sequenced Data Set (KSDS), and populates it with up-to-date reference data from a sequential flat file source. This ensures that downstream online transactions and batch processing systems have access to the correct and current disclosure configurations.

Input Files
  • AWS.M2.CARDDEMO.DISCGRP.PS
  • Format: Physical Sequential (PS) flat file.
  • Description: The master source file containing the current Disclosure Group records to be loaded into the system.
Output Files
  • AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS
  • Format: VSAM Key Sequenced Data Set (KSDS).
  • Description: The active target database/file used by the CardDemo application. It is indexed to allow fast, random access to disclosure records based on a unique key.
  • Data Component: AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS.DATA
  • Index Component: AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS.INDEX
Detailed Process and Data Transformations

The job executes three sequential steps using the IBM utility program IDCAMS (Access Method Services).

Step 05: Environment Cleanup (STEP05)
  • Program: IDCAMS
  • Action: Deletes the existing VSAM cluster AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS .
  • Transformation/Logic:
  • This is a destructive cleanup step to ensure no duplicate or orphaned records remain from previous runs.
  • The command SET MAXCC = 0 is executed immediately after the delete command. This ensures that if the file does not exist (e.g., during the very first run of the system), the job does not abend (abnormally end) and continues execution.
Step 10: VSAM Structure Definition (STEP10)
  • Program: IDCAMS
  • Action: Defines the structure of the new VSAM KSDS cluster.
  • Technical Specifications for Reimplementation:
  • File Type: Indexed (KSDS).
  • Record Size: Fixed-length records of 50 bytes ( RECORDSIZE(50 50) ).
  • Key Definition: The primary key is 16 bytes long, starting at byte offset 0 ( KEYS(16 0) ).
  • Space Allocation: 1 primary cylinder, 5 secondary cylinders ( CYLINDERS(1 5) ).
  • Volume: Allocated on volume AWSHJ1 .
  • Share Options: SHAREOPTIONS(2 3) (Allows multiple read-only users or one write user concurrently).
Step 15: Data Loading (STEP15)
  • Program: IDCAMS
  • Action: Reproduces ( REPRO ) data from the sequential input file to the newly defined VSAM KSDS.
  • Transformation/Logic:
  • Performs a direct 1-to-1 record copy from AWS.M2.CARDDEMO.DISCGRP.PS to AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS .
  • During this load, the VSAM access method automatically builds the index component based on the first 16 bytes of each 50-byte record. The input records must be sorted in ascending order by this 16-byte key to prevent out-of-sequence load errors.
Reimplementation Guidance for Target System

When migrating this functionality to a modern cloud or relational database environment:

  • Target Storage: Map the VSAM KSDS to a relational database table (e.g., PostgreSQL, MySQL, or Amazon Aurora) or a NoSQL key-value store (e.g., Amazon DynamoDB).
  • Table Schema:
  • Primary Key: A string column of length 16 (e.g., VARCHAR(16) or CHAR(16) ), representing the Disclosure Group Identifier.
  • Payload: A column or set of parsed columns representing the remaining 34 bytes of the record.
  • Data Migration Pipeline:
  • The cleanup and load steps ( DELETE -> DEFINE -> REPRO ) can be replicated using an ETL pipeline or a database migration script.
  • The equivalent SQL operation would be a TRUNCATE TABLE or DROP/CREATE TABLE followed by a bulk INSERT or COPY command from the flat file source.

<h2

DUSRSECJ

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the user security database for the CardDemo application.

MAT analysis

Job Summary: CardDemo User Security Initialization

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the user security database for the CardDemo application.

Business-Level Description

The primary purpose of this batch job is to set up and seed the user security database for the CardDemo application. It establishes the initial set of system users, distinguishing between administrators (e.g., ADMIN001 ) and standard users (e.g., USER0001 ), along with their respective names and security credentials.

The job performs environment cleanup, generates a sequential data file from hardcoded seed data, defines a secure indexed VSAM (Virtual Storage Access Method) Key Sequenced Data Set (KSDS), and loads the seed data into this indexed file. This indexed file serves as the single source of truth for user authentication and authorization within the CardDemo application.

Input Files

In-Stream Seed Data ( SYSUT1 in STEP01 )

  • Format: Fixed-length card image (80 bytes per record).
  • Description: Contains 10 initial user accounts (5 administrators and 5 standard users) with their User IDs, First Names, Last Names, and Passwords/Roles.

Intermediate Sequential File ( AWS.M2.CARDDEMO.USRSEC.PS )

  • Format: Physical Sequential (PS).
  • Description: Used as an input source in STEP03 to populate the final VSAM dataset.
Output Files

Intermediate Sequential File ( AWS.M2.CARDDEMO.USRSEC.PS )

  • Format: Physical Sequential (PS).
  • Description: Created in STEP01 to temporarily hold the in-stream user security records.

User Security VSAM KSDS ( AWS.M2.CARDDEMO.USRSEC.VSAM.KSDS )

  • Format: VSAM Key Sequenced Data Set (KSDS).
  • Key Specification: Length of 8 bytes, starting at offset 0 (User ID).
  • Record Length: Fixed 80 bytes.
  • Components:
  • Data Component: AWS.M2.CARDDEMO.USRSEC.VSAM.KSDS.DAT
  • Index Component: AWS.M2.CARDDEMO.USRSEC.VSAM.KSDS.IDX
  • Description: The final indexed database containing the active user security profiles.
Detailed Data Transformations and Reimplementation Logic

To migrate or reimplement this job in a modern cloud or distributed environment, the following step-by-step logic and data structures should be applied:

1. Step-by-Step Execution Flow
  • Pre-cleanup ( PREDEL ):
  • Delete any pre-existing instance of the sequential file AWS.M2.CARDDEMO.USRSEC.PS to prevent catalog conflicts.
  • Data Generation ( STEP01 ):
  • Write the 10 hardcoded user records from the in-stream data into the sequential file AWS.M2.CARDDEMO.USRSEC.PS .
  • Database Definition ( STEP02 ):
  • Delete any existing VSAM cluster named AWS.M2.CARDDEMO.USRSEC.VSAM.KSDS .
  • Define a new indexed storage structure with a primary key of 8 bytes at the beginning of the record (offset 0) and a fixed record length of 80 bytes.
  • Data Loading ( STEP03 ):
  • Copy (REPRO) all records from the sequential file into the newly defined indexed VSAM structure.
2. Record Layout Mapping (80 Bytes Fixed-Length)

The data payload is structured as follows:

| Field Name | Start Position (0-Based) | Length (Bytes) | Data Type | Sample Value | Description |

| :--- | :--- | :--- | :--- | :--- | :--- |

| USER_ID | 0 | 8 | Alphanumeric | ADMIN001 / USER0001 | Unique identifier (Primary Key) |

| FIRST_NAME | 8 | 20 | Alphanumeric | MARGARET | User's first name (space-padded) |

| LAST_NAME | 28 | 20 | Alphanumeric | GOLD | User's last name (space-padded) |

| PASSWORD | 48 | 9 | Alphanumeric | PASSWORDA / PASSWORDU | Encrypted/Plaintext password or role |

| FILLER | 57 | 23 | Alphanumeric | Spaces | Reserved for future use |

3. Target System Reimplementation Guidance (e.g., Relational Database)

If migrating this functionality to a modern relational database (RDBMS) such as PostgreSQL, MySQL, or Amazon Aurora, the process can be mapped as follows:

DDL (Table Creation)

CREATE TABLE USER_SECURITY (

USER_ID CHAR(8) NOT NULL,

FIRST_NAME CHAR(20) NOT NULL,

LAST_NAME CHAR(20) NOT NULL,

PASSWORD CHAR(9) NOT NULL,

FILLER CHAR(23) DEFAULT ' ',

CONSTRAINT PK_USER_SECURITY PRIMARY KEY (USER_ID)

);

DML (Data Seeding)

INSERT INTO USER_SECURITY (USER_ID, FIRST_NAME, LAST_NAME, PASSWORD) VALUES

('ADMIN001', 'MARGARET ', 'GOLD ', 'PASSWORDA'),

('ADMIN002', 'RUSSELL ', 'RUSSELL ', 'PASSWORDA'),

('ADMIN003', 'RAYMOND ', 'WHITMORE ', 'PASSWORDA'),

('ADMIN004', 'EMMANUEL ', 'CASGRAIN ', 'PASSWORDA'),

('ADMIN005', 'GRANVILLE ', 'LACHAPELLE ', 'PASSWORDA'),

('USER0001', 'LAWRENCE ', 'THOMAS ', 'PASSWORDU'),

('USER0002', 'AJITH ', 'KUMAR ', 'PASSWORDU'),

('USER0003', 'LAURITZ ', 'ALME ', 'PASSWORDU'),

('USER0004', 'AVERARDO ', 'MAZZI ', 'PASSWORDU'),

('USER0005', 'LEE ', 'TING ', 'PASSWORDU');

<h2

ESDSRRDS

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the User Security data store for the CardDemo application.

MAT analysis

JCL Job Functionality Summary: User Security File Initialization

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the User Security data store for the CardDemo application.

1. Business-Level Description

The primary business purpose of this JCL job is to provision and initialize the security access control data for the CardDemo application. It establishes a set of default administrative and standard user accounts with their corresponding names and passwords.

To support different access methodologies within the mainframe environment, the job loads this security data into two distinct VSAM (Virtual Storage Access Method) file formats:

  • Entry-Sequenced Data Set (ESDS): Used for sequential access or audit-trail style logging of security records.
  • Relative Record Data Set (RRDS): Used for rapid, direct access to user records based on a relative record number (RRN).

This job is typically executed during system installation, environment provisioning, or database reset procedures.

2. Input Files
  • In-stream Data (STEP01.SYSUT1): Hardcoded user security records containing initial credentials and user profiles.
  • AWS.M2.CARDDEMO.ESDSRRDS.PS (STEP03 & STEP05): Used as an intermediate sequential input file to populate the VSAM datasets.
3. Output Files
  • AWS.M2.CARDDEMO.ESDSRRDS.PS (PREDEL & STEP01): A temporary Physical Sequential (PS) dataset used to stage the in-stream data. It is deleted at the start of the job if it exists, and recreated in STEP01.
  • AWS.M2.CARDDEMO.USRSEC.VSAM.ESDS (STEP02 & STEP03): The target VSAM Entry-Sequenced Data Set containing the populated user security records.
  • AWS.M2.CARDDEMO.USRSEC.VSAM.RRDS (STEP04 & STEP05): The target VSAM Relative Record Data Set containing the populated user security records.
4. Detailed Data Transformations and Step-by-Step Execution
Step-by-Step Execution Flow

PREDEL (IEFBR14):

  • Action: Performs a pre-cleanup operation.
  • Logic: Deletes the sequential staging file AWS.M2.CARDDEMO.ESDSRRDS.PS if it already exists from a previous run to prevent duplicate dataset errors.

STEP01 (IEBGENER):

  • Action: Staging file creation.
  • Logic: Copies the 10 hardcoded in-stream user records into the sequential dataset AWS.M2.CARDDEMO.ESDSRRDS.PS .

STEP02 (IDCAMS):

  • Action: VSAM ESDS Definition.
  • Logic: Deletes any existing VSAM ESDS file named AWS.M2.CARDDEMO.USRSEC.VSAM.ESDS and defines a new ESDS cluster with a fixed record size of 80 bytes.

STEP03 (IDCAMS):

  • Action: ESDS Data Load.
  • Logic: Executes a REPRO command to copy all records from the sequential staging file ( AWS.M2.CARDDEMO.ESDSRRDS.PS ) into the newly defined VSAM ESDS.

STEP04 (IDCAMS):

  • Action: VSAM RRDS Definition.
  • Logic: Deletes any existing VSAM RRDS file named AWS.M2.CARDDEMO.USRSEC.VSAM.RRDS and defines a new RRDS cluster with a fixed record size of 80 bytes.

STEP05 (IDCAMS):

  • Action: RRDS Data Load.
  • Logic: Executes a REPRO command to copy all records from the sequential staging file into the newly defined VSAM RRDS, assigning relative record numbers sequentially starting from 1.
Data Record Structure & Layout

The input data consists of 10 records, each exactly 80 bytes in length. The record layout is structured as follows:

| Field Name | Character Position (Start - End) | Length (Bytes) | Data Type | Description / Sample Values |

| :--- | :--- | :--- | :--- | :--- |

| User ID | 1 - 8 | 8 | Alphanumeric | Unique identifier (e.g., ADMIN001 , USER0001 ) |

| First Name | 9 - 28 | 20 | Alphanumeric | User's first name, padded with spaces (e.g., MARGARET ) |

| Last Name | 29 - 48 | 20 | Alphanumeric | User's last name, padded with spaces (e.g., GOLD ) |

| Password | 49 - 57 | 9 | Alphanumeric | User's password (e.g., PASSWORDA , PASSWORDU ) |

| Filler / Reserved | 58 - 80 | 23 | Alphanumeric | Spaces to pad the record to the 80-byte fixed length |

Target System Reimplementation Guidance

To replicate this functionality in a modern cloud or distributed environment:

  • Database/Storage Mapping:
  • Map the 80-byte flat records to a relational database table (e.g., USER_SECURITY ) or a NoSQL document store.
  • The table schema should include columns for USER_ID (Primary Key), FIRST_NAME , LAST_NAME , and PASSWORD .
  • Data Ingestion:
  • Implement an initialization script (SQL INSERT statements, a Python migration script, or a JSON/CSV seed file) to load the 10 default user records into the target database.
  • Access Patterns:
  • Replace the ESDS sequential access pattern with standard SQL queries ordered by creation timestamp or sequential IDs.
  • Replace the RRDS relative record number access pattern with direct primary key lookups on USER_ID or an auto-incrementing integer ID.

<h2

FTPJCLS

This JCL job automates the outbound transfer of a mainframe data file to an external FTP server. In a business workflow, this process is typically used to distribute reports, transaction logs, or application data to external business partners, downstream distributed systems, or cloud-based storage repositories for further processing and archiving.

MAT analysis

JCL Job Functionality Summary: FTP File Transfer

Business-Level Description

This JCL job automates the outbound transfer of a mainframe data file to an external FTP server. In a business workflow, this process is typically used to distribute reports, transaction logs, or application data to external business partners, downstream distributed systems, or cloud-based storage repositories for further processing and archiving.

Input Files
  • Source Dataset (Mainframe): AWS.M2.CARDEMO.FTP.TEST
  • Description: The local sequential dataset on the mainframe containing the data payload to be exported.
  • Control Input (In-stream): SYSIN DD *
  • Description: In-stream control card containing the target FTP server IP address, authentication credentials (username and password), and the sequence of FTP commands required to execute the transfer.
Output Files
  • Target File (Remote Server): welcome.txt
  • Description: The destination file created on the remote FTP server ( 172.31.21.124 ) within the /ftpfolder directory.
  • Execution Log (Implicit): SYSPRINT / SYSSTOUT
  • Description: Standard system output containing the log of the FTP session, transfer statistics, and connection status codes (not explicitly defined in the JCL but generated by default by the FTP utility).
Detailed Process and Data Transformation Description
1. Execution Flow

The job executes a single step ( STEP1 ) utilizing the IBM standard FTP utility program ( PGM=FTP ) with a region size allocation of 2048K . The utility processes the commands provided in the SYSIN DD statement sequentially:

  • Establish Connection: Connects to the remote FTP server at IP address 172.31.21.124 .
  • Authentication: Logs in using the username carddemousr and password ftpdemo1 .
  • Set Transfer Mode: Sets the transmission mode to ASCII .
  • Diagnostics: Executes pwd (Print Working Directory) and dir (Directory Listing) to log the initial state of the remote server.
  • Directory Change: Navigates to the target directory using cd /ftpfolder .
  • File Upload: Executes the PUT command to transfer the local mainframe dataset 'AWS.M2.CARDEMO.FTP.TEST' to the remote file welcome.txt .
  • Termination: Closes the connection using the QUIT command.
2. Data Transformation (EBCDIC to ASCII)
  • Character Set Translation: Mainframe datasets natively store text data in EBCDIC (Extended Binary Coded Decimal Interchange Code) format. Because the ASCII command is issued prior to the transfer, the FTP utility automatically performs a character-by-character translation from EBCDIC to ASCII (typically ISO-8859-1 or UTF-8 depending on system configuration) during transmission. This ensures the resulting welcome.txt file is readable on standard open systems (Linux, Windows, Cloud environments).
  • Record Format Handling: During the ASCII transfer, the utility appends standard carriage return/line feed (CRLF) line terminators to the end of each mainframe record, converting the fixed-block or variable-block mainframe record structure into a standard stream-LF text file.
Reimplementation Guidance for Target System

To migrate this functionality to a modern cloud or distributed environment (e.g., AWS), the following approaches can be utilized:

  • AWS Transfer Family / SFTP: If security standards require SFTP instead of legacy FTP, replace this step with an SFTP client call (e.g., sftp or scp in Linux) utilizing SSH keys instead of hardcoded passwords.
  • Object Storage Upload (AWS S3): If the target destination is cloud storage, replace the FTP step with an AWS CLI command or an SDK-based script (e.g., Python with boto3 ):

aws s3 cp /path/to/local/file s3://my-bucket/ftpfolder/welcome.txt

  • Python Reimplementation (Legacy FTP): If legacy FTP compatibility must be maintained, use Python's built-in ftplib library:

from ftplib import FTP

ftp = FTP('172.31.21.124')

ftp.login(user='carddemousr', passwd='ftpdemo1')

ftp.cwd('/ftpfolder')

# Open local file and upload

with open('AWS.M2.CARDEMO.FTP.TEST', 'rb') as f:

ftp.storlines('STOR welcome.txt', f)

ftp.quit()

  • Encoding Note: In a modernized environment where the source data has already been migrated to ASCII/UTF-8, explicit EBCDIC-to-ASCII translation is no longer required. If the source data remains in EBCDIC, a translation step (using utilities like dd conv=ascii or Python encoding libraries) must be executed prior to transmission.

<h2

INTCALC

This document provides a high-level functional summary of the mainframe JCL job step STEP15 , which executes the batch program CBACT04C . This job is a core financial component of the CardDemo credit card processing system, responsible for calculating and posting monthly interest charges to customer accounts.

MAT analysis

JCL Job Functionality Summary: Credit Card Account Monthly Interest Calculation and Posting

This document provides a high-level functional summary of the mainframe JCL job step STEP15 , which executes the batch program CBACT04C . This job is a core financial component of the CardDemo credit card processing system, responsible for calculating and posting monthly interest charges to customer accounts.

Business-Level Description

The primary purpose of this job is to process outstanding credit card balances categorized by transaction types (such as purchases or cash advances), calculate the corresponding monthly interest (finance charges) for each account, and post these charges.

The job performs the following business functions:

  • Interest Rate Determination : Matches each account's group classification and transaction category against a disclosure group registry to find the correct interest rate, falling back to a standardized default rate if a specific rate structure is not defined.
  • Interest Calculation : Computes the monthly interest charge based on the outstanding balance of each transaction category.
  • Transaction Generation : Generates system-initiated transaction records for the calculated interest to be used for downstream ledger posting.
  • Account Balance Update : Updates the master account records by adding the accumulated interest to the current balance and resetting the cycle's credit and debit accumulators to prepare for the next billing cycle.
Input Files

| DD Name | Dataset Name | File Format / Type | Description |

| :--- | :--- | :--- | :--- |

| TCATBALF | AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS | VSAM KSDS | Transaction Category Balances : Contains outstanding balances categorized by account and transaction type. |

| XREFFILE | AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS | VSAM KSDS | Card Cross-Reference : Maps Account IDs to 16-digit Card Numbers. |

| XREFFIL1 | AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH | VSAM Path | Card Cross-Reference Alternate Index : Alternate path access for the cross-reference file. |

| DISCGRP | AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS | VSAM KSDS | Disclosure Group : Contains interest rate rules and percentages for different account groups and transaction categories. |

| PARM | Passed via JCL EXEC statement | Parameter (10 chars) | Execution Date : Value 2022071800 used as a prefix for generating unique transaction IDs. |

Output Files

| DD Name | Dataset Name | File Format / Type | Description |

| :--- | :--- | :--- | :--- |

| TRANSACT | AWS.M2.CARDDEMO.SYSTRAN | Sequential (New) | System Transactions : Stores the generated interest/finance charge transaction records. |

| ACCTFILE | AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS | VSAM KSDS (I-O) | Account Master File : Updated with the accumulated monthly interest and reset cycle accumulators. |

Detailed Data Transformations and Logic

To successfully reimplement this job in a modernized system, the following logical steps and data transformations must be executed:

1. Sequential Processing and Account Grouping
  • Read the Transaction Category Balance file ( TCATBALF ) sequentially.
  • Group the incoming records by Account ID ( TRANCAT-ACCT-ID ).
  • When a new Account ID is detected (or on the first record):
  • Retrieve the corresponding Account Master record from ACCTFILE using the Account ID.
  • Retrieve the Card Cross-Reference record from XREFFILE using the Account ID to obtain the associated 16-digit Card Number.
  • Reset the accumulated interest accumulator ( WS-TOTAL-INT ) to zero.
2. Interest Rate Lookup and Fallback Logic

For each transaction category balance record, determine the applicable interest rate:

  • Perform a lookup in the Disclosure Group file ( DISCGRP ) using a composite key:

$$\text{Key} = \text{Account Group ID (from Account Master)} + \text{Transaction Category Code} + \text{Transaction Type Code}$$

  • Fallback Mechanism : If no matching record is found (VSAM Status 23 / Key Not Found), perform a secondary lookup using a default group ID:

$$\text{Fallback Key} = \text{"DEFAULT"} + \text{Transaction Category Code} + \text{Transaction Type Code}$$

  • If the retrieved interest rate is zero, skip interest calculation for this category.
3. Interest Calculation

For each valid non-zero interest rate, calculate the monthly interest charge:

$$\text{Monthly Interest} = \frac{\text{Transaction Category Balance} \times \text{Interest Rate}}{1200}$$

  • Add the calculated monthly interest to the running total for the account:

$$\text{WS-TOTAL-INT} = \text{WS-TOTAL-INT} + \text{Monthly Interest}$$

4. Transaction Record Generation

For every calculated interest charge, write a new transaction record to TRANSACT with the following field mappings:

| Target Field | Source / Value | Format / Example |

| :--- | :--- | :--- |

| Transaction ID | Concatenation of PARM date and a sequential 6-digit suffix | 2022071800000001 |

| Transaction Type | Constant '01' (Interest/Finance Charge) | '01' |

| Transaction Category | Constant '05' | '05' |

| Source | Constant 'System' | 'System' |

| Description | 'Int. for a/c ' concatenated with Account ID | 'Int. for a/c 12345678901' |

| Amount | Calculated Monthly Interest | Numeric (e.g., 12.34 ) |

| Card Number | Card Number retrieved from XREFFILE | 16-digit numeric |

| Timestamp | Current system timestamp | YYYY-MM-DD-HH.MIN.SS.MIL0000 |

5. Account Master Update

When all transaction category balances for an account have been processed, update the Account Master record in ACCTFILE :

  • Current Balance Update :

$$\text{New Current Balance} = \text{Current Balance} + \text{WS-TOTAL-INT}$$

  • Cycle Reset :
  • Set Current Cycle Credit Accumulator to 0 .
  • Set Current Cycle Debit Accumulator to 0 .
  • Rewrite the updated record back to ACCTFILE .
6. Critical Logic Flaw (For Reimplementation Warning)
  • The Bug : In the legacy COBOL program, when the end of the TCATBALF file is reached, the processing loop terminates immediately. Consequently, the final account processed in the batch is never updated in ACCTFILE because the update logic is bypassed on EOF.
  • Modernization Recommendation : When rewriting this logic, ensure that the final account's accumulated interest is written to the database/file upon reaching the end of the input stream (e.g., in a flush or cleanup block) to correct this legacy defect.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Nodes

"AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH" [label="AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH"];

"AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS" [label="AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS"];

// Process Node

"CBACT04C_STEP15" [label="CBACT04C\n(STEP15)"];

// Output Nodes

"AWS.M2.CARDDEMO.SYSTRAN" [label="AWS.M2.CARDDEMO.SYSTRAN"];

// Flow Edges

"AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS" -> "CBACT04C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" -> "CBACT04C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH" -> "CBACT04C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS" -> "CBACT04C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" -> "CBACT04C_STEP15" [label="STEP15"];

"CBACT04C_STEP15" -> "AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="STEP15"];

"CBACT04C_STEP15" -> "AWS.M2.CARDDEMO.SYSTRAN" [label="STEP15"];

}

This JCL job executes a batch process to calculate monthly interest and finance charges for credit card accounts and post the resulting transactions.

  • Interest and Fee Calculation (STEP15) : The program CBACT04C processes outstanding balances by transaction category from the balance file ( AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS ).
  • It cross-references card numbers and accounts using AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS and its path AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH .
  • It fetches account details from AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS and matches them against the rate registry in AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS to determine the applicable interest rate.
  • The calculated interest is used to update the account balances in AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS and reset the billing cycle accumulators.
  • Finally, system-initiated transaction records for the interest charges are generated and written to the output file AWS.M2.CARDDEMO.SYSTRAN for downstream posting.

<h2

INTRDRJ1

This document provides a high-level functional summary of the provided mainframe JCL job, detailing its business purpose, input/output resources, and step-by-step execution logic for modernization and migration planning.

MAT analysis

JCL Job Functionality Summary

This document provides a high-level functional summary of the provided mainframe JCL job, detailing its business purpose, input/output resources, and step-by-step execution logic for modernization and migration planning.

Business-Level Description

The primary business purpose of this JCL job is to perform a data preservation backup and automate workflow orchestration.

  • Data Backup : It creates a secure duplicate of an FTP test data file to prevent data loss.
  • Job Orchestration : It automatically triggers and submits a secondary JCL job to the system's Job Entry Subsystem (JES) via the Internal Reader (INTRDR). This establishes a dependency chain where the second job runs only after the backup step completes successfully.
Input Files
  • AWS.M2.CARDEMO.FTP.TEST
  • Format : Sequential or VSAM Dataset
  • Description : The primary source data file containing FTP test data that needs to be backed up.
  • AWS.M2.CARDDEMO.JCL(INTRDRJ2)
  • Format : Partitioned Dataset (PDS) Member
  • Description : A text file containing the JCL statements for the next job in the sequence to be submitted for execution.
Output Files
  • AWS.M2.CARDEMO.FTP.TEST.BKUP
  • Format : Sequential or VSAM Dataset (matching the input format)
  • Description : The target backup dataset where the source FTP test data is replicated.
  • Internal Reader (INTRDR)
  • Format : System Spool / Job Queue
  • Description : The system destination (typically mapped to SYSUT2 as SYSOUT=(A,INTRDR) ) used to receive and execute the JCL stream passed from the PDS member.
Detailed Data Transformations and Process Flow
Step 1: IDCAMS (Data Replication)
  • Utility Program : IDCAMS (Access Method Services)
  • Execution Logic :
  • The utility executes the REPRO command.
  • It maps the input file allocated under the IN DD statement to the output file allocated under the OUT DD statement.
  • Transformation :
  • This is a direct, byte-for-byte copy operation.
  • No data manipulation, filtering, or structural transformation is performed on the records.
Step 2: STEP01 (Job Submission)
  • Utility Program : IEBGENER (Record Copy Utility)
  • Execution Logic :
  • The utility reads the JCL control cards from the input dataset member specified in SYSUT1 ( AWS.M2.CARDDEMO.JCL(INTRDRJ2) ).
  • It writes these control cards directly to the output destination specified in SYSUT2 (the system's Internal Reader).
  • Transformation :
  • This is a plain-text transfer of JCL statements.
  • Writing to the Internal Reader acts as a system trigger, submitting the retrieved JCL to the operating system's job scheduler for immediate execution.
Reimplementation Guidance for Target System

To replicate this functionality in a modern cloud or distributed environment (e.g., AWS):

  • File Copy (Step 1 Replacement) : Implement a file copy operation (e.g., AWS S3 copy, or a shell command like cp / aws s3 cp ) to duplicate the source file AWS.M2.CARDEMO.FTP.TEST to the backup location.
  • Job Triggering (Step 2 Replacement) : Use an enterprise workload scheduler (e.g., Control-M, Apache Airflow, or AWS Step Functions) to trigger the next process in the pipeline ( INTRDRJ2 ) upon the successful completion of the file copy step.

<h2

INTRDRJ2

This mainframe JCL job is designed to facilitate data preparation and replication within a card demonstration or testing environment ( CARDEMO ).

MAT analysis

Job Analysis Summary: VSAM Creation and Data Replication Job

1. Business-Level Description

This mainframe JCL job is designed to facilitate data preparation and replication within a card demonstration or testing environment ( CARDEMO ).

Although the introductory comments in the JCL indicate the job's intent is to "CREATE PHYSICAL VSAM FILE FOR IMS DEMODB AND INDEX DEMODX," the actual executable step performs a direct file copy (replication) of a backup dataset. It duplicates a test backup dataset to a target destination dataset. This is a common preparatory step in mainframe environments to restore, clone, or stage backup data for subsequent database initialization or application testing.

2. Input Files

The job processes the following input file:

  • DD Name: IN
  • Dataset Name (DSN): AWS.M2.CARDEMO.FTP.TEST.BKUP
  • Disposition (DISP): SHR (Shared access)
  • Description: The source backup dataset containing the sequential or VSAM-compatible records to be replicated.
3. Output Files

The job produces the following output files:

  • DD Name: OUT
  • Dataset Name (DSN): AWS.M2.CARDEMO.FTP.TEST.BKUP.INTRDR
  • Disposition (DISP): SHR (Shared access)
  • Description: The target dataset where the replicated records are written.
  • DD Name: SYSPRINT
  • Description: System output stream used by the IDCAMS utility to log execution statistics, record counts, and any error messages or return codes.
4. Detailed Data Transformations and Technical Description

The job consists of a single step executing the Access Method Services ( IDCAMS ) utility.

Step: IDCAMS
  • Program: IDCAMS
  • Control Statement: REPRO IFILE(IN) OFILE(OUT)
Technical Behavior & Transformation Logic:
  • Record-for-Record Copy: The REPRO command performs a low-level, byte-for-byte copy of the records from the input dataset ( IN ) to the output dataset ( OUT ).
  • Data Transformation: No data transformations, structural changes, field mappings, or filtering are applied to the data. The records in the output dataset will be identical in content, length, and format to those in the input dataset.
  • Reimplementation Guidance:
  • In a modernized cloud or open-systems environment (such as AWS), this step represents a standard file copy operation.
  • If the target environment uses a relational database or a modern NoSQL/document store to replace the IMS/VSAM structure, this step would translate to a data loading or staging operation (e.g., copying a flat file from an Amazon S3 staging bucket to a target directory, or executing a database bulk-load utility).
  • If replicating the file-system behavior directly, this can be achieved using standard shell commands (e.g., cp in Linux) or programming language file-copy APIs (e.g., java.nio.file.Files.copy in Java or shutil.copyfile in Python).

<h2

LOADPADB

This document provides a high-level functional summary of the mainframe JCL job designed to execute the IMS Batch Message Processing (BMP) program PAUDBLOD . This job is part of the CardDemo application, specifically handling the loading or updating of pre-authorization (PAUT) transaction data into an IMS hierarchical database.

MAT analysis

JCL Job Functionality Summary: IMS Database Load (PAUDBLOD)

This document provides a high-level functional summary of the mainframe JCL job designed to execute the IMS Batch Message Processing (BMP) program PAUDBLOD . This job is part of the CardDemo application, specifically handling the loading or updating of pre-authorization (PAUT) transaction data into an IMS hierarchical database.

1. Business-Level Description

The primary business purpose of this job is to populate and update the Pre-Authorization (PAUT) database within the CardDemo credit card processing system.

Pre-authorizations are temporary holds placed on a cardholder's account to verify funds before a transaction is finalized. This job runs as an IMS Batch Message Processing (BMP) region, allowing it to safely access and update online IMS databases concurrently with other online transactions. It reads sequential transaction files containing root (header) and child (detail) pre-authorization records and loads them into the IMS database structure to ensure the online system has up-to-date authorization limits and transaction history.

2. Input Files

The job processes the following input datasets:

  • AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO (DD: INFILE1) : A sequential dataset containing the root segment data (e.g., primary pre-authorization record headers, account identifiers, and transaction metadata).
  • AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO (DD: INFILE2) : A sequential dataset containing the child segment data (e.g., detailed transaction line items, history, or status updates associated with the root records).
  • OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) (DD: DFSVSAMP) : The IMS VSAM subpool definition parameters, used to configure buffer pools for database access performance.
  • IMS System Libraries (DD: IMS) :
  • OEM.IMS.IMSP.PSBLIB : Program Specification Block library containing PSBPAUTB , which defines the program's logical view and access authority to the database.
  • OEM.IMS.IMSP.DBDLIB : Database Description library, defining the physical structure of the IMS databases.
3. Output Files

The primary output of this job is the state change within the live IMS database. Additionally, the job produces the following system and diagnostic outputs:

  • IMS Database (Target) : The hierarchical database defined by the PSBPAUTB PSB is updated with the new root and child segments.
  • SYSPRINT : Standard system output stream containing execution logs, record counts, and processing statistics.
  • IMSERR : A dedicated error log dataset used to capture database-specific access errors or referential integrity violations during the load process.
  • SYSUDUMP : System dump dataset, captured only in the event of an abnormal program termination (abend).
4. Data Transformations and Execution Logic

To successfully reimplement this batch job in a modern cloud environment (such as AWS), the following logical steps and data transformations must be replicated:

Program Execution Flow
  • Initialization : The program PAUDBLOD is invoked via the IMS region controller ( DFSRRC00 ) using the PSB PSBPAUTB . In a modern architecture, this corresponds to initializing a database connection pool with appropriate schema access rights.
  • Sequential Reading : The program reads records from INFILE1 (Root) and INFILE2 (Child) sequentially.
  • Hierarchical Data Mapping :
  • For each record read from INFILE1 , the program validates the data and inserts a Root Segment into the database.
  • For records read from INFILE2 , the program matches them to their parent root segment (typically using a key such as Card Number or Transaction ID) and inserts them as Child Segments under the corresponding parent.
  • Transaction Management (Commit/Checkpoint) :
  • As an IMS BMP, the program periodically issues IMS CHKP (checkpoint) calls to commit database updates and release locks. This prevents database lock escalation and allows online users to access the database during the batch run.
  • Error Handling :
  • If a child record cannot find its corresponding parent, or if duplicate keys are encountered, the error is logged to IMSERR .
  • In case of critical database errors, the transaction is rolled back to the last checkpoint, and the job terminates with a non-zero return code.
Target State Reimplementation Guidance

When migrating this functionality to a relational database (e.g., Amazon Aurora PostgreSQL/MySQL) or a NoSQL database (e.g., Amazon DynamoDB):

  • Relational Database Mapping :
  • Map the IMS Root Segment to a parent table (e.g., PRE_AUTH_HEADER ).
  • Map the IMS Child Segment to a child table (e.g., PRE_AUTH_DETAIL ) with a Foreign Key constraint referencing the parent table's Primary Key.
  • Batch Processing Framework :
  • Implement the logic using a batch framework such as Spring Batch (Java) or AWS Glue (Python/Spark).
  • Read the flat files from an Amazon S3 bucket.
  • Use chunk-based processing to mimic the IMS checkpointing behavior (e.g., commit transactions every 1,000 records) to optimize database performance and resource utilization.
  • Data Validation :
  • Ensure strict validation on the relationship between root and child records to maintain referential integrity during the migration/load process.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Datasets

"AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO";

"AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO";

// Processing Step

"STEP01" [label="PAUDBLOD STEP01"];

// Output Database

"IMS.DATABASE" [label="IMS Database"];

// Data Flow

"AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO" -> "STEP01" [label="Ingest Root"];

"AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO" -> "STEP01" [label="Ingest Child"];

"STEP01" -> "IMS.DATABASE" [label="Update Database"];

}

This process executes an IMS Batch Message Processing (BMP) program to ingest and structure card-related business data into a hierarchical database.

  • Data Ingestion and Database Update (STEP01) : The program PAUDBLOD (executed via the IMS region controller DFSRRC00 ) processes two input datasets:
  • AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO : Contains the root records of the card business data.
  • AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO : Contains the child relationship records.

The step processes these root and child relationship records to populate and update the target IMS database, ensuring that the core hierarchical data structures are synchronized and ready for subsequent business operations.

<h2

MNTTRDB2

This document provides a high-level functional summary of the mainframe JCL job used to perform batch maintenance on a DB2 Transaction Table. This summary is designed to facilitate the modernization and reimplementation of this job in a target environment.

MAT analysis

JCL Job Functionality Summary: DB2 Transaction Table Maintenance

This document provides a high-level functional summary of the mainframe JCL job used to perform batch maintenance on a DB2 Transaction Table. This summary is designed to facilitate the modernization and reimplementation of this job in a target environment.

1. Business-Level Description

The primary business purpose of this job is to perform batch maintenance on a DB2 database table that stores transaction types and their corresponding descriptions (likely a reference or lookup table).

Instead of performing manual, individual updates, business administrators or upstream systems generate a sequential flat file containing bulk changes. This job processes that file to perform three core database operations in batch:

  • Add (Insert): Registering new transaction types.
  • Update: Modifying descriptions of existing transaction types.
  • Delete: Removing obsolete transaction types from the system.

This batch process ensures that the transaction reference data remains synchronized, accurate, and up-to-date with minimal manual intervention.

2. Input Files
1. Maintenance Input File ( INPFILE )
  • Dataset Name (DSN): INPFILE
  • Format: Fixed-block sequential file.
  • Description: Contains the batch instructions and data payload for database updates.
  • Record Layout:
  • Position 1 (1 byte): Action Code
  • A = Add (Insert)
  • U = Update
  • D = Delete
  • * = Comment (Ignore record)
  • Positions 2–3 (2 bytes): Transaction Type (Numeric value, used as the primary key).
  • Positions 4–53 (50 bytes): Transaction Description (Alphanumeric text).
2. DB2 Transaction Table (Database Input)
  • Description: The target DB2 table acts as an implicit input during update and delete operations to verify the existence of records before modification.
3. Output Files
1. DB2 Transaction Table (Database Output)
  • Description: The primary output of this job is the updated state of the DB2 Transaction Table. The table is modified in-place based on the SQL operations (INSERT, UPDATE, DELETE) executed during processing.
2. System Terminal Output ( SYSTSPRT )
  • Description: Standard TSO/E output stream used to capture execution logs, utility messages, database connection status, and any SQL error codes (SQLCODEs) encountered during the run.
4. Data Transformations and Processing Logic

To successfully reimplement this batch job in a modern cloud or distributed environment, the following processing logic and transformation rules must be applied:

Parsing Logic

For each record read from the INPFILE :

  • Read Action Code (Position 1):
  • If the value is * , treat the row as a comment. Skip processing and move to the next record.
  • If the value is spaces or low-values, skip or log as an invalid record.
  • Extract Key and Payload:
  • Extract Transaction Type from positions 2–3. Convert/cast to a numeric data type (e.g., Integer or Short).
  • Extract Transaction Description from positions 4–53. Trim trailing whitespace.
Database Operations (CRUD)

Based on the Action Code, execute the corresponding database transaction:

Action Code A (Add / Insert):

  • SQL Logic:

INSERT INTO TRANSACTION_TABLE (TRANSACTION_TYPE, TRANSACTION_DESCRIPTION)

VALUES (parsed_transaction_type, 'parsed_transaction_description');

  • Error Handling: If the record already exists (Duplicate Key / SQLCODE -803), log an error and decide whether to skip or abort the batch.

Action Code U (Update):

  • SQL Logic:

UPDATE TRANSACTION_TABLE

SET TRANSACTION_DESCRIPTION = 'parsed_transaction_description'

WHERE TRANSACTION_TYPE = parsed_transaction_type;

  • Error Handling: If the record does not exist (SQLCODE +100 / Row Not Found), log a warning indicating an update was attempted on a non-existent key.

Action Code D (Delete):

  • SQL Logic:

DELETE FROM TRANSACTION_TABLE

WHERE TRANSACTION_TYPE = parsed_transaction_type;

  • Error Handling: If the record does not exist, log a warning.
Transaction Management
  • Commit/Rollback: Implement standard batch transaction boundaries. Commit changes to the database after processing the entire file successfully. If a critical database error occurs, roll back the entire unit of work to maintain data integrity.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Dataset

"INPFILE" [label="INPFILE"];

// Processing Step

"IKJEFT01_STEP1" [label="IKJEFT01 STEP1"];

// Target Database Table

"DB2_TRANSACTION_TABLE" [label="DB2 Transaction Table"];

// Data Flow

"INPFILE" -> "IKJEFT01_STEP1" [label="Read Transactions"];

"IKJEFT01_STEP1" -> "DB2_TRANSACTION_TABLE" [label="Batch Update"];

}

This JCL job performs batch maintenance on a DB2 transaction table by processing action-driven records from an input file.

  • Batch Update Processing (STEP1) : The program IKJEFT01 reads transaction instructions from the input dataset INPFILE . Each record is parsed to identify the requested action based on specific codes:
  • A : Add a new transaction
  • U : Update an existing transaction description
  • D : Delete a transaction
  • *: Ignore as a comment line

The validated changes are then applied directly to update and maintain the target DB2 Transaction Table.

<h2

OPENFIL

The OPCIFIL JCL job is an operational administrative utility designed to open five critical application files within an active CICS (Customer Information Control System) online region named CICSAWSA .

MAT analysis
Business-Level Description

The OPCIFIL JCL job is an operational administrative utility designed to open five critical application files within an active CICS (Customer Information Control System) online region named CICSAWSA .

In a mainframe environment, batch jobs and online transactions often require exclusive access to the same files (typically VSAM datasets). Before batch processing begins, files are usually closed in CICS to prevent conflicts. Once batch processing is complete, this job is executed to reopen the files, restoring online access to end-users and CICS transactions.

Input Files

This job does not read physical input datasets (such as sequential or VSAM files). Instead, it utilizes in-stream control data:

  • ISFIN DD * : An in-stream dataset containing the System Display and Search Facility (SDSF) commands. These commands instruct the system to issue MVS modify commands to the CICS region.
Output Files

This job does not generate physical output datasets. It produces system spool files for logging and auditing purposes:

  • ISFOUT DD : Captures the SDSF session log and execution details.
  • CMDOUT DD : Captures the command responses and execution status returned from the operating system console.
Detailed Description of Operational Logic and Reimplementation

Operational Logic

The job executes the IBM utility program SDSF to issue system console commands. It performs no data transformations, record modifications, or file writes. Instead, it performs the following system actions:

  • Target Region : It targets the CICS region named CICSAWSA .
  • Command Execution : It issues the MVS Modify command ( /F ) to pass CICS Master Terminal ( CEMT ) commands to the target region.
  • File Status Modification : It changes the status of the following five files to OPEN ( OPE ):
  • TRANSACT : Transaction data file.
  • CCXREF : Credit Card Cross-Reference file.
  • ACCTDAT : Account Data file.
  • CXACAIX : Cross-Reference Account Alternate Index file.
  • USRSEC : User Security/Authorization file.

Reimplementation Guidance for Modern Systems

When migrating this functionality to a modern cloud platform (such as AWS), the concept of opening and closing files for batch/online isolation is often obsolete due to the use of relational databases (RDBMS) or modern distributed file systems that support concurrent access.

If you are refactoring or replatforming:

  • Relational Database Target (e.g., Amazon RDS / Aurora) : If these VSAM files are migrated to database tables, this JCL step is completely obsolete and can be removed. Databases natively handle concurrent batch and online access via transaction isolation levels and locking mechanisms.
  • Mainframe Emulation / Replatforming (e.g., AWS Mainframe Modernization / Micro Focus) : If the target architecture still uses an emulated CICS region (such as Enterprise Server), this step must be replaced by an equivalent script or utility (e.g., using command-line administration tools like casutil or administrative APIs) to enable or open the resources within the emulated region's File Control Table (FCT).

<h2

POSTTRAN

This mainframe JCL job executes a single-step batch process ( STEP15 ) running the COBOL program CBTRN02C . The primary business purpose of this job is to perform the daily reconciliation, validation, and posting of credit card transactions. It processes incoming daily transactions from a sequential file, validates them against master account and card cross-reference databases, updates customer account balances and category-specific spending totals, and writes records to the master transaction history. Any transactions failing validation are segregated into a daily rejects file with detailed error codes for operational review.

MAT analysis

Job Summary: Daily Credit Card Transaction Posting and Validation

This mainframe JCL job executes a single-step batch process ( STEP15 ) running the COBOL program CBTRN02C . The primary business purpose of this job is to perform the daily reconciliation, validation, and posting of credit card transactions. It processes incoming daily transactions from a sequential file, validates them against master account and card cross-reference databases, updates customer account balances and category-specific spending totals, and writes records to the master transaction history. Any transactions failing validation are segregated into a daily rejects file with detailed error codes for operational review.

Input Files

DALYTRAN ( AWS.M2.CARDDEMO.DALYTRAN.PS )

  • Type : Sequential File (PS)
  • Description : Contains the raw daily credit card transaction records to be processed. Key fields include card number, transaction amount, transaction type/category codes, origin timestamp, and merchant details.

XREFFILE ( AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS )

  • Type : Indexed VSAM File (KSDS)
  • Description : Card cross-reference file used to map the transaction's card number to its associated unique Account ID.
Output and Input-Output (I-O) Files

TRANFILE ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS )

  • Type : Indexed VSAM File (KSDS) - Output
  • Description : The master transaction history file where successfully validated and posted transactions are permanently recorded.

DALYREJS ( AWS.M2.CARDDEMO.DALYREJS )

  • Type : Sequential File (PS) - Output (Created New)
  • Description : The daily rejects file. It stores transaction records that failed validation, appended with a trailer containing specific error codes and descriptions.

ACCTFILE ( AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS )

  • Type : Indexed VSAM File (KSDS) - Input-Output (I-O)
  • Description : The account master database. It is read to validate account status/credit limits and updated to reflect new balances and cycle credit/debit accumulators.

TCATBALF ( AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS )

  • Type : Indexed VSAM File (KSDS) - Input-Output (I-O)
  • Description : The transaction category balance file. It tracks accumulated balances by account and transaction category (e.g., retail, travel, cash advance) and is updated or created during posting.
Detailed Data Transformations and Business Logic

To reimplement this job in a new system, the following sequential logic, validation rules, and data transformations must be executed for each record in the daily transaction input file ( DALYTRAN ):

1. Validation Pipeline

Before any transaction is posted, it must pass four sequential validation checks. If any check fails, the transaction is immediately routed to the reject handler.

Check 1: Card Cross-Reference Lookup

  • Logic : Query the XREFFILE using the transaction's card number ( DALYTRAN-CARD-NUM ) as the key.
  • Failure Condition : If the card number does not exist in the cross-reference file.
  • Error Code : 100 ("INVALID CARD NUMBER FOUND").

Check 2: Account Master Lookup

  • Logic : Retrieve the Account ID ( XREF-ACCT-ID ) from the successful cross-reference lookup and query the ACCTFILE .
  • Failure Condition : If the Account ID does not exist in the account master file.
  • Error Code : 101 ("ACCOUNT RECORD NOT FOUND").

Check 3: Credit Limit Verification

  • Logic : Calculate a temporary projected balance using the account's current cycle accumulators and the incoming transaction amount:

$$\text{Temporary Balance} = \text{Current Cycle Credit} - \text{Current Cycle Debit} + \text{Transaction Amount}$$

  • Failure Condition : If the calculated $\text{Temporary Balance}$ exceeds the account's credit limit ( ACCT-CREDIT-LIMIT ).
  • Error Code : 102 ("OVERLIMIT TRANSACTION").

Check 4: Account Expiration Verification

  • Logic : Compare the account's expiration date ( ACCT-EXPIRAION-DATE ) with the transaction's origin date (extracted from the first 10 characters of the transaction timestamp DALYTRAN-ORIG-TS ).
  • Failure Condition : If the transaction origin date is strictly greater than the account expiration date.
  • Error Code : 103 ("TRANSACTION RECEIVED AFTER ACCT EXPIRATION").
2. Successful Transaction Posting (Updates & Writes)

If all validations pass, the system must perform the following atomic updates:

Generate Processing Timestamp :

  • Generate a DB2-style timestamp in the format: YYYY-MM-DD-HH.MM.SS.MIL0000 to populate the transaction's processing timestamp ( TRAN-PROC-TS ).

Update Transaction Category Balance ( TCATBALF ) :

  • Construct a composite key using: Account ID + Transaction Type Code + Transaction Category Code .
  • Read TCATBALF using this key.
  • If the record exists : Add the transaction amount to the category balance ( TRAN-CAT-BAL ) and rewrite the record.
  • If the record does not exist : Create a new record with the composite key, set the balance to the transaction amount, and write the record.

Update Account Master ( ACCTFILE ) :

  • Update the account's current balance ( ACCT-CURR-BAL ) by adding/subtracting the transaction amount.
  • Update the cycle accumulators:
  • If the transaction is a charge, add the amount to ACCT-CURR-CYC-DEBIT .
  • If the transaction is a payment/credit, add the amount to ACCT-CURR-CYC-CREDIT .
  • Rewrite the updated account record. If the rewrite fails, flag with error code 109 ("ACCOUNT RECORD NOT FOUND during rewrite").

Write Master Transaction Record ( TRANFILE ) :

  • Format and write the complete transaction record, including the generated processing timestamp, to the master transaction history file.
3. Reject Handling

If a transaction fails any validation check:

  • Increment the reject counter.
  • Format a reject record containing the original transaction data.
  • Append a validation trailer containing the specific numeric error code (e.g., 100 , 101 , 102 , 103 , 109 ) and its corresponding text description.
  • Write the formatted record to the sequential rejects file ( DALYREJS ).
4. Job Termination and Return Codes
  • Upon reaching the end of the input file, close all files.
  • Log summary statistics to the system output:
  • Total transactions processed.
  • Total transactions rejected.
  • Return Code Logic :
  • If the process completes successfully with zero rejects, return code 0 .
  • If the process completes successfully but one or more transactions were rejected, set the step return code to 4 to alert operations.
  • If a critical file I/O error occurs during execution, log the file status, call the system abend service, and terminate with abend code 999 .

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Datasets

"AWS.M2.CARDDEMO.DALYTRAN.PS" [label="AWS.M2.CARDDEMO.DALYTRAN.PS"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS"];

// Input/Output (Updated) Datasets

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS"];

"AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS"];

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS"];

// Output Datasets

"AWS.M2.CARDDEMO.DALYREJS" [label="AWS.M2.CARDDEMO.DALYREJS"];

// Processing Step

"CBTRN02C_STEP15" [label="CBTRN02C STEP15"];

// Data Flow Edges

"AWS.M2.CARDDEMO.DALYTRAN.PS" -> "CBTRN02C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" -> "CBTRN02C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" -> "CBTRN02C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS" -> "CBTRN02C_STEP15" [label="STEP15"];

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" -> "CBTRN02C_STEP15" [label="STEP15"];

"CBTRN02C_STEP15" -> "AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="STEP15"];

"CBTRN02C_STEP15" -> "AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS" [label="STEP15"];

"CBTRN02C_STEP15" -> "AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" [label="STEP15"];

"CBTRN02C_STEP15" -> "AWS.M2.CARDDEMO.DALYREJS" [label="STEP15"];

}

This process executes a batch program to validate and process daily credit card transactions, updating account balances, category spending, and transaction history, while logging rejected transactions.

Transaction Processing (STEP15) : The program CBTRN02C processes the daily transaction file ( AWS.M2.CARDDEMO.DALYTRAN.PS ) and performs business validations against the card cross-reference file ( AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS ) and account data ( AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS ).

Master Updates : For validated transactions, the program updates:

  • Customer account balances in AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS
  • Category-specific spending balances in AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS
  • Master transaction history in AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS

Rejection Logging : Transactions failing validation are written to the daily rejects file ( AWS.M2.CARDDEMO.DALYREJS ) with specific error details.

<h2

PRTCATBL

This document provides a technical and business-level summary of the mainframe JCL job designed to process, back up, and report on Transaction Category Balance data.

MAT analysis

JCL Job Functionality Summary

This document provides a technical and business-level summary of the mainframe JCL job designed to process, back up, and report on Transaction Category Balance data.

1. Business-Level Description

The primary business purpose of this JCL job is to generate a formatted transaction category balance report from the core CardDemo application database.

The job performs the following business functions:

  • Initialization : Ensures a clean execution environment by deleting any pre-existing version of the final report file.
  • Data Backup : Unloads the active Transaction Category Balance data from an online VSAM Key Sequenced Data Set (KSDS) into a sequential backup file. This secures a point-in-time snapshot of the balance data.
  • Reporting and Sorting : Reads the backup data, sorts the records systematically by Account ID, Transaction Type, and Transaction Code, and formats the numeric balance values into a highly readable decimal format. The final output is saved as a report file ready for business auditing or downstream processing.
2. Input Files

| Dataset Name | File Type | Description |

| :--- | :--- | :--- |

| AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS | VSAM KSDS | The primary online database file containing active Transaction Category Balance records. |

| AWS.M2.CARDDEMO.TCATBALF.BKUP | Sequential | The sequential backup file created in STEP05R , which serves as the input to the sorting and formatting step ( STEP10R ). |

3. Output Files

| Dataset Name | File Type | Disposition | Description |

| :--- | :--- | :--- | :--- |

| AWS.M2.CARDDEMO.TCATBALF.BKUP | Sequential | (NEW, CATLG, DELETE) | A sequential backup copy of the VSAM KSDS transaction category balance data. |

| AWS.M2.CARDDEMO.TCATBALF.REPT | Sequential | (NEW, CATLG, DELETE) | The final sorted and formatted Transaction Category Balance report. |

4. Detailed Data Transformations and Step-by-Step Execution
Step 1: DELDEF (Program: IEFBR14 )
  • Function : Environment cleanup.
  • Transformation : No data transformation is performed. The step utilizes the dummy utility IEFBR14 to delete the existing dataset AWS.M2.CARDDEMO.TCATBALF.REPT if it exists ( DISP=(MOD, DELETE) ), preventing job failure due to duplicate dataset allocation in subsequent steps.
Step 2: STEP05R (Procedure: REPROC )
  • Function : VSAM to Sequential Unload.
  • Transformation : Copies the raw records from the VSAM KSDS ( AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS ) directly to a sequential backup dataset ( AWS.M2.CARDDEMO.TCATBALF.BKUP ) without altering the record structure.
Step 3: STEP10R (Program: SORT )

Function : Data Sorting, Filtering, and Reformatting.

Input Record Layout (Defined via SYMNAMES ):

  • TRANCAT-ACCT-ID : Position 1, Length 11, Zoned Decimal ( ZD )
  • TRANCAT-TYPE-CD : Position 12, Length 2, Character ( CH )
  • TRANCAT-CD : Position 14, Length 4, Zoned Decimal ( ZD )
  • TRAN-CAT-BAL : Position 18, Length 11, Zoned Decimal ( ZD )

Sorting Logic :

The input records are sorted in ascending order based on three keys:

  • TRANCAT-ACCT-ID (Ascending)
  • TRANCAT-TYPE-CD (Ascending)
  • TRANCAT-CD (Ascending)

Output Formatting (OUTREC Transformation) :

The output record is restructured and formatted into a space-delimited layout. The numeric balance is converted from a raw zoned decimal format to an explicit decimal format.

| Output Field Position | Source Field / Value | Source Format | Target Format / Output Representation | Width (Bytes) |

| :--- | :--- | :--- | :--- | :--- |

| 1 - 11 | TRANCAT-ACCT-ID | Zoned Decimal | Character representation of Account ID | 11 |

| 12 | Space ( X ) | Constant | Space separator | 1 |

| 13 - 14 | TRANCAT-TYPE-CD | Character | Character representation of Type Code | 2 |

| 15 | Space ( X ) | Constant | Space separator | 1 |

| 16 - 19 | TRANCAT-CD | Zoned Decimal | Character representation of Transaction Code | 4 |

| 20 | Space ( X ) | Constant | Space separator | 1 |

| 21 - 32 | TRAN-CAT-BAL | Zoned Decimal | Formatted numeric string: TTTTTTTTT.TT (9 integer digits, a decimal point, and 2 decimal digits) | 12 |

| 33 - 41 | Spaces ( 9X ) | Constant | Trailing spaces padding | 9 |

Total Output Record Length : 41 bytes.

<h2

READACCT

This document provides a comprehensive functional summary of the mainframe JCL job designed to extract, format, and restructure master account data from a primary VSAM database into multiple sequential downstream files.

MAT analysis

JCL Job Functionality Summary: Account Data Extraction and Formatting

This document provides a comprehensive functional summary of the mainframe JCL job designed to extract, format, and restructure master account data from a primary VSAM database into multiple sequential downstream files.

Business-Level Description

The primary business purpose of this batch job is to perform data preparation, integration, and distribution for the CardDemo credit card management system. The job reads core master account records from an indexed VSAM database and transforms this data into three distinct sequential files. These output files are structured to support downstream reporting, historical trend analysis, archiving, and external subsystem integration.

To ensure operational reliability, the job first performs a cleanup step to delete any pre-existing output files from previous runs, preventing duplicate data or job failures. It then executes a batch utility that standardizes date formats, applies conditional business rules for default financial values, and restructures the data into both array-based and variable-length formats.

JCL Execution Flow and Steps

The JCL job consists of two sequential steps:

  • PREDEL (Program: IEFBR14 ) : A utility step that deletes existing instances of the output datasets. This ensures a clean environment for the subsequent processing step and prevents "duplicate dataset" allocation errors.
  • STEP05 (Program: CBACT01C ) : The main processing step that executes the COBOL batch utility. It reads the VSAM master file, performs data transformations, and writes the formatted records to the newly allocated sequential datasets.
Input Files

The job processes the following input file:

  • Master Account File
  • DD Name : ACCTFILE
  • Dataset Name (DSN) : AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS
  • Format : VSAM Key-Sequenced Data Set (KSDS)
  • Description : Contains master credit card account records, including balances, credit limits, status indicators, and administrative dates.
Output Files

The job generates the following sequential output files:

Detailed Account Extract File

  • DD Name : OUTFILE
  • Dataset Name (DSN) : AWS.M2.CARDDEMO.ACCTDATA.PSCOMP
  • Format : Sequential (Physical Sequential)
  • Description : Contains detailed, formatted account records with standardized dates and applied financial defaults.

Array Account Extract File

  • DD Name : ARRYFILE
  • Dataset Name (DSN) : AWS.M2.CARDDEMO.ACCTDATA.ARRYPS
  • Format : Sequential (Physical Sequential)
  • Description : Contains multi-period balance and debit snapshots structured in an array format for trend analysis.

Variable-Length Record Extract File

  • DD Name : VBRCFILE
  • Dataset Name (DSN) : AWS.M2.CARDDEMO.ACCTDATA.VBPS
  • Format : Variable-Length Sequential
  • Description : Contains two distinct record types per account (a short 12-byte administrative status record and a longer 39-byte financial summary record).
Detailed Data Transformations

To reimplement this job in a new system, the following data transformation and processing rules must be applied for each record read from the input VSAM file:

1. Detailed Account Extract ( OUTFILE / OUT-FILE )

For each input record, map and transform fields to the output structure as follows:

Direct Mapping :

  • ACCT-ID (11-digit numeric) $\rightarrow$ OUT-ACCT-ID
  • ACCT-ACTIVE-STATUS (1-char alphanumeric) $\rightarrow$ OUT-ACCT-ACTIVE-STATUS
  • ACCT-CURR-BAL (Signed numeric) $\rightarrow$ OUT-ACCT-CURR-BAL
  • ACCT-CREDIT-LIMIT (Signed numeric) $\rightarrow$ OUT-ACCT-CREDIT-LIMIT
  • ACCT-CASH-CREDIT-LIMIT (Signed numeric) $\rightarrow$ OUT-ACCT-CASH-CREDIT-LIMIT
  • ACCT-OPEN-DATE (10-char alphanumeric) $\rightarrow$ OUT-ACCT-OPEN-DATE
  • ACCT-EXPIRAION-DATE (10-char alphanumeric) $\rightarrow$ OUT-ACCT-EXPIRAION-DATE
  • ACCT-CURR-CYC-CREDIT (Signed numeric) $\rightarrow$ OUT-ACCT-CURR-CYC-CREDIT
  • ACCT-GROUP-ID (10-char alphanumeric) $\rightarrow$ OUT-ACCT-GROUP-ID

Date Standardization :

  • Pass the input ACCT-REISSUE-DATE (format YYYY-MM-DD ) to the date-formatting routine (historically COBDATFT ).
  • Convert the date to YYYYMMDD format.
  • Map the formatted 8-character date to OUT-ACCT-REISSUE-DATE .
  • Extract and retain the 4-digit year ( YYYY ) for use in the variable-length file.

Conditional Debit Logic :

  • Check the value of ACCT-CURR-CYC-DEBIT .
  • Rule : If the value is equal to zero, populate OUT-ACCT-CURR-CYC-DEBIT with a default value of 2525.00 .
  • Rule : If the value is non-zero, do not copy the input value to the output record (leave the output field unpopulated/retaining residual initialization data).
2. Array Account Extract ( ARRYFILE / ARRY-FILE )

Initialize the output structure to zeros/spaces, map the Account ID, and populate a 5-occurrence array ( ARR-ACCT-BAL ) with the following specific financial snapshots:

  • Occurrence 1 :
  • Balance Field $\rightarrow$ Map from ACCT-CURR-BAL
  • Debit Field $\rightarrow$ Set to hardcoded value 1005.00
  • Occurrence 2 :
  • Balance Field $\rightarrow$ Map from ACCT-CURR-BAL
  • Debit Field $\rightarrow$ Set to hardcoded value 1525.00
  • Occurrence 3 :
  • Balance Field $\rightarrow$ Set to hardcoded value -1025.00
  • Debit Field $\rightarrow$ Set to hardcoded value -2500.00
  • Occurrences 4 and 5 :
  • Must remain zero-filled.
3. Variable-Length Record Extract ( VBRCFILE / VBRC-FILE )

For every single input record processed, write two separate records of different lengths to the variable-length output file:

Record 1: Status Record (Length: 12 bytes)

  • Map ACCT-ID (11 characters/digits).
  • Map ACCT-ACTIVE-STATUS (1 character).
  • Set record length indicator to 12 and write the record.

Record 2: Financial & Reissue Record (Length: 39 bytes)

  • Map ACCT-ID (11 characters/digits).
  • Map ACCT-CURR-BAL (Signed numeric, 12 bytes).
  • Map ACCT-CREDIT-LIMIT (Signed numeric, 12 bytes).
  • Map the 4-digit reissue year ( YYYY ) extracted during the date standardization step (4 bytes).
  • Set record length indicator to 39 and write the record.
Technical and Operational Rules
  • File Status Validation : The system must validate the status of all file operations (Open, Read, Write). Any status other than success ( 00 or 10 for EOF) must trigger an immediate, safe termination of the job with diagnostic logging to prevent data corruption.
  • Restartability : Because the job does not implement intermediate checkpointing or commits, any failure during execution requires a full restart of the job. The PREDEL step ensures that any partial outputs from a failed run are deleted before the restart.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Nodes

"PREDEL_STEP" [label="IEFBR14 PREDEL"];

"CBACT01C_STEP05" [label="CBACT01C STEP05"];

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS"];

"AWS.M2.CARDDEMO.ACCTDATA.PSCOMP" [label="AWS.M2.CARDDEMO.ACCTDATA.PSCOMP"];

"AWS.M2.CARDDEMO.ACCTDATA.ARRYPS" [label="AWS.M2.CARDDEMO.ACCTDATA.ARRYPS"];

"AWS.M2.CARDDEMO.ACCTDATA.VBPS" [label="AWS.M2.CARDDEMO.ACCTDATA.VBPS"];

// Edges for PREDEL (Cleanup)

"PREDEL_STEP" -> "AWS.M2.CARDDEMO.ACCTDATA.PSCOMP" [label="Delete Existing"];

"PREDEL_STEP" -> "AWS.M2.CARDDEMO.ACCTDATA.ARRYPS" [label="Delete Existing"];

"PREDEL_STEP" -> "AWS.M2.CARDDEMO.ACCTDATA.VBPS" [label="Delete Existing"];

// Edges for STEP05 (Processing)

"AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS" -> "CBACT01C_STEP05" [label="Read Account Master"];

"CBACT01C_STEP05" -> "AWS.M2.CARDDEMO.ACCTDATA.PSCOMP" [label="Extract and Standardize"];

"CBACT01C_STEP05" -> "AWS.M2.CARDDEMO.ACCTDATA.ARRYPS" [label="Trend Structuring"];

"CBACT01C_STEP05" -> "AWS.M2.CARDDEMO.ACCTDATA.VBPS" [label="Segmented Reporting"];

}

This batch process manages the initialization and execution of account master data processing, extracting and transforming VSAM records into multiple specialized sequential datasets.

Pre-Delete Step (PREDEL) : This step utilizes the IEFBR14 utility to delete any pre-existing target datasets ( AWS.M2.CARDDEMO.ACCTDATA.PSCOMP , AWS.M2.CARDDEMO.ACCTDATA.ARRYPS , and AWS.M2.CARDDEMO.ACCTDATA.VBPS ) from previous runs, ensuring a clean environment.

Account Processing Step (STEP05) : The CBACT01C program reads the master account VSAM file ( AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS ) and performs three primary transformations:

  • Detailed Account Extraction and Standardization : Extracts core financial metrics, standardizes date formats, and applies default financial values, outputting to AWS.M2.CARDDEMO.ACCTDATA.PSCOMP .
  • Array-Based Trend Structuring : Restructures account data into multi-period balance and debit snapshots for trend analysis, outputting to AWS.M2.CARDDEMO.ACCTDATA.ARRYPS .
  • Segmented Administrative and Financial Reporting : Splits account information into brief administrative status records and detailed financial summaries, outputting to AWS.M2.CARDDEMO.ACCTDATA.VBPS .

<h2

READCARD

This document provides a high-level functional summary of the mainframe JCL job executing the card account data extraction and reporting utility.

MAT analysis

JCL Job Functionality Summary

This document provides a high-level functional summary of the mainframe JCL job executing the card account data extraction and reporting utility.

Business-Level Description

The primary business purpose of this JCL job is to perform administrative auditing, data verification, and reporting on the master credit/debit card database within the CardDemo application.

The job executes a single step ( STEP05 ) running the batch COBOL utility CBACT02C . This utility sequentially reads the entire master card database and extracts critical cardholder information—including card numbers, associated account identifiers, security codes, cardholder names, expiration dates, and operational statuses. The extracted data is written directly to the system logs for verification and reporting. This job serves as a foundational data validation and integrity check utility for system administrators.

Input Files
  • CARDFILE (DSN: AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS )
  • Type: VSAM Key-Sequenced Data Set (KSDS)
  • Description: The master card database containing indexed records of all issued credit and debit cards.
  • STEPLIB (DSN: AWS.M2.CARDDEMO.LOADLIB )
  • Type: Partitioned Dataset (PDS/PDSE)
  • Description: The program load library containing the compiled executable binary for the CBACT02C program.
Output Files
  • SYSOUT / SYSPRINT
  • Type: System Spool / Standard Output Streams
  • Description: Receives the formatted cardholder records printed during sequential processing, as well as execution logs, file status diagnostics, and error messages in the event of a failure.
Detailed Description of Data Transformations and Processing Logic

To successfully reimplement this job in a modern target system, the following processing logic, data structures, and error-handling behaviors must be replicated:

1. Data Extraction and Mapping

The program reads the input VSAM file sequentially. Each record retrieved is mapped to the following data structure:

| Field Name | COBOL Picture Clause | Data Type | Description |

| :--- | :--- | :--- | :--- |

| CARD-NUM | PIC X(16) | Alphanumeric | Primary Key; the 16-digit card number. |

| CARD-ACCT-ID | PIC 9(11) | Numeric | The 11-digit customer account identifier. |

| CARD-CVV-CD | PIC 9(03) | Numeric | The 3-digit Card Verification Value. |

| CARD-EMBOSSED-NAME | PIC X(50) | Alphanumeric | The cardholder's name as printed on the card. |

| CARD-EXPIRAION-DATE | PIC X(10) | Alphanumeric | The expiration date of the card. |

| CARD-ACTIVE-STATUS | PIC X(01) | Alphanumeric | Status flag (e.g., 'Y' for active, 'N' for inactive). |

2. Data Transformation

No structural modifications, calculations, or aggregations are performed on the data. The utility performs a direct pass-through extraction:

  • Input: Raw bytes from the VSAM KSDS.
  • Transformation: Sequential mapping of raw bytes into the structured fields defined above.
  • Output: Direct write of the mapped fields to the standard output stream ( SYSOUT / SYSPRINT ) for reporting.
3. Execution Flow and Loop Control
  • Initialization: Open CARDFILE in sequential input mode.
  • Processing Loop:
  • Read the next record.
  • If File Status is 00 (Success): Display the record contents to the output stream and repeat.
  • If File Status is 10 (End of File): Gracefully exit the loop, close the file, and terminate the job step with a return code of 0 .
  • If File Status is any other value: Initiate the Exception and Error Handling routine.
4. Exception and Error Handling (Reimplementation Critical)

If any file operation (OPEN, READ, CLOSE) returns an unexpected status code, the target system must replicate the following diagnostic and termination logic:

  • Standard COBOL Status Codes: If the status code is standard and numeric, it is displayed directly.
  • VSAM-Specific Status Codes (Operating System Level): If the status code is non-numeric or begins with the character 9 :
  • The first character ( 9 ) is retained.
  • The second byte of the status code is treated as a binary value, converted to its 3-digit decimal equivalent, and concatenated to the first character (e.g., displaying 9 followed by the decimal value).
  • Abnormal Termination (ABEND): Upon logging the formatted error message and status code, the program must immediately terminate execution abnormally (equivalent to IBM Language Environment utility CEE3ABD with an ABEND code of 999 ) to prevent partial processing and alert operations.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Dataset

"AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS"];

// Process Step

"CBACT02C_STEP05" [label="CBACT02C STEP05"];

// Outputs

"SYSPRINT" [label="SYSPRINT"];

"SYSOUT" [label="SYSOUT"];

// Data Flow

"AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS" -> "CBACT02C_STEP05" [label="Read Card Records"];

"CBACT02C_STEP05" -> "SYSPRINT" [label="Formatted Report"];

"CBACT02C_STEP05" -> "SYSOUT" [label="Diagnostics and Errors"];

}

This process executes a card data retrieval and reporting utility to extract and validate information from the master card repository.

  • Card Record Retrieval (STEP05) : The program CBACT02C reads card records sequentially from the VSAM KSDS dataset ( AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS ).
  • Data Processing and Extraction : Key business and security details (such as card number, account ID, CVV, cardholder name, expiration date, and status) are extracted and validated.
  • Reporting and Diagnostics :
  • Formatted administrative reports and data verifications are written to SYSPRINT .
  • Execution logs, continuous validation diagnostics, and error codes are outputted to SYSOUT to ensure data integrity and controlled termination in case of failure.

<h2

READCUST

This batch job executes the CardDemo Customer Data Retrieval and Reporting Utility ( CBCUS01C ). It serves as an administrative reporting and data verification tool designed to sequentially retrieve and display comprehensive customer profile information from the primary customer database. The job is primarily used by system operators and business analysts to inspect the active customer registry, verify data integrity, and perform administrative audits.

MAT analysis

Job Functionality Summary: CardDemo Customer Data Retrieval and Reporting

This batch job executes the CardDemo Customer Data Retrieval and Reporting Utility ( CBCUS01C ). It serves as an administrative reporting and data verification tool designed to sequentially retrieve and display comprehensive customer profile information from the primary customer database. The job is primarily used by system operators and business analysts to inspect the active customer registry, verify data integrity, and perform administrative audits.

Input Files
  • Customer Master File ( CUSTFILE )
  • DD Name: CUSTFILE
  • Dataset Name: AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS
  • Format: Indexed VSAM Key-Sequenced Data Set (KSDS)
  • Description: Contains the master registry of customer profiles, including personal identification, contact details, and financial attributes.
Output Files
  • System Output ( SYSOUT )
  • DD Name: SYSOUT
  • Format: System Spool / Console Display
  • Description: Receives the formatted customer profile records printed during execution.
  • System Print ( SYSPRINT )
  • DD Name: SYSPRINT
  • Format: System Spool / Console Display
  • Description: Receives execution logs, diagnostic messages, and error reports in the event of a failure.
Detailed Data Transformations and Processing Logic

To successfully reimplement this job in a new system, the following processing rules, data structures, and logic flows must be applied:

1. Execution Flow
  • File Initialization: Open the input customer database ( CUSTFILE ) in sequential read mode.
  • Sequential Processing Loop:
  • Read the next customer record sequentially.
  • If the End-of-File (EOF) marker is reached, exit the loop.
  • For each successfully retrieved record, write the complete customer profile to the system output ( SYSOUT ).
  • Termination: Close the input file and terminate the program.
2. Target Record Structure (500 Bytes)

The input records must be mapped to the following structure:

  • Customer ID (Numeric, 9 digits) - Primary Key
  • First Name (Alphanumeric, 25 characters)
  • Middle Name (Alphanumeric, 25 characters)
  • Last Name (Alphanumeric, 25 characters)
  • Address Line 1 (Alphanumeric, 50 characters)
  • Address Line 2 (Alphanumeric, 50 characters)
  • Address Line 3 (Alphanumeric, 50 characters)
  • State Code (Alphanumeric, 2 characters)
  • Country Code (Alphanumeric, 3 characters)
  • Zip Code (Alphanumeric, 10 characters)
  • Phone Number 1 (Alphanumeric, 15 characters)
  • Phone Number 2 (Alphanumeric, 15 characters)
  • Social Security Number (SSN) (Numeric, 9 digits)
  • Government Issued ID (Alphanumeric, 20 characters)
  • Date of Birth (Alphanumeric, 10 characters, format YYYY-MM-DD )
  • EFT Account ID (Alphanumeric, 10 characters)
  • Primary Cardholder Indicator (Alphanumeric, 1 character)
  • FICO Credit Score (Numeric, 3 digits)
3. Key Processing Quirks (For Exact Replication)
  • Double Display Behavior: During the sequential loop, every successfully read customer record is written to the output ( SYSOUT ) twice :
  • Immediately after the read operation completes within the read routine.
  • Again in the main processing loop after control returns from the read routine.
  • No Field-Level Validation: The utility does not perform format or range validation on individual fields (e.g., checking if the SSN is numeric or if the DOB is a valid date). It assumes the structural integrity of the incoming VSAM record.
4. Error and Exception Handling
  • File Status Verification: The system must validate the 2-character file status key after every I/O operation (Open, Read, Close).
  • Successful Open/Close: Status must be exactly '00' .
  • Successful Read: Status must be '00' (Success) or '10' (End of File).
  • Abnormal Termination (ABEND): If any unexpected status code is encountered:
  • Format the error code:
  • If the status code starts with '9' (VSAM-specific error), extract the second byte, convert it to its binary value, and format it as a 4-digit string: 9NNN .
  • Otherwise, format it as 00XX (where XX is the 2-character status).
  • Log the error message to SYSPRINT : FILE STATUS IS: NNNN [status] .
  • Log the message ABENDING PROGRAM .
  • Trigger an immediate abnormal termination (ABEND) with error code 999 to halt the job stream and prevent subsequent steps from executing.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Dataset

"AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS" -> "STEP05" [label="STEP05"];

// Processing Step

"STEP05" [label="CBCUS01C STEP05"];

// Output Logs

"STEP05" -> "SYSOUT" [label="STEP05"];

"STEP05" -> "SYSPRINT" [label="STEP05"];

}

This process reads customer profile information from a primary VSAM dataset and outputs the records to system logs for reporting and inspection.

  • Customer Data Retrieval (STEP05) : The program CBCUS01C sequentially reads comprehensive customer profiles from the VSAM KSDS dataset AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS . This includes personal identification, contact details, and financial attributes.
  • Reporting and Logging : The retrieved customer profiles are written to the system logs ( SYSOUT and SYSPRINT ) for reporting and verification. The step includes error-handling to safely terminate in case of database access failures.

<h2

READXREF

This document provides a high-level functional summary of the mainframe JCL job designed to read and report card account cross-reference data.

MAT analysis

Job Functionality Summary: Card Account Cross-Reference Reporting

This document provides a high-level functional summary of the mainframe JCL job designed to read and report card account cross-reference data.

Business-Level Description

The primary business purpose of this JCL job is to execute an administrative and diagnostic batch utility ( CBACT03C ) that extracts and reports relationships between physical credit cards, customer profiles, and financial accounts.

In credit card processing systems, maintaining a clear link between these entities is essential. This job reads the master cross-reference data store to output mappings that link:

  • A 16-digit credit card number
  • A 9-digit customer ID
  • An 11-digit account ID

The resulting report is used by system administrators and business analysts for auditing, troubleshooting, and system reconciliation.

Input Files
  • XREFFILE ( AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS ) : An indexed VSAM Key-Sequenced Data Set (KSDS) containing the master card cross-reference records.
  • STEPLIB ( AWS.M2.CARDDEMO.LOADLIB ) : The partitioned dataset (load library) containing the compiled executable program CBACT03C .
Output Files
  • SYSOUT / SYSPRINT : Standard system output streams (spool files) where the program writes execution logs, diagnostic messages, and the formatted contents of the cross-reference records.
Detailed Description of Data Transformations

To support the reimplementation of this job in a modernized system, the following logic, data structures, and processing steps must be replicated:

1. Data Record Structure

Each record read from the input source contains the following fields:

  • Card Number : 16-character alphanumeric field (Primary Key).
  • Customer ID : 9-digit numeric field.
  • Account ID : 11-digit numeric field.
2. Execution Flow and Logic
  • Initialization :
  • Log a startup message: "START OF EXECUTION OF PROGRAM CBACT03C" .
  • Open the cross-reference data store in read-only ( INPUT ) mode.
  • Sequential Processing :
  • Read records sequentially from the beginning of the file to the end.
  • For each record successfully retrieved, write the Card Number, Customer ID, and Account ID to the standard output log.
  • Note on Legacy Behavior : The original COBOL program contains a redundant display routine that writes each record to the log twice. In a modernized implementation, this should be optimized to a single log entry per record to prevent unnecessary I/O overhead.
  • Termination :
  • Upon reaching the End-of-File (EOF), close the cross-reference data store.
  • Log a completion message: "END OF EXECUTION OF PROGRAM CBACT03C" .
  • Terminate the process normally.
3. Validation and Error Handling

The system must monitor technical I/O integrity during execution:

  • File Status Verification : Every file interaction (Open, Read, Close) must be validated.
  • Abnormal Termination (Abend) : If any file operation fails with an unexpected status (e.g., failure to open the file or an unexpected read error):
  • Log a specific error message indicating the failure point (e.g., "ERROR OPENING XREFFILE" or "ERROR READING XREFFILE" ).
  • Format and log the technical error status code.
  • Trigger an immediate abnormal termination (Abend) with an error code (legacy equivalent of 999 ) to prevent silent failures and alert operations.

<h2

REPTFILE

This document provides a high-level functional and technical summary of the provided mainframe JCL job step.

MAT analysis

JCL Job Functionality Summary

This document provides a high-level functional and technical summary of the provided mainframe JCL job step.

1. Business-Level Description

The primary business purpose of this job step is to establish a structured repository for transaction reports within the CardDemo application. It defines a Generation Data Group (GDG) named AWS.M2.CARDDEMO.TRANREPT in the mainframe catalog.

A GDG is a mechanism used to manage historical versions of a dataset. By defining this GDG with a limit of 10, the system is configured to automatically track and retain the 10 most recent generations of transaction reports (e.g., daily or run-by-run reports). This ensures that historical transaction data is preserved for operational auditing, reconciliation, and reporting, while older versions beyond the limit of 10 are automatically managed and retired.

Note on JCL Comments: The comment block in the JCL mentions "DELETE TRANSACATION MASTER VSAM FILE IF ONE ALREADY EXISTS". However, the actual executable code performs a DEFINE GENERATIONDATAGROUP action. The functional code takes precedence over the comment for modernization purposes.

2. Input Files

This job step does not read any physical input data files. It only consumes control statements passed via the input stream:

  • SYSIN (In-stream Control Card): Contains the control statement directing the IDCAMS utility to define the Generation Data Group.
3. Output Files

The execution of this job step results in the creation of system catalog entries and execution logs:

  • AWS.M2.CARDDEMO.TRANREPT (GDG Base): A new Generation Data Group base structure defined in the system catalog. This does not contain data itself but acts as the parent container for future generation datasets (e.g., AWS.M2.CARDDEMO.TRANREPT.G0001V00 ).
  • SYSPRINT: The system message and execution log dataset, which records the success or failure of the IDCAMS command.
4. Detailed Technical Actions and Transformation Rules

To successfully reimplement this job step in a modernized target environment, the following technical specifications must be met:

Utility Executed
  • Program: IDCAMS (IBM Access Method Services)
  • Function: DEFINE GENERATIONDATAGROUP
Parameters and Rules
  • GDG Name: AWS.M2.CARDDEMO.TRANREPT
  • Limit: 10 (Specifies that a maximum of 10 generation datasets can be associated with this GDG base at any one time).
Modernization Reimplementation Guidance

When migrating this functionality to a modern cloud or distributed environment (such as AWS):

  • Storage Structure: Create a logical folder, directory, or object storage prefix (e.g., an Amazon S3 bucket path: s3://your-bucket/aws/m2/carddemo/tranrept/ ).
  • Version Control / Retention Policy:
  • Implement an object versioning or lifecycle policy on the storage target.
  • Configure the policy to retain only the 10 most recent versions of the transaction report files.
  • Configure the system to automatically delete or archive versions older than the 10th most recent file to mimic the mainframe LIMIT(10) behavior.

<h2

TCATBALF

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the Transaction Category Balance VSAM file.

MAT analysis

JCL Job Functional Summary: Transaction Category Balance File Initialization and Load

This document provides a high-level functional summary of the mainframe JCL job designed to initialize and populate the Transaction Category Balance VSAM file.

Business-Level Description

The primary purpose of this JCL job is to reset and refresh the Transaction Category Balance data store within the CardDemo application.

In credit card processing systems, transaction category balances track financial totals categorized by specific transaction types (e.g., retail, cash advance, food, travel) for account maintenance and reporting. This job performs a clean initialization of this data store by:

  • Deleting any existing Transaction Category Balance VSAM (Virtual Storage Access Method) file to prevent data duplication or corruption.
  • Defining a new, empty Key Sequenced Data Set (KSDS) VSAM file with the required storage, key, and record length specifications.
  • Loading the newly defined VSAM file with baseline or updated transaction category balance records from a sequential flat file.
Input Files
  • AWS.M2.CARDDEMO.TCATBALF.PS
  • Format: Sequential Dataset (Flat File / Physical Sequential)
  • Description: Contains the source transaction category balance records to be loaded into the application database.
Output Files
  • AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS
  • Format: VSAM Key Sequenced Data Set (KSDS)
  • Description: The master Transaction Category Balance file used by online and batch programs in the CardDemo application.
Detailed Data Transformations and Step-by-Step Execution

The job utilizes the standard IBM utility IDCAMS (Access Method Services) across three sequential steps to perform the environment setup and data loading.

Step 1: STEP05 - Clean Up Existing VSAM File
  • Program: IDCAMS
  • Action: Deletes the existing VSAM cluster AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS .
  • Logic/Transformation:
  • Performs a DELETE command on the VSAM cluster.
  • Executes SET MAXCC = 0 immediately afterward. This ensures that if the VSAM file does not exist (such as during an initial system deployment), the step returns a condition code of 0 instead of failing, allowing the job to proceed to the definition step.
Step 2: STEP10 - Define VSAM KSDS Structure
  • Program: IDCAMS
  • Action: Defines the structure and allocation parameters for the new VSAM KSDS.
  • Technical Specifications for Reimplementation:
  • Cluster Name: AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS
  • Data Component Name: AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS.DATA
  • Index Component Name: AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS.INDEX
  • Allocation Space: 1 Cylinder Primary, 5 Cylinders Secondary ( CYLINDERS(1 5) )
  • Volume: AWSHJ1
  • Record Format: Indexed ( INDEXED )
  • Record Size: Fixed-length of 50 bytes ( RECORDSIZE(50 50) )
  • Key Definition: Key length of 17 bytes starting at offset 0 ( KEYS(17 0) )
  • Share Options: SHAREOPTIONS(2 3) (Allows multiple read accessors while one writer is active)
  • Erase Option: ERASE (Specifies that the storage occupied by the cluster is to be erased/overwritten with binary zeros when deleted)
Step 3: STEP15 - Populate VSAM File
  • Program: IDCAMS
  • Action: Copies data from the sequential input file to the newly defined VSAM KSDS.
  • Logic/Transformation:
  • Executes the REPRO command mapping the input DD TCATBAL ( AWS.M2.CARDDEMO.TCATBALF.PS ) to the output DD TCATBALV ( AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS ).
  • This is a 1:1 record copy. During this process, the VSAM Access Method automatically indexes each 50-byte record using the unique 17-byte key located at the beginning of each record (offset 0). The input sequential file must be sorted by this 17-byte key prior to this step to prevent out-of-sequence insertion errors during the REPRO operation.

<h2

TRANBKP

This document provides a high-level functional summary of the mainframe JCL job designed to manage and maintain the transaction master database for the CardDemo application.

MAT analysis

JCL Job Functionality Summary

This document provides a high-level functional summary of the mainframe JCL job designed to manage and maintain the transaction master database for the CardDemo application.

Business-Level Description

The primary purpose of this JCL job is to perform routine database maintenance and initialization for the transaction master file.

To ensure data integrity, the job first creates a secure sequential backup of the active transaction database. Once the backup is successfully created, the job deletes the existing transaction database (including its primary cluster and associated alternate index) and re-allocates a fresh, empty Key Sequenced Data Set (KSDS) with predefined storage, key, and security configurations. This process prepares the system for the next cycle of transaction processing while safeguarding historical data.

Input Files
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Type: VSAM Key Sequenced Data Set (KSDS)
  • Description: The active transaction master file containing current transaction records. This serves as the source for the backup step before it is deleted and recreated.
Output Files
  • AWS.M2.CARDDEMO.TRANSACT.BKUP
  • Type: Sequential Dataset
  • Description: The backup copy of the transaction master file, newly created and cataloged during this execution.
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Type: VSAM Key Sequenced Data Set (KSDS)
  • Description: The newly defined, empty transaction master database, initialized and ready to receive new transaction data.
Detailed Data Transformations and Operations

The job executes in three distinct phases: backup, deletion, and re-definition. Below is the technical logic required to reimplement this process in a target environment.

Step 1: Backup Phase ( STEP05R )
  • Utility/Process: Executes the REPROC procedure (typically utilizing the IDCAMS REPRO command under the hood).
  • Operation: Performs a direct record-for-record copy of the active VSAM KSDS ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ) to a new sequential backup file ( AWS.M2.CARDDEMO.TRANSACT.BKUP ).
  • Disposition: The backup file is allocated as (NEW, CATLG, DELETE) , meaning it is cataloged upon successful completion or deleted if the step fails.
Step 2: Cleanup Phase ( STEP05 )
  • Utility: IDCAMS
  • Operation 1: Deletes the primary VSAM KSDS cluster AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS .
  • Operation 2: Deletes the associated Alternate Index (AIX) AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX .
  • Condition Handling: If either delete command returns a warning code of 8 or less (e.g., if the files do not exist), the job resets the maximum condition code ( MAXCC ) to 0 to prevent the job from terminating prematurely.
Step 3: Initialization Phase ( STEP10 )
  • Utility: IDCAMS
  • Execution Condition: This step only executes if all previous steps completed successfully with a return code of 4 or less ( COND=(4,LT) ).
  • Operation: Defines a new, empty VSAM KSDS cluster with the following technical specifications:
  • Cluster Name: AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Data Component Name: AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS.DATA
  • Index Component Name: AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS.INDEX
  • Storage Allocation: 1 Cylinder primary, 5 Cylinders secondary.
  • Volume Serial: AWSHJ1
  • Key Structure: Key length of 16 bytes, starting at offset 0 (bytes 1 to 16).
  • Record Format: Fixed-length records of 350 bytes (minimum and maximum record size set to 350).
  • Share Options: (2 3) (Allows cross-region read/write sharing and cross-system read-only sharing).
  • Security/Erase Option: ERASE is enabled, ensuring that when this cluster is deleted in the future, its physical storage space is overwritten with binary zeros to protect sensitive transaction data.

<h2

TRANCATG

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to initialize and load the Transaction Category Type VSAM file for the CardDemo application.

MAT analysis

Job Summary: CardDemo Transaction Category VSAM Initialization and Load

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to initialize and load the Transaction Category Type VSAM file for the CardDemo application.

Business-Level Description

The primary purpose of this job is to set up and populate the reference data for transaction categories within the CardDemo application. Transaction categories are standard classifications used to group financial transactions (e.g., retail, food, travel, entertainment).

To ensure data consistency and prevent duplicate or stale records, the job performs a clean initialization. It deletes any existing transaction category VSAM file, defines a new Key Sequenced Data Set (KSDS) with the required structural parameters, and loads fresh reference data from a sequential flat file. This job is typically run during system deployment, environment refreshes, or batch maintenance windows.

Input Files
  • AWS.M2.CARDDEMO.TRANCATG.PS
  • Format: Sequential Dataset (Flat File / Physical Sequential)
  • Description: Contains the source transaction category reference data. Each record is expected to be formatted to match the 60-byte record structure required by the target VSAM file.
Output Files
  • AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS
  • Format: VSAM Key Sequenced Data Set (KSDS)
  • Description: The master reference file for transaction categories, indexed by a 6-byte key at the beginning of each record.
  • Associated Components:
  • Data Component: AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS.DATA
  • Index Component: AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS.INDEX
Detailed Data Transformations and Step Execution

The job consists of three sequential steps executed using the IBM utility program IDCAMS .

Step 05: Cleanup (DELETE)
  • Program: IDCAMS
  • Action: Deletes the existing VSAM cluster AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS .
  • Transformation Logic: This is a destructive step to clear existing data. The command includes SET MAXCC = 0 immediately after the delete command. This ensures that if the VSAM file does not exist (such as during the very first run in a new environment), the job ignores the "file not found" error (Return Code 8) and continues executing subsequent steps with a successful return code.
Step 10: Schema Definition (DEFINE CLUSTER)
  • Program: IDCAMS
  • Action: Allocates and defines the structure of the new VSAM KSDS.
  • Technical Specifications for Reimplementation:
  • Key Definition: KEYS(6 0) — The primary key is 6 bytes long, starting at offset 0 (the beginning of the record).
  • Record Size: RECORDSIZE(60 60) — Fixed-length records of exactly 60 bytes.
  • Space Allocation: CYLINDERS(1 5) — Allocates 1 cylinder initially, with secondary allocations of 5 cylinders as needed.
  • Volume: AWSHJ1 — Target storage volume.
  • Share Options: SHAREOPTIONS(2 3) — Allows multiple read-access users while restricting write-access to a single user.
Step 15: Data Loading (REPRO)
  • Program: IDCAMS
  • Action: Copies data from the sequential input file to the newly defined VSAM KSDS.
  • Transformation Logic: Performs a direct, byte-for-byte transfer ( REPRO ) of records from AWS.M2.CARDDEMO.TRANCATG.PS into AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS . Because the target is a KSDS, the utility automatically indexes the records based on the first 6 bytes of each input record. The input records must be sorted in ascending order by their key (bytes 1–6) to prevent out-of-sequence insertion errors during the load.
Reimplementation Guidance for Modern Systems

When migrating this functionality to a modern cloud or relational database environment (e.g., AWS RDS PostgreSQL, Aurora, or DynamoDB):

  • Target Table Structure: Create a table named TRANSACTION_CATEGORY (or equivalent).
  • Primary Key: A string/character column of length 6 (e.g., VARCHAR(6) or CHAR(6) ), mapped from the first 6 bytes of the legacy record.
  • Payload: The remaining 54 bytes of the record should be mapped to corresponding attributes (e.g., Category Name, Description, Active Status) based on the COBOL copybook layout associated with this file.
  • Migration Process (ETL):
  • Truncate/Drop: Equivalent to Step 05 and Step 10 , the target database table should be truncated or dropped/recreated to ensure a clean state.
  • Bulk Load: Equivalent to Step 15 , read the flat file, parse the 60-byte records according to the schema layout, and perform a bulk insert into the target database. Ensure the migration tool handles duplicate key constraints gracefully.

<h2

TRANEXTR

This document provides a high-level functional summary of the mainframe JCL job designed to back up existing transaction-related datasets and extract fresh, formatted data from Db2 database tables into sequential files.

MAT analysis

JCL Job Functionality Summary: Db2 Unload using DSNTIAUL Utility

This document provides a high-level functional summary of the mainframe JCL job designed to back up existing transaction-related datasets and extract fresh, formatted data from Db2 database tables into sequential files.

1. Business-Level Description

The primary business purpose of this batch job is to refresh the reference data for Transaction Types and Transaction Categories used within the CardDemo application.

To ensure data integrity and recoverability, the job first creates backup copies of the current sequential files containing this data. It then purges the active files and executes a Db2 unload utility ( DSNTIAUL ) to extract the latest records directly from the relational database. During the extraction process, the data is formatted, padded, and sorted according to specific business rules to ensure compatibility with downstream mainframe applications or migrated target systems.

2. Input Files and Sources
Database Tables (Db2)
  • CARDDEMO.TRANSACTION_TYPE : Contains definitions and descriptions of different transaction types.
  • CARDDEMO.TRANSACTION_TYPE_CATEGORY : Contains category classifications and associated data for transaction types.
Sequential Files (For Backup Steps)
  • AWS.M2.CARDDEMO.TRANTYPE.PS : The active sequential file containing the previous run's Transaction Type data.
  • AWS.M2.CARDDEMO.TRANCATG.PS : The active sequential file containing the previous run's Transaction Category data.
3. Output Files and Targets
Backup Files
  • AWS.M2.CARDDEMO.TRANTYPE.BKUP : Backup copy of the Transaction Type sequential file.
  • AWS.M2.CARDDEMO.TRANCATG.PS.BKUP : Backup copy of the Transaction Category sequential file.
Refreshed Active Files
  • AWS.M2.CARDDEMO.TRANTYPE.PS : Newly extracted and formatted Transaction Type sequential file.
  • AWS.M2.CARDDEMO.TRANCATG.PS : Newly extracted and formatted Transaction Category sequential file.
4. Step-by-Step Execution and Data Transformations
Step 10: Backup Transaction Type File ( STEP10 )
  • Program : IEBGENER
  • Function : Copies the existing active Transaction Type file ( AWS.M2.CARDDEMO.TRANTYPE.PS ) to a backup dataset ( AWS.M2.CARDDEMO.TRANTYPE.BKUP ).
Step 20: Backup Transaction Category File ( STEP20 )
  • Program : IEBGENER
  • Condition : Executes only if STEP10 completes successfully (Return Code = 0).
  • Function : Copies the existing active Transaction Category file ( AWS.M2.CARDDEMO.TRANCATG.PS ) to a backup dataset ( AWS.M2.CARDDEMO.TRANCATG.PS.BKUP ).
Step 30: Delete Active Files ( STEP30 )
  • Program : IEFBR14
  • Condition : Executes only if previous steps complete successfully (Return Code = 0).
  • Function : Deletes the active files AWS.M2.CARDDEMO.TRANTYPE.PS and AWS.M2.CARDDEMO.TRANCATG.PS to prevent duplicate record errors or catalog conflicts during the subsequent extraction steps.
Step 40: Extract and Format Transaction Type Data ( STEP40 )

Program : IKJEFT01 (running Db2 utility DSNTIAUL )

Condition : Executes only if previous steps complete successfully (Return Code = 0).

Target Output : AWS.M2.CARDDEMO.TRANTYPE.PS

Data Transformation Logic :

  • Extraction : Reads records from the CARDDEMO.TRANSACTION_TYPE table.
  • Concatenation & Formatting :
  • Extracts the TR_TYPE column.
  • Extracts the TR_DESCRIPTION column and casts/pads it to a fixed length of 50 characters ( CHAR(50) ).
  • Appends 8 trailing zeros ( '00000000' ) to the end of the record.
  • Casts the entire concatenated string into a single fixed-length record of 60 characters ( CHAR(60) ).
  • Sorting : Orders the output dataset by TR_TYPE in ascending order.

SQL Representation:

SELECT CAST(CONCAT(CONCAT(TR_TYPE, CAST(TR_DESCRIPTION AS CHAR(50))), REPEAT('0',8)) AS CHAR(60))

FROM CARDDEMO.TRANSACTION_TYPE

ORDER BY TR_TYPE;

Step 50: Extract and Format Transaction Category Data ( STEP50 )

Program : IKJEFT01 (running Db2 utility DSNTIAUL )

Condition : Executes only if the previous steps did not return a Return Code greater than 4 ( COND=(4,LT) ).

Target Output : AWS.M2.CARDDEMO.TRANCATG.PS

Data Transformation Logic :

  • Extraction : Reads records from the CARDDEMO.TRANSACTION_TYPE_CATEGORY table.
  • Concatenation & Formatting :
  • Extracts and concatenates TRC_TYPE_CODE and TRC_TYPE_CATEGORY .
  • Extracts the TRC_CAT_DATA column and casts/pads it to a fixed length of 50 characters ( CHAR(50) ).
  • Appends 4 trailing zeros ( '0000' ) to the end of the record.
  • Casts the entire concatenated string into a single fixed-length record of 60 characters ( CHAR(60) ).
  • Sorting : Orders the output dataset by TRC_TYPE_CODE and then TRC_TYPE_CATEGORY in ascending order.

SQL Representation:

SELECT CAST(TRC_TYPE_CODE || TRC_TYPE_CATEGORY || CAST(TRC_CAT_DATA AS CHAR(50)) || REPEAT('0',4) AS CHAR(60))

FROM CARDDEMO.TRANSACTION_TYPE_CATEGORY

ORDER BY TRC_TYPE_CODE, TRC_TYPE_CATEGORY;

<h2

TRANFILE

This mainframe JCL job is responsible for initializing and refreshing the Transaction Master database within the CardDemo application. It manages the transition of data from a batch environment to the online CICS (Customer Information Control System) transaction processing system.

MAT analysis

JCL Job Functional Summary: Transaction Master Database Initialization

Business-Level Description

This mainframe JCL job is responsible for initializing and refreshing the Transaction Master database within the CardDemo application. It manages the transition of data from a batch environment to the online CICS (Customer Information Control System) transaction processing system.

To prevent data corruption and file-locking conflicts, the job temporarily takes the online transaction files offline in the CICS region. It then deletes any existing transaction database files, defines a new VSAM Key-Sequenced Data Set (KSDS), and populates it with fresh daily transaction data from a sequential flat file. Additionally, it establishes an alternate index (AIX) based on the transaction timestamp to facilitate rapid, non-primary key lookups. Once the database is successfully loaded and indexed, the job restores online access by reopening the files within CICS.

Input Files
  • AWS.M2.CARDDEMO.DALYTRAN.PS.INIT : A sequential flat file (Physical Sequential) containing the initial or daily batch transaction records to be loaded into the master database.
Output Files
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS : The primary Transaction Master VSAM Key-Sequenced Data Set.
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX : The Alternate Index cluster associated with the Transaction Master VSAM.
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.PATH : The logical VSAM Path linking the Alternate Index to the base KSDS cluster.
Detailed Process Flow and Data Transformations

The job executes in eight distinct steps to perform the database refresh and maintain system availability.

1. CICS File Closure ( CLCIFIL )
  • Program : SDSF
  • Action : Issues system commands to the CICS region named CICSAWSA to close the online files.
  • Commands Executed :
  • /F CICSAWSA,'CEMT SET FIL(TRANSACT ) CLO' (Closes the base transaction file)
  • /F CICSAWSA,'CEMT SET FIL(CXACAIX ) CLO' (Closes the alternate index path file)
  • Purpose : Releases locks on the VSAM datasets so they can be safely deleted and redefined in subsequent steps.
2. Delete Existing VSAM Structures ( STEP05 )
  • Program : IDCAMS
  • Action : Deletes the existing VSAM KSDS cluster and its associated Alternate Index.
  • Logic :
  • Deletes AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS (Base Cluster).
  • Deletes AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX (Alternate Index).
  • Includes conditional logic ( IF MAXCC LE 08 THEN SET MAXCC = 0 ) to ensure that if the files do not exist (Return Code 8), the job resets the step return code to 0 and continues execution.
3. Define Base VSAM KSDS ( STEP10 )
  • Program : IDCAMS
  • Action : Allocates and defines the structure of the new Transaction Master VSAM KSDS.
  • Technical Specifications :
  • Dataset Name : AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Primary Key : Length of 16 bytes, starting at offset 0 ( KEYS(16 0) ).
  • Record Size : Fixed-length records of 350 bytes ( RECORDSIZE(350 350) ).
  • Space Allocation : 1 primary cylinder, 5 secondary cylinders.
4. Load Data into VSAM ( STEP15 )
  • Program : IDCAMS
  • Action : Performs a bulk data copy ( REPRO ) from the sequential input file to the newly defined VSAM KSDS.
  • Transformation : This is a direct 1:1 binary and character transfer of 350-byte records. No structural field manipulation is performed during this step.
5. Define Alternate Index ( STEP20 )
  • Program : IDCAMS
  • Action : Defines the structure of the Alternate Index (AIX) on the base transaction cluster.
  • Technical Specifications :
  • AIX Name : AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX
  • Relationship : Linked to base cluster AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS .
  • Alternate Key : Length of 26 bytes, starting at offset 304 ( KEYS(26 304) ). This key corresponds to the transaction processed timestamp.
  • Key Uniqueness : Defined as NONUNIQUEKEY , allowing multiple transactions to share the same timestamp.
  • Record Size : Fixed-length records of 350 bytes.
6. Define VSAM Path ( STEP25 )
  • Program : IDCAMS
  • Action : Defines the logical path required for applications to access the base cluster data via the alternate index.
  • Path Name : AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.PATH
  • Target Entry : AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX
7. Build Alternate Index ( STEP30 )
  • Program : IDCAMS
  • Action : Executes the BLDINDEX command to populate the Alternate Index.
  • Logic : Scans the base KSDS ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ), extracts the alternate key values (offset 304, length 26) along with their corresponding primary keys, and writes them to the AIX cluster ( AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX ).
8. CICS File Open ( OPCIFIL )
  • Program : SDSF
  • Action : Issues system commands to the CICS region CICSAWSA to reopen the files for online transaction processing.
  • Commands Executed :
  • /F CICSAWSA,'CEMT SET FIL(TRANSACT ) OPE'
  • /F CICSAWSA,'CEMT SET FIL(CXACAIX ) OPE'
Reimplementation Guidance for Target System (e.g., Cloud/Relational Database)

When migrating this functionality to a modern cloud architecture (such as AWS using a relational database like PostgreSQL or Aurora), the following mappings should be applied:

Database Table Creation :

  • Create a table named TRANSACT to replace the VSAM KSDS.
  • The table must accommodate a fixed or variable record structure totaling 350 bytes.
  • Define a Primary Key on the first 16 characters of the record (corresponding to KEYS(16 0) ).

Secondary Indexing :

  • Create a non-unique secondary index on the column/field starting at character position 305 (offset 304) with a length of 26 characters (corresponding to KEYS(26 304) ). This replaces the VSAM Alternate Index (AIX).

Data Migration / ETL :

  • The REPRO step ( STEP15 ) should be replaced by an ETL pipeline (e.g., AWS Glue, AWS Batch, or a Python/Java utility) that reads the sequential flat file, parses the 350-byte records, and performs a bulk insert into the target database table.

Concurrency and Lock Management :

  • The CICS Close/Open steps ( CLCIFIL and OPCIFIL ) are mainframe-specific mechanisms to handle file contention. In a modern relational database, these steps can be replaced by standard transactional controls, database schemas with row-level locking, or blue/green deployment strategies to ensure zero-downtime updates.

<h2

TRANIDX

This document provides a high-level functional summary of the mainframe JCL job designed to define and build an Alternate Index (AIX) on a VSAM Key Sequenced Data Set (KSDS).

MAT analysis

JCL Job Functionality Summary: Alternate Index Creation for Transaction Data

This document provides a high-level functional summary of the mainframe JCL job designed to define and build an Alternate Index (AIX) on a VSAM Key Sequenced Data Set (KSDS).

1. Business-Level Description

In credit card and financial transaction processing systems, transactions are typically stored and primary-keyed by a unique identifier (such as a Transaction ID). However, business operations, customer service representatives, and audit applications frequently need to query, sort, and retrieve transaction records using other criteria, such as the time the transaction was processed.

This JCL job automates the creation of a secondary search path—an Alternate Index (AIX) —on the transaction database. Specifically, it indexes the transaction records by their Processed Timestamp .

By establishing this alternate index and its associated logical path, downstream business applications can instantly query transaction history by timestamp without performing slow, resource-intensive full-table scans. It also ensures that any new or updated transactions automatically update this secondary index in real-time.

2. Input Files
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Type: VSAM Key Sequenced Data Set (Base Cluster)
  • Description: The primary transaction database containing the master transaction records.
3. Output Files (Created/Defined Artifacts)
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX
  • Type: VSAM Alternate Index Cluster
  • Description: The physical index structure containing the secondary keys (timestamps) mapped to the primary keys of the base cluster.
  • Associated Components:
  • Data Component: AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.DATA
  • Index Component: AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.INDEX
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.PATH
  • Type: VSAM Path
  • Description: A logical bridge that links the Alternate Index to the Base Cluster, allowing applications to access base records directly using the secondary key.
4. Detailed Description of Data Transformations and Operations

The job executes three sequential steps using the IBM utility IDCAMS (Access Method Services) to define, link, and populate the secondary index.

STEP20: Define Alternate Index (IDCAMS)
  • Operation: Allocates and defines the structure of the Alternate Index.
  • Key Specifications:
  • Keys (26 304): Defines the secondary key. The key length is 26 bytes , starting at offset 304 within the base transaction record (representing the Processed Timestamp).
  • NONUNIQUEKEY: Specifies that multiple transaction records can share the exact same timestamp.
  • UPGRADE: Configures the system to automatically update this alternate index whenever records in the base KSDS are inserted, updated, or deleted.
  • RECORDSIZE(350,350): Allocates a fixed record size of 350 bytes for the index records.
  • Space Allocation: Allocates 5 primary cylinders and 1 secondary cylinder on volume AWSHJ1 .
STEP25: Define Path (IDCAMS)
  • Operation: Establishes a logical relationship path named AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX.PATH .
  • Function: Associates the Alternate Index ( AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX ) back to the Base Cluster. This enables application programs (such as COBOL CICS programs) to read the base cluster records directly using the alternate key.
STEP30: Build Index (IDCAMS)
  • Operation: Populates the newly defined Alternate Index with actual data.
  • Function: Scans the base cluster ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ), extracts the 26-byte key from offset 304 of each record, pairs it with the primary key, and writes these index entries into the AIX cluster ( AWS.M2.CARDDEMO.TRANSACT.VSAM.AIX ).
5. Reimplementation Guidance for Target System

When migrating this functionality to a modern cloud or relational database environment (e.g., AWS Aurora PostgreSQL, MySQL, or DynamoDB), the entire three-step JCL process translates to creating a secondary index on a database table.

Relational Database (SQL) Target

If the base KSDS is migrated to a relational table named TRANSACT :

  • Identify the column mapped to the 26-byte character field at offset 304 (e.g., processed_timestamp ).
  • Create a non-unique secondary index on that column.

-- Equivalent to STEP20, STEP25, and STEP30

CREATE INDEX idx_transact_timestamp

ON transact (processed_timestamp);

NoSQL (AWS DynamoDB) Target

If the base KSDS is migrated to a DynamoDB table:

  • Define a Global Secondary Index (GSI) on the table.
  • Set the GSI Partition Key (and optionally Sort Key) to the attribute representing the processed_timestamp .
  • Project the necessary attributes (or all attributes) to mimic the VSAM Path behavior.

<h2

TRANREPT

This JCL job is a batch processing workflow within the CardDemo credit card management system. Its primary business purpose is to extract, filter, sort, and enrich credit card transaction data to generate a formatted Daily Transaction Report. This report is used for financial auditing, account reconciliation, and operational oversight by summarizing transaction activities within a specified date range.

MAT analysis

Job Function Summary: Daily Transaction Reporting and Reconciliation

This JCL job is a batch processing workflow within the CardDemo credit card management system. Its primary business purpose is to extract, filter, sort, and enrich credit card transaction data to generate a formatted Daily Transaction Report. This report is used for financial auditing, account reconciliation, and operational oversight by summarizing transaction activities within a specified date range.

Input Files
  • AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS : The primary transaction ledger containing raw transaction records in VSAM KSDS format.
  • AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS : An indexed VSAM cross-reference file used to map 16-digit card numbers to 11-digit customer account identifiers.
  • AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS : An indexed VSAM lookup file containing descriptions for transaction type codes.
  • AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS : An indexed VSAM lookup file containing descriptions for transaction category codes.
  • AWS.M2.CARDDEMO.DATEPARM : A sequential parameter file containing the start and end dates used by the reporting program to define the reporting window.
Output Files
  • AWS.M2.CARDDEMO.TRANSACT.BKUP : A sequential backup file containing the complete, unfiltered unload of the VSAM transaction ledger.
  • AWS.M2.CARDDEMO.TRANSACT.DALY : A temporary sequential file containing transaction records that have been filtered by date (between 2022-01-01 and 2022-07-06 ) and sorted ascending by card number.
  • AWS.M2.CARDDEMO.TRANREPT : The final formatted, multi-page Daily Transaction Report containing detailed transaction listings, account sub-totals, page totals, and grand totals.
Detailed Data Transformations

The job executes in three sequential steps to perform data extraction, sorting/filtering, and report generation.

Step 1: VSAM Unload ( STEP05R )

  • Source : AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS
  • Target : AWS.M2.CARDDEMO.TRANSACT.BKUP
  • Transformation : Performs a direct sequential copy (unload) of the active VSAM transaction ledger to a sequential backup dataset. No field-level modifications or filtering are performed in this step.

Step 2: Filter and Sort ( STEP05R2 )

  • Source : AWS.M2.CARDDEMO.TRANSACT.BKUP
  • Target : AWS.M2.CARDDEMO.TRANSACT.DALY
  • Transformation :
  • Filtering : Evaluates each transaction record. Only records where the transaction processing date ( TRAN-PROC-DT at position 305, length 10) is chronologically greater than or equal to '2022-01-01' and less than or equal to '2022-07-06' are retained.
  • Sorting : Sorts the filtered records in ascending order based on the 16-digit card number ( TRAN-CARD-NUM at position 263, length 16).

Step 3: Report Generation and Enrichment ( STEP10R calling CBTRN03C )

  • Source : AWS.M2.CARDDEMO.TRANSACT.DALY (and reference files)
  • Target : AWS.M2.CARDDEMO.TRANREPT
  • Transformation :
  • Parameter Initialization : Reads the start and end dates from AWS.M2.CARDDEMO.DATEPARM to establish the reporting window.
  • Sequential Processing : Reads the sorted transaction file sequentially.
  • Control Break Processing :
  • Tracks the current card number. When the card number changes, a control break is triggered.
  • The program writes the accumulated account sub-total ( WS-ACCOUNT-TOTAL ) to the report, resets the accumulator to zero, and writes a separator line.
  • Performs a random read on AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS using the new card number to retrieve the associated 11-digit Account ID ( XREF-ACCT-ID ).
  • Data Enrichment Lookups :
  • Transaction Type : Performs a random read on AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS using the transaction type code ( TRAN-TYPE-CD ) to retrieve the text description ( TRAN-TYPE-DESC ).
  • Transaction Category : Performs a random read on AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS using a composite key of transaction type code and transaction category code ( TRAN-TYPE-CD + TRAN-CAT-CD ) to retrieve the category description ( TRAN-CAT-TYPE-DESC ).
  • Pagination and Formatting :
  • Monitors line counts against a page limit of 20 detail lines.
  • When the limit is reached, writes the page total ( WS-PAGE-TOTAL ), adds it to the grand total ( WS-GRAND-TOTAL ), resets the page accumulator, and writes a new page header.
  • Financial Accumulation :
  • Adds each transaction amount ( TRAN-AMT ) to both the current page total and the current account total.
  • Finalization :
  • At End-of-File (EOF), writes the final account sub-total, the final page total, and the overall grand total ( WS-GRAND-TOTAL ) to the report.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Datasets

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" [label="AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS"];

"AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS"];

"AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS" [label="AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS"];

"AWS.M2.CARDDEMO.DATEPARM" [label="AWS.M2.CARDDEMO.DATEPARM"];

// Intermediate Datasets

"AWS.M2.CARDDEMO.TRANSACT.BKUP" [label="AWS.M2.CARDDEMO.TRANSACT.BKUP"];

"AWS.M2.CARDDEMO.TRANSACT.DALY" [label="AWS.M2.CARDDEMO.TRANSACT.DALY"];

// Output Datasets

"AWS.M2.CARDDEMO.TRANREPT" [label="AWS.M2.CARDDEMO.TRANREPT"];

// Steps

"STEP05R" [label="REPROC STEP05R"];

"STEP05R2" [label="SORT STEP05R2"];

"STEP10R" [label="CBTRN03C STEP10R"];

// Data Flow

"AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS" -> "STEP05R" [label="Unload"];

"STEP05R" -> "AWS.M2.CARDDEMO.TRANSACT.BKUP" [label="Backup"];

"AWS.M2.CARDDEMO.TRANSACT.BKUP" -> "STEP05R2" [label="Sort and Filter"];

"STEP05R2" -> "AWS.M2.CARDDEMO.TRANSACT.DALY" [label="Daily Transactions"];

"AWS.M2.CARDDEMO.TRANSACT.DALY" -> "STEP10R" [label="Read"];

"AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS" -> "STEP10R" [label="Lookup"];

"AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS" -> "STEP10R" [label="Lookup"];

"AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS" -> "STEP10R" [label="Lookup"];

"AWS.M2.CARDDEMO.DATEPARM" -> "STEP10R" [label="Date Parameters"];

"STEP10R" -> "AWS.M2.CARDDEMO.TRANREPT" [label="Generate Report"];

}

This JCL job unloads, filters, and processes transaction data to generate a formatted financial report.

Unload Step (STEP05R) : Unloads the master transaction VSAM KSDS dataset ( AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS ) into a sequential backup dataset ( AWS.M2.CARDDEMO.TRANSACT.BKUP ) using a REPROC utility.

Filter and Sort Step (STEP05R2) : Reads the backup dataset, filters records to include only those within the date range of 2022-01-01 to 2022-07-06 , and sorts them in ascending order by card number ( TRAN-CARD-NUM ). The output is saved to a daily transaction dataset ( AWS.M2.CARDDEMO.TRANSACT.DALY ).

Report Generation Step (STEP10R) : Executes the batch program CBTRN03C to process the daily transactions. It enriches the transaction data by performing lookups against card cross-reference, transaction type, and transaction category VSAM datasets, applies date parameters, and generates a structured, formatted transaction report ( AWS.M2.CARDDEMO.TRANREPT ).

<h2

TRANTYPE

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to initialize and load the Transaction Type reference data.

MAT analysis

JCL Job Functionality Summary: Transaction Type VSAM Initialization and Load

This document provides a high-level functional summary and technical specifications for the mainframe JCL job designed to initialize and load the Transaction Type reference data.

Business-Level Description

This JCL job is a utility process responsible for initializing and populating the Transaction Type reference data store within the CardDemo application. Transaction types are standard codes used to categorize financial activities (such as purchases, cash advances, deposits, or reversals).

To ensure data consistency and prevent duplicate or stale records, the job performs a clean reset of the data store. It deletes any existing Transaction Type database file, defines a fresh, empty indexed structure, and loads it with up-to-date reference data from a master sequential flat file. This job is typically run during system setup, environment provisioning, or reference data synchronization cycles.

Input Files
  • AWS.M2.CARDDEMO.TRANTYPE.PS
  • Format: Physical Sequential (PS) flat file.
  • Description: The master source file containing the raw transaction type reference records.
Output Files
  • AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS
  • Format: VSAM Key-Sequenced Data Set (KSDS).
  • Description: The target indexed file used by online (CICS) and batch applications to perform fast lookups of transaction type codes.
Detailed Step-by-Step Execution and Data Transformations

The job consists of three sequential steps executed using the system utility IDCAMS (Access Method Services):

Step 1: STEP05 - Environment Cleanup (Delete)
  • Utility: IDCAMS
  • Action: Deletes the existing VSAM cluster AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS if it exists.
  • Logic/Transformation:
  • Performs a DELETE command on the cluster.
  • Executes SET MAXCC = 0 immediately afterward. This ensures that if the file does not exist (e.g., during the very first run), the job step returns a successful condition code (0) instead of failing, allowing subsequent steps to execute.
Step 2: STEP10 - Target Schema Definition (Define)
  • Utility: IDCAMS
  • Action: Defines the structure and allocation parameters for the new VSAM KSDS.
  • Technical Specifications:
  • Cluster Name: AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS
  • Data Component Name: AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS.DATA
  • Index Component Name: AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS.INDEX
  • Key Definition: KEYS(2 0) — The primary key is 2 bytes long, starting at offset 0 (the beginning of the record). This represents the Transaction Type Code.
  • Record Size: RECORDSIZE(60 60) — Fixed-length records of exactly 60 bytes.
  • Space Allocation: CYLINDERS(1 5) — Allocates 1 primary cylinder and 5 secondary cylinders.
  • Volume: AWSHJ1
  • Share Options: SHAREOPTIONS(1 4) — Allows one write or multiple read access.
Step 3: STEP15 - Data Loading (REPRO)
  • Utility: IDCAMS
  • Action: Copies data from the sequential input file to the newly defined VSAM KSDS.
  • Logic/Transformation:
  • Executes the REPRO command mapping the input DD TRANTYPE ( AWS.M2.CARDDEMO.TRANTYPE.PS ) to the output DD TTYPVSAM ( AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS ).
  • Records are read sequentially from the flat file and inserted into the VSAM KSDS. The system automatically indexes the records based on the 2-byte key at the beginning of each 60-byte record.
Reimplementation Guidance for Target System

When migrating this functionality to a modern cloud or distributed environment (e.g., AWS, relational database, or NoSQL store), use the following specifications:

Target Storage (e.g., Relational Database Table):

  • Create a table named TRANTYPE (or equivalent).
  • Primary Key: Define a primary key column (e.g., TRANTYPE_CODE ) of type CHAR(2) or VARCHAR(2) .
  • Data Payload: Define columns to hold the remaining 58 bytes of the record. If the layout of the 60-byte record is known, map those bytes to specific columns (e.g., TRANTYPE_DESC CHAR(30) , etc.). If the layout is generic, a single payload column of CHAR(58) can be used.

Execution Logic (Equivalent to JCL Steps):

  • Step 1 (Cleanup): Execute a TRUNCATE TABLE TRANTYPE or DROP TABLE IF EXISTS TRANTYPE statement to clear existing data.
  • Step 2 (Define): If using a relational database, ensure the table schema is defined with the primary key constraint on the first 2 characters.
  • Step 3 (Load): Read the sequential file AWS.M2.CARDDEMO.TRANTYPE.PS line-by-line. For each 60-character line:
  • Extract characters 1–2 as the Primary Key.
  • Extract characters 3–60 as the record payload.
  • Perform an INSERT or bulk load operation into the target database table. Ensure the migration process handles potential duplicate keys gracefully if the source file is not pre-sorted or validated.

<h2

TXT2PDF1

This document provides a high-level functional summary of the mainframe JCL job designed to convert plain text statement files into PDF format.

MAT analysis

JCL Job Functionality Summary: Text to PDF Conversion

This document provides a high-level functional summary of the mainframe JCL job designed to convert plain text statement files into PDF format.

1. Business-Level Description

The primary business purpose of this JCL job is to automate the transformation of raw, text-based customer account statements into standard PDF (Portable Document Format) files.

In a mainframe environment (specifically within the CardDemo application context), reports and statements are typically generated as plain text files with specific formatting or carriage control characters. This job acts as a post-processing utility that converts these legacy text reports into a modern, universally readable PDF format. This enables digital archiving, electronic distribution (e.g., via email), and integration with customer-facing web portals.

2. Input Files

The job utilizes the following input resources:

  • INDD DD Statement ( AWS.M2.CARDDEMO.STATEMNT.PS ) : A physical sequential (PS) dataset containing the raw text of the customer statements.
  • SYSEXEC DD Statement ( AWS.M2.LBD.TXT2PDF.EXEC ) : The system library containing the REXX executable script ( TXT2PDF ) that orchestrates the conversion process.
  • STEPLIB DD Statement ( AWS.M2.LBD.TXT2PDF.LOAD ) : The load library containing any compiled helper modules or load modules required by the conversion utility.
  • SYSTSIN : An in-stream control card containing the TSO command and parameters passed to the conversion utility.
3. Output Files

The job produces the following output resources:

  • AWS.M2.CARDDEMO.STATEMNT.PS.PDF : The final formatted PDF document containing the converted statement data.
  • SYSPRINT / SYSTSPRT : System output streams that capture execution logs, processing statistics, and any error messages generated during the run.
4. Detailed Data Transformations and Reimplementation Logic

To successfully replicate or migrate this job to a modern cloud architecture (such as AWS), the following transformation logic and parameters must be implemented:

Execution Flow
  • Environment Initialization : The job executes the TSO/E Terminal Monitor Program ( IKJEFT1B ), which establishes a batch TSO environment.
  • Script Invocation : The REXX script %TXT2PDF is invoked with specific arguments passed via the SYSTSIN input stream:

%TXT2PDF BROWSE Y IN DD:INDD OUT 'AWS.M2.CARDDEMO.STATEMNT.PS.PDF'

  • Parameter Parsing :
  • BROWSE Y : Instructs the utility to format the PDF in a manner optimized for viewing/browsing.
  • IN DD:INDD : Specifies the input source DD.
  • OUT '...' : Specifies the target output dataset name.
Data Transformation Logic (for Reimplementation)

To rewrite this utility in a modern programming language (such as Python, Java, or C#), the new application must perform the following steps:

  • Read Input Text : Read the input text file line-by-line.
  • Handle Carriage Control / Page Breaks :
  • Mainframe text reports often use ASA or machine carriage control characters in the first column of each record (e.g., 1 for page break, for single space, 0 for double space, - for triple space).
  • The conversion logic must parse these characters to determine page boundaries and vertical line positioning in the target PDF.
  • Font and Layout Mapping :
  • To preserve the tabular alignment of the original mainframe report, the PDF generator must use a monospaced font (such as Courier or Courier New ).
  • Standard page margins and font sizes (typically 8pt to 10pt for 132-character wide reports) must be applied to prevent text clipping.
  • PDF Generation :
  • Construct the PDF document structure (including Catalog, Pages, Page Content Streams, and Cross-Reference tables).
  • Write the parsed text lines into the PDF content stream at the calculated coordinates.
  • Target Technologies :
  • Python : Can be implemented using libraries such as reportlab or fpdf2 .
  • Java : Can be implemented using Apache PDFBox or iText .
  • AWS Native : Can be packaged as an AWS Lambda function triggered by an Amazon S3 upload event when a new text statement is generated.

<h2

UNLDGSAM

This JCL job executes a batch utility designed to extract and archive pending credit card authorization data from an active hierarchical IMS database. Its primary business purpose is to offload pending transaction summaries and their associated detailed records into sequential flat files. This process supports downstream financial reporting, auditing, and data warehousing, while helping to maintain optimal performance in the primary transactional database.

MAT analysis

Job Summary: Pending Authorization Data Extraction and Archiving

This JCL job executes a batch utility designed to extract and archive pending credit card authorization data from an active hierarchical IMS database. Its primary business purpose is to offload pending transaction summaries and their associated detailed records into sequential flat files. This process supports downstream financial reporting, auditing, and data warehousing, while helping to maintain optimal performance in the primary transactional database.

Input Files
  • IMS Database Data Sets :
  • DDPAUTP0 ( OEM.IMS.IMSP.PAUTHDB ) : The primary database data set containing the active hierarchical pending authorization data.
  • DDPAUTX0 ( OEM.IMS.IMSP.PAUTHDBX ) : The index database data set associated with the pending authorization database.
  • System Configuration :
  • DFSVSAMP ( OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) ) : Contains the IMS buffer pool parameters required for database access optimization.
Output Files
  • Sequential GSAM Files :
  • PASFILOP ( AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM ) : The primary sequential output file containing the extracted parent Pending Authorization Summary records.
  • PADFILOP ( AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM ) : The secondary sequential output file containing the extracted child Pending Authorization Detail records.
  • System and Diagnostic Logs :
  • SYSPRINT : Standard system output for execution logs, startup messages, and processing statistics.
  • SYSUDUMP : System dump output used for debugging in the event of an abnormal termination.
  • IMSERR : Dedicated error log for capturing IMS-specific diagnostic messages.
Detailed Data Transformations and Processing Logic

The job executes the IMS batch program DBUNLDGS using the IMS batch region controller ( DFSRRC00 ). The program processes data structured in a parent-child hierarchy and performs the following operations:

1. Initialization and Setup
  • The program establishes connection with the IMS database using the PSB DLIGSAMP .
  • It captures the current system date and Julian date for logging and audit trail purposes.
2. Parent Segment Processing (Pending Authorization Summary)
  • The program sequentially scans the database for parent segments ( PAUTSUM0 ) using Get Next ( GN ) calls.
  • Validation : For each parent segment retrieved, the program verifies that the primary account identifier ( PA-ACCT-ID ) is strictly numeric.
  • Action :
  • If the key is valid, the parent record is written directly to the parent GSAM sequential file ( PASFILOP ) using an Insert ( ISRT ) call.
  • If the key is non-numeric, the entire hierarchical branch (the parent and all its associated children) is bypassed.
3. Child Segment Processing (Pending Authorization Details)
  • For every valid parent segment processed, the program enters a nested loop to retrieve all corresponding child segments ( PAUTDTL1 ) using Get Next within Parent ( GNP ) calls. This restricts the search strictly to the children of the currently positioned parent.
  • Action : Each retrieved child segment is written directly to the child GSAM sequential file ( PADFILOP ) using an Insert ( ISRT ) call, preserving the relational link between the summary and detail levels.
  • Loop Termination : The child retrieval loop continues until the IMS status code returns 'GE' , indicating that no more child segments exist for the current parent.
4. Database Termination
  • The sequential scan of the parent database continues until the IMS status code returns 'GB' , signaling the end of the database.
  • The program then logs processing statistics (such as total records processed) and terminates normally.
5. Exception and Error Handling
  • I/O and Database Failures : If any IMS database retrieval ( GN , GNP ) or GSAM file write ( ISRT ) returns an unexpected status code (any code other than spaces, 'GE' , or 'GB' ), the program immediately branches to an abend routine.
  • Diagnostics : Before terminating, the program writes diagnostic details to the system display, including:
  • The paragraph name where the failure occurred.
  • The failing IMS status code.
  • The contents of the Key Feedback Area to identify the problematic database record.
  • Job Failure Trigger : The program sets the system RETURN-CODE register to 16 and executes a GOBACK . This ensures the JCL step fails, preventing downstream jobs from running with incomplete or corrupted data.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Input Nodes

"OEM.IMS.IMSP.PAUTHDB" [label="OEM.IMS.IMSP.PAUTHDB"];

"OEM.IMS.IMSP.PAUTHDBX" [label="OEM.IMS.IMSP.PAUTHDBX"];

// Process Node

"DLIGSAMP_STEP01" [label="DLIGSAMP STEP01"];

// Output Nodes

"AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM" [label="AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM"];

"AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM" [label="AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM"];

// Flow

"OEM.IMS.IMSP.PAUTHDB" -> "DLIGSAMP_STEP01" [label="Read Parent DB"];

"OEM.IMS.IMSP.PAUTHDBX" -> "DLIGSAMP_STEP01" [label="Read Index"];

"DLIGSAMP_STEP01" -> "AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM" [label="Write Parent GSAM"];

"DLIGSAMP_STEP01" -> "AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM" [label="Write Child GSAM"];

}

This JCL job executes an IMS batch utility to extract and archive hierarchical credit card authorization data.

  • Database Scanning and Extraction (STEP01) : The program DLIGSAMP (executed via the IMS region controller DFSRRC00 ) reads pending authorization summary records from the parent database ( OEM.IMS.IMSP.PAUTHDB ) and its index ( OEM.IMS.IMSP.PAUTHDBX ).
  • Validation and Archiving :
  • Validated parent summary records containing high-level account information are written to the primary sequential GSAM archive ( AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM ).
  • Corresponding detailed transaction child records (such as timestamps, merchant details, and amounts) are extracted and written to the secondary sequential GSAM archive ( AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM ), preserving the relational hierarchy.
  • Any invalid account structures are bypassed, and processing errors trigger diagnostic logging and abnormal termination to ensure data integrity.

<h2

UNLDPADB

This document provides a high-level functional summary of the mainframe JCL job designed to unload pending credit card authorization data from an IMS hierarchical database into sequential flat files.

MAT analysis

JCL Job Functionality Summary

This document provides a high-level functional summary of the mainframe JCL job designed to unload pending credit card authorization data from an IMS hierarchical database into sequential flat files.

Business-Level Description

The primary purpose of this job is to extract pending credit card authorization data from an active IMS hierarchical database and write it to flat sequential files. This process is critical for downstream reporting, archiving, data migration, or integration with relational database systems.

The job operates in two steps:

  • Housekeeping (STEP0) : Ensures a clean execution environment by deleting any pre-existing versions of the output sequential files.
  • Database Extraction (STEP01) : Executes an IMS batch region controller ( DFSRRC00 ) to run the specialized database extraction utility program PAUDBUNL . This program extracts high-level financial metrics (such as credit limits, balances, and transaction counts) from the root database segments, and detailed transaction-level data (such as card numbers, transaction amounts, and merchant details) from the associated child segments.
Input Files

The job utilizes the following input files and databases:

| DD Name | Dataset Name | Description |

| :--- | :--- | :--- |

| DDPAUTP0 | OEM.IMS.IMSP.PAUTHDB | Primary IMS database dataset containing the pending authorization data. |

| DDPAUTX0 | OEM.IMS.IMSP.PAUTHDBX | Index database dataset associated with the pending authorization database. |

| IMS | OEM.IMS.IMSP.PSBLIB

OEM.IMS.IMSP.DBDLIB | IMS Program Specification Block (PSB) and Database Description (DBD) libraries defining the database structure and access rules. |

| DFSVSAMP | OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) | IMS VSAM/OSAM buffer pool parameters required for database access performance tuning. |

| STEPLIB | AWS.M2.CARDDEMO.LOADLIB

OEMA.IMS.IMSP.SDFSRESL

OEMA.IMS.IMSP.SDFSRESL.V151 | Load libraries containing the application executable ( PAUDBUNL ) and IMS system modules. |

Output Files

The job produces the following output files:

| DD Name | Dataset Name | Disposition | Description |

| :--- | :--- | :--- | :--- |

| OUTFIL1 | AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO | (NEW, CATLG, DELETE) | Sequential flat file containing the extracted root segment data (Pending Authorization Summaries). |

| OUTFIL2 | AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO | (NEW, CATLG, DELETE) | Sequential flat file containing composite records of parent keys and child segment data (Pending Authorization Details). |

Note: In STEP0 , both of these datasets are referenced with a disposition of (OLD, DELETE, DELETE) to purge existing files before the extraction step begins.

Detailed Data Transformations and Logic

To support the reimplementation of this job in a new system, the following detailed data processing and transformation rules must be applied:

1. Hierarchical Database Extraction Logic

The extraction process mimics the hierarchical structure of the IMS database, which consists of a Root Segment ( PAUTSUM0 ) and a Child Segment ( PAUTDTL1 ).

Root Segment Processing ( PAUTSUM0 ) :

  • The system must sequentially scan the database to retrieve each Pending Authorization Summary root segment.
  • Validation : For each root segment retrieved, the system must validate that the Account Identifier ( PA-ACCT-ID ) is numeric.
  • If PA-ACCT-ID is numeric , the record is processed, written to the root output file, and its associated child segments are retrieved.
  • If PA-ACCT-ID is non-numeric , the root record is skipped, and none of its associated child segments are processed.

Child Segment Processing ( PAUTDTL1 ) :

  • For every valid root segment, the system must perform a nested loop to retrieve all associated child segments (Pending Authorization Details) belonging to that specific parent root.
  • The loop terminates when no more child segments exist under the current parent.
2. Data Mapping and Output Record Formats

Output File 1 ( OUTFIL1 / OPFILE1 )

This file receives the raw data from the valid root segments.

  • Record Length : 100 bytes (Flat Record).
  • Source Data : PENDING-AUTH-SUMMARY (Root Segment PAUTSUM0 ).
  • Key Fields Extracted :
  • PA-ACCT-ID (Packed Decimal, S9(11) COMP-3 ): Primary Account Identifier.
  • PA-CUST-ID (Numeric, 9(09) ): Customer Identifier.
  • PA-AUTH-STATUS (Alphanumeric, X(01) ): Authorization Status.
  • Financial metrics including Credit Limit, Cash Limit, Credit Balance, and Cash Balance (Packed Decimals, S9(09)V99 COMP-3 ).

Output File 2 ( OUTFIL2 / OPFILE2 )

This file receives composite records that maintain the relational integrity between the parent root and the child details.

  • Record Length : 206 bytes.
  • Structure :
  • Parent Key Prefix (Bytes 1–6) : The parent Account Identifier ( PA-ACCT-ID ) extracted from the current root segment, stored as a Packed Decimal ( S9(11) COMP-3 ).
  • Child Segment Data (Bytes 7–206) : The raw 200-byte child segment ( PENDING-AUTH-DETAILS / PAUTDTL1 ).
  • Child Fields Extracted :
  • PA-CARD-NUM (Alphanumeric, X(16) ): Card Number.
  • PA-TRANSACTION-AMT (Packed Decimal, S9(10)V99 COMP-3 ): Transaction Amount.
  • PA-APPROVED-AMT (Packed Decimal, S9(10)V99 COMP-3 ): Approved Amount.
  • PA-MATCH-STATUS (Alphanumeric, X(01) ): Match status flag (e.g., Pending, Declined, Expired, Matched).
  • Merchant details (ID, Name, City, State, Zip) and Transaction ID.
3. Error Handling and Operational Rules
  • File Status Checks : The system must validate the file status immediately after opening and closing OUTFIL1 and OUTFIL2 . Any status other than success ( 00 or spaces) must trigger an abnormal termination.
  • Database Status Codes :
  • During root retrieval, status code GB indicates the end of the database (normal termination of the main loop).
  • During child retrieval, status code GE indicates no more child segments exist under the current parent (normal termination of the inner loop).
  • Any other database status code (e.g., database unavailable) must result in an immediate program termination.
  • Abnormal Termination (ABEND) : In the event of any file I/O or database access failure, the job must terminate with a return code of 16 to signal a critical failure to the scheduling environment.

Data Flow Journey

digraph G {

graph [bgcolor="transparent", rankdir=LR];

node [

shape=box,

style="filled,rounded",

fontname="Roboto",

fontsize=12,

margin="0.2,0.1",

penwidth=1.0

];

edge [

arrowsize=0.8,

penwidth=1.5,

fontname="Roboto",

fontsize=12

];

// Step Nodes

"STEP0" [label="STEP0"];

"STEP01" [label="STEP01"];

// Dataset Nodes

"OEM.IMS.IMSP.PAUTHDB";

"OEM.IMS.IMSP.PAUTHDBX";

"OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB)";

"AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO";

"AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO";

// STEP0 - Cleanup Flow

"STEP0" -> "AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO" [label="STEP0"];

"STEP0" -> "AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO" [label="STEP0"];

// STEP01 - Extraction Flow

"OEM.IMS.IMSP.PAUTHDB" -> "STEP01" [label="STEP01"];

"OEM.IMS.IMSP.PAUTHDBX" -> "STEP01" [label="STEP01"];

"OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB)" -> "STEP01" [label="STEP01"];

"STEP01" -> "AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO" [label="STEP01"];

"STEP01" -> "AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO" [label="STEP01"];

}

This JCL job manages the lifecycle and extraction of CardDemo authorization data from an IMS database.

Cleanup Phase (STEP0) :

  • The job utilizes the IEFBR14 utility to delete existing root and child authorization datasets ( AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO and AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO ). This ensures a clean state and prevents data redundancy.

Database Extraction Phase (STEP01) :

  • The job executes the IMS database utility DFSRRC00 to extract pending authorization data hierarchically.
  • It reads from the primary database ( OEM.IMS.IMSP.PAUTHDB ), its index ( OEM.IMS.IMSP.PAUTHDBX ), and the VSAM buffer pool configuration ( OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) ).
  • High-level summary records are validated and written to the root output dataset ( AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO ).
  • Detailed transaction records are formatted with their parent account identifiers and written to the child output dataset ( AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO ), preserving the relational hierarchy.

<h2

WAITSTEP

This JCL job is a utility process designed to introduce a controlled, temporary pause (delay) in the batch execution flow. In enterprise batch environments, such delays are critical for synchronizing sequential job steps, coordinating interdependent processes across different systems, or throttling execution to prevent resource contention and manage system workload.

MAT analysis

JCL Job Functional Summary

Business-Level Description

This JCL job is a utility process designed to introduce a controlled, temporary pause (delay) in the batch execution flow. In enterprise batch environments, such delays are critical for synchronizing sequential job steps, coordinating interdependent processes across different systems, or throttling execution to prevent resource contention and manage system workload.

In this specific execution, the job is configured to suspend processing for exactly 36 seconds (3,600 centiseconds) before completing and allowing any subsequent steps or dependent jobs to proceed.

Input Files
  • SYSIN (In-stream Data) :
  • Format : Sequential text.
  • Description : Provides the control parameter specifying the wait duration. In this job, the input is the string 00003600 , which represents the wait time in centiseconds (1/100ths of a second).
Output Files
  • SYSOUT (System Output) :
  • Format : System spool/log.
  • Description : Receives standard system messages, execution logs, and any diagnostic output. No physical business data files are created or modified by this job.
Detailed Description of Data Transformations and Logic

To successfully reimplement this job in a modern target system, the following technical logic and behavioral rules must be applied:

1. Parameter Extraction
  • Source : The first 8 characters of the SYSIN stream.
  • Value in JCL : 00003600
  • Parsing Rule : Read the 8-character alphanumeric string and strip any trailing comments or spaces on the input line.
2. Unit Conversion and Calculation
  • Source Unit : Centiseconds (1/100th of a second).
  • Target Unit Calculation :

$$\text{Seconds} = \frac{\text{Input Value}}{100}$$

$$\text{Milliseconds} = \text{Input Value} \times 10$$

  • Example : 00003600 centiseconds converts to 36 seconds (or 36,000 milliseconds).
3. Execution Suspension (Wait Logic)
  • Mainframe Mechanism : The program COBSWAIT converts the alphanumeric input to a binary numeric format ( COMP ) and invokes the low-level system utility MVSWAIT to yield CPU cycles and pause the thread.
  • Reimplementation Guidance :
  • In a modern environment (e.g., Java, C#, Python, or AWS Mainframe Modernization), this should be implemented using non-blocking or standard thread sleep utilities rather than busy-waiting, to avoid unnecessary CPU consumption.
  • Java Equivalent : Thread.sleep(36000);
  • Python Equivalent : time.sleep(36)
  • C# Equivalent : Thread.Sleep(36000);
4. Error and Exception Handling
  • Numeric Validation : The original COBOL program lacks validation and will ABEND (S0C7) if non-numeric characters are passed in the first 8 positions of SYSIN . A robust modern implementation should validate that the input is a valid integer before attempting the sleep operation.
  • Boundary Limits : Implement safety limits to prevent excessively long sleep times (e.g., capping the maximum wait time to prevent thread starvation or hung containers).

<h2

XREFFILE

This JCL job initializes, populates, and indexes the Card Cross-Reference (CARDXREF) database for the CardDemo application. In a credit card processing system, cross-reference tables are critical for mapping card numbers to their corresponding customer accounts.

MAT analysis

JCL Job Functionality Summary: Card Cross-Reference (CARDXREF) Initialization and Load

Business-Level Description

This JCL job initializes, populates, and indexes the Card Cross-Reference (CARDXREF) database for the CardDemo application. In a credit card processing system, cross-reference tables are critical for mapping card numbers to their corresponding customer accounts.

The job performs a clean setup by deleting any existing database files, defining a new Key-Sequenced Data Set (KSDS), loading raw sequential card data into this new database, and establishing an Alternate Index (AIX). This alternate index allows downstream business applications to query card information efficiently using either the primary card number or the associated account identifier.

Input Files
  • AWS.M2.CARDDEMO.CARDXREF.PS : A Physical Sequential (PS) flat file containing the source card cross-reference records to be loaded into the database.
Output Files
  • AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS : The primary VSAM Key-Sequenced Data Set containing the loaded cross-reference records.
  • AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX : The VSAM Alternate Index cluster built on top of the base KSDS.
  • AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH : The logical VSAM Path that links the Alternate Index to the base KSDS, enabling applications to query the base data using the alternate key.
Detailed Technical Steps and Data Transformations

This job is executed entirely using the IBM utility IDCAMS across six sequential steps. To reimplement this functionality in a modern target system (such as a relational database or a NoSQL key-value store), the following logic must be replicated:

1. Environment Cleanup (STEP05)
  • Action : Deletes any existing instances of the base VSAM cluster ( AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS ) and the Alternate Index ( AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX ).
  • Error Handling : If the files do not exist (Return Code/MAXCC <= 8), the job resets the condition code to 0 to prevent the job from terminating prematurely.
  • Target Reimplementation : Perform a "DROP TABLE IF EXISTS" or equivalent operation on the target database tables and indexes.
2. Base Database Definition (STEP10)
  • Action : Defines the structure of the primary Key-Sequenced Data Set.
  • Key Specifications :
  • Record Size : Fixed-length records of 50 bytes ( RECORDSIZE(50 50) ).
  • Primary Key : 16 bytes long, starting at offset 0 ( KEYS(16 0) ). This represents the Card Number.
  • Target Reimplementation : Create a table with a primary key column of length 16 (e.g., VARCHAR(16) or CHAR(16) ) and a total payload size of 50 bytes.
3. Data Loading (STEP15)
  • Action : Copies the raw sequential data from the input flat file ( AWS.M2.CARDDEMO.CARDXREF.PS ) into the newly defined VSAM KSDS using the REPRO command.
  • Transformation : Direct 1-to-1 byte transfer of the 50-byte records. No data manipulation or character conversion is performed during this step.
  • Target Reimplementation : Execute a bulk load or insert operation to migrate the flat-file records into the target database table.
4. Alternate Index Definition (STEP20)
  • Action : Defines the structure of the secondary index to allow lookups by Account ID.
  • Key Specifications :
  • Alternate Key : 11 bytes long, starting at offset 25 of the 50-byte record ( KEYS(11,25) ). This represents the Account ID.
  • Key Uniqueness : Non-unique ( NONUNIQUEKEY ), meaning multiple card numbers can map to a single account ID.
  • Maintenance : Set to auto-upgrade ( UPGRADE ), ensuring that any future inserts, updates, or deletes on the base dataset automatically update this index.
  • Target Reimplementation : Create a non-unique secondary index on the Account ID column (offset 25, length 11) of the target table.
5. Path Definition (STEP25)
  • Action : Defines a logical VSAM PATH ( AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH ) that associates the Alternate Index with the base KSDS.
  • Target Reimplementation : In relational databases, this step is handled implicitly by the database engine when a secondary index is queried. In non-relational targets, establish a secondary index mapping or a query view.
6. Alternate Index Build (STEP30)
  • Action : Populates the Alternate Index using the BLDINDEX command. It scans the populated base KSDS, extracts the keys (Account ID at offset 25 and Card Number at offset 0), and loads them into the AIX structure.
  • Target Reimplementation : If migrating to a relational database, the index is built automatically upon creation. For certain NoSQL or distributed databases, trigger an index rebuild/population process.

<h2

Datasets

MAT / Gemini

The data estate MAT inferred from the JCL — VSAM, IMS, DB2, GDGs. Quarry's scan does not model these; this layer is entirely MAT's.

AWS.M2.CARDDEMO.ACCTDATA.ARRYPS

The AWS.M2.CARDDEMO.ACCTDATA.ARRYPS dataset is a specialized, structured repository within the CardDemo credit card management system.

MAT analysis

Business Overview of the Array Account Extract Dataset

Business Description and Purpose

The AWS.M2.CARDDEMO.ACCTDATA.ARRYPS dataset is a specialized, structured repository within the CardDemo credit card management system. Its primary business purpose is to store multi-period financial snapshots—specifically balances and debit activities—for credit card accounts.

Rather than representing a single real-time transaction, this dataset organizes financial metrics into a multi-valued, sequential format. This structured layout is designed to support downstream analytical applications, business intelligence tools, and reporting systems that require historical or trend-based views of account behavior over time.

Business Importance and Value

This dataset plays a critical role in the organization's financial analysis, risk management, and reporting strategies:

  • Trend Analysis and Forecasting: By consolidating multi-period financial snapshots into a single structured record per account, business analysts can easily track spending patterns, balance fluctuations, and payment behaviors over time.
  • Operational Efficiency: Offloading complex historical queries from the primary transactional database to this sequential extract protects the performance of online customer-facing systems. Downstream reporting tools can process this file rapidly without impacting daily credit card operations.
  • Risk and Credit Assessment: Access to historical balance and debit trends allows risk management teams to identify accounts with deteriorating financial health or unusual activity, supporting proactive credit limit adjustments and fraud prevention.
  • Simplified Downstream Integration: The structured, multi-period format simplifies the data ingestion process for external subsystems, reducing the need for complex joins or aggregations in downstream reporting platforms.
System Interactions and Data Flow

The dataset is managed and populated through a scheduled batch execution flow that ensures data freshness and integrity:

  • Lifecycle Management (Preparation): Before new data is generated, the batch job READACCT executes an initial cleanup step ( PREDEL ). This step deletes any pre-existing versions of the dataset from previous runs, ensuring a clean environment and preventing data duplication or job failures.
  • Data Extraction and Transformation: The core batch utility program ( CBACT01C ) acts as the primary creator of this dataset. It reads active credit card account information from the master operational database.
  • Array Formatting: During processing, the program extracts key financial metrics, structures them into sequential multi-period snapshots, and writes the consolidated records directly to the AWS.M2.CARDDEMO.ACCTDATA.ARRYPS dataset.

Once populated, this dataset is made available as a stable, read-only input for downstream business intelligence applications, trend-modeling tools, and executive reporting systems.

AWS.M2.CARDDEMO.ACCTDATA.IMPORT

The AWS.M2.CARDDEMO.ACCTDATA.IMPORT dataset serves as the primary staging repository for normalized financial account information during a credit card branch migration.

MAT analysis

Business Description of the Credit Card Account Migration Dataset (AWS.M2.CARDDEMO.ACCTDATA.IMPORT)

Business Overview

The AWS.M2.CARDDEMO.ACCTDATA.IMPORT dataset serves as the primary staging repository for normalized financial account information during a credit card branch migration. When a financial institution undergoes a branch merger, acquisition, or system upgrade, legacy customer and financial data must be safely transitioned into the core credit card processing system.

This dataset represents the "Financial Accounts" portion of that migration. It contains the essential financial structures of the migrated credit card accounts—including current balances, credit limits, cycle activities, and account statuses—cleansed and formatted for seamless integration into the core banking environment.

Business Importance and Role

The accuracy and availability of this dataset are critical to the financial and operational integrity of the credit card business:

  • Financial Continuity and Accuracy: It ensures that customers' outstanding balances, available credit, and billing cycle history are preserved and transferred without error. Any discrepancy here could lead to incorrect billing, customer dissatisfaction, or financial loss for the institution.
  • Credit Risk and Compliance Management: By capturing credit limits and account statuses (such as active or suspended), the dataset ensures that risk controls remain active immediately after migration, preventing unauthorized credit exposure.
  • Operational Readiness: Rather than attempting to load complex, mixed-entity legacy files directly into production databases, this dataset provides a clean, dedicated, and standardized source of account-only data. This significantly reduces the risk of database corruption and simplifies downstream loading processes.
Job and Program Interactions

This dataset is a key output of the system's migration ETL (Extract, Transform, Load) pipeline:

  • Data Ingestion and Extraction: The batch job CBIMPORT executes the migration utility program CBIMPORT . This program reads a single, consolidated export file containing mixed legacy data (customers, accounts, transactions, etc.).
  • Normalization and Routing: The program identifies records associated with financial accounts, translates compressed or legacy mainframe data formats into standard, readable formats, and routes these cleaned records directly to the AWS.M2.CARDDEMO.ACCTDATA.IMPORT dataset (defined in the job as ACCTOUT ).
  • Downstream Consumption: Once this batch import job completes successfully, this dataset becomes the clean, verified source file used by downstream database load utilities to populate the core credit card application tables.

AWS.M2.CARDDEMO.ACCTDATA.PS

The AWS.M2.CARDDEMO.ACCTDATA.PS dataset serves as the primary, authoritative source of baseline account information for the CardDemo application.

MAT analysis

Business Overview of the Account Baseline Dataset (AWS.M2.CARDDEMO.ACCTDATA.PS)

Business-Level Description

The AWS.M2.CARDDEMO.ACCTDATA.PS dataset serves as the primary, authoritative source of baseline account information for the CardDemo application. It functions as a master sequential repository containing the core profiles of all customer accounts. This dataset acts as the "golden copy" or foundational data seed, capturing essential account details in a standardized, sequential format before they are processed for active, day-to-day financial transactions.

Business Importance and Role

This dataset is critical to the operational integrity and continuity of the CardDemo application for several key reasons:

  • System Initialization and Environment Setup: It provides the necessary baseline data required to spin up new environments, perform system testing, or initialize the application with a clean, verified set of account records.
  • Disaster Recovery and System Restores: In the event of data corruption or system failure in the active transactional database, this dataset serves as the reliable backup source used to restore the account database to a known, stable state.
  • Data Consistency and Integrity: By maintaining a standardized sequential file, the business ensures that all downstream systems and databases start with identical, validated account structures, minimizing the risk of data drift or transactional errors.
Job and Program Interactions

The dataset is utilized during batch processing cycles to transition data from a cold-storage sequential format into an active, high-performance transactional database.

  • Data Loading and Refresh (Job: ACCTFILE): The primary interaction occurs during the execution of the account initialization job. The system utility reads this sequential dataset as its sole input source.
  • Database Population: The program extracts the raw account records from this dataset and loads them into an indexed, high-speed database structure. This process automatically indexes the records by their unique account identifiers, transforming the static sequential data into an active, searchable format ready for real-time customer lookups, credit card authorizations, and financial reporting.

AWS.M2.CARDDEMO.ACCTDATA.PSCOMP

The AWS.M2.CARDDEMO.ACCTDATA.PSCOMP dataset serves as the primary repository for standardized, detailed credit card account information within the CardDemo credit card management system.

MAT analysis

Detailed Account Extract Dataset (AWS.M2.CARDDEMO.ACCTDATA.PSCOMP)

Business Overview

The AWS.M2.CARDDEMO.ACCTDATA.PSCOMP dataset serves as the primary repository for standardized, detailed credit card account information within the CardDemo credit card management system. It acts as a consolidated, clean snapshot of core account metrics, capturing essential financial and administrative details such as current balances, credit limits, account statuses, and key operational dates.

By transforming raw, complex database records into a highly structured and sequential format, this dataset functions as a reliable "single source of truth" for downstream business operations.

Business Importance and Role

This dataset plays a critical role in the organization's data strategy, supporting several key business functions:

  • Downstream Integration and Reporting: It is the foundational data source for downstream applications, including business intelligence platforms, financial reporting systems, and auditing tools. It ensures that business analysts and decision-makers work with consistent, high-quality data.
  • Data Quality and Standardization: During the creation of this dataset, raw dates are standardized into a uniform format, and specific business rules are applied to handle missing or zero-value financial activities (such as applying default values). This guarantees data integrity and prevents errors in downstream calculations.
  • Operational Efficiency: By extracting and formatting data into a sequential file, the business can perform heavy analytical and reporting tasks without directly querying the primary transactional database. This offloading protects the performance and responsiveness of customer-facing online systems.
  • Archiving and Compliance: The sequential nature of the file makes it ideal for historical archiving, helping the organization meet regulatory compliance requirements for financial data retention.
Job and Program Interactions

The dataset is managed and populated through a coordinated batch processing flow:

Job: READACCT (Lifecycle Management):

  • This batch job controls the generation of the dataset.
  • To ensure operational reliability and prevent data duplication, the job's initial step ( PREDEL using utility IEFBR14 ) deletes any pre-existing version of the dataset from previous runs.
  • The subsequent step ( STEP05 ) allocates and catalogs the fresh dataset upon successful execution.

Program: CBACT01C (Data Extraction and Transformation):

  • This COBOL batch utility is the engine that populates the dataset.
  • It reads raw, active credit card records from the master database.
  • For each record, it performs critical business transformations: it standardizes administrative dates using an external formatting utility and applies conditional logic to substitute default values for specific financial fields when activity is absent.
  • The finalized, high-quality records are then written directly to the AWS.M2.CARDDEMO.ACCTDATA.PSCOMP dataset (referenced via the OUTFILE DD statement) for downstream consumption.

AWS.M2.CARDDEMO.ACCTDATA.VBPS

The AWS.M2.CARDDEMO.ACCTDATA.VBPS dataset serves as a highly optimized, multi-purpose data distribution file within the CardDemo credit card management system.

MAT analysis

Business Overview of the Variable-Length Account Extract Dataset (AWS.M2.CARDDEMO.ACCTDATA.VBPS)

Business Description

The AWS.M2.CARDDEMO.ACCTDATA.VBPS dataset serves as a highly optimized, multi-purpose data distribution file within the CardDemo credit card management system. It contains segmented profiles of credit card accounts, separating basic administrative status information from detailed financial metrics.

Rather than delivering a single, bulky record for every account, this dataset structures the information into distinct, variable-length records. This design allows the business to package and distribute account information in a flexible format, making it easier for various downstream business applications to consume only the specific data they require.

Business Importance and Role

This dataset plays a critical role in supporting downstream business operations, reporting, and analytics. Its importance is highlighted by several key business benefits:

  • Targeted Data Delivery: Different business units have distinct data requirements. For example, customer service or compliance teams may only need to verify whether an account is active, while risk management and financial planning teams require deep financial metrics. This dataset allows downstream systems to ingest only the specific data segments relevant to their operations, preventing unnecessary data exposure and processing.
  • Operational Efficiency: By utilizing a variable-length format that splits administrative and financial data, the business minimizes storage overhead and reduces the processing time required for downstream batch jobs, reporting tools, and external subsystems.
  • Data Integrity and Consistency: Serving as a direct extract from the master account database, it ensures that downstream reporting, auditing, and analytics are performed on verified, up-to-date account information.
Job and Program Interactions

The dataset is populated and managed through a structured batch process that ensures data freshness and operational reliability:

  • Lifecycle Management (READACCT Job): The dataset is managed through a periodic batch execution. To ensure data freshness and prevent processing errors, the job first executes a cleanup step to delete previous versions of the file before generating the new extract. This guarantees that downstream systems always work with the most current business day's data.
  • Data Extraction and Segmentation (CBACT01C Program): The core extraction program reads the master credit card account database. For every account, it extracts key details, standardizes administrative dates, and writes two distinct records to this dataset—one focused on account status and the other on financial health. This dual-record approach ensures that downstream consumers can easily filter and process only the data they need.

AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS

The AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS dataset serves as the primary Account Master Database for the CardDemo credit card management application.

MAT analysis

Business Overview of the Cardholder Account Master Dataset

The AWS.M2.CARDDEMO.ACCTDATA.VSAM.KSDS dataset serves as the primary Account Master Database for the CardDemo credit card management application. It is the centralized, authoritative "source of truth" containing the financial and operational states of all customer credit card accounts.

Business Importance and Role

This dataset is critical to the core financial operations of the credit card business. It directly supports credit risk management, transaction processing, billing, and customer communications. Its primary business roles include:

  • Financial Integrity : It maintains the definitive record of what each customer owes (current balances), their credit boundaries (credit limits), and their billing cycle activities (accumulated credits and debits).
  • Credit Risk Control : By housing real-time credit limits and cycle balances, it prevents financial loss by enabling instant validation of whether a customer has sufficient credit to complete a purchase.
  • Revenue Generation : It provides the baseline balances and account classifications required to calculate and post monthly interest charges and finance fees.
  • Customer Trust and Transparency : It supplies the accurate financial summaries needed to generate monthly statements, ensuring customers receive clear and correct billing information.
How Business Processes Interact with the Dataset

The dataset is integrated into the entire lifecycle of credit card management, from daily transaction processing to monthly billing and strategic data archiving.

1. Account Initialization and Maintenance
  • System Refresh : The database is initialized and populated with baseline account information during system setup or scheduled maintenance cycles. This ensures that the application operates on a clean, structured, and up-to-date repository of account profiles.
2. Daily Transaction Processing and Validation
  • Real-Time Authorization : For every daily credit card transaction, the system queries this dataset to verify that the account is active and has not expired.
  • Credit Limit Checks : The system calculates the projected balance against the account's credit limit to approve or reject transactions.
  • Balance Updates : Approved transactions immediately update the account's current balance and cycle-to-date credit or debit accumulators.
3. Monthly Billing and Interest Calculation
  • Interest Posting : At the end of each billing cycle, a batch process reads the outstanding balances, determines the appropriate interest rate based on the account's group classification, calculates the monthly finance charges, and posts these charges back to the account balance.
  • Cycle Reset : Once interest is posted, the system resets the cycle's credit and debit accumulators to prepare the account for the next billing period.
4. Customer Statement Generation
  • Statement Assembly : The dataset is read to retrieve the final account balances and credit metrics for the billing cycle. This information is merged with customer demographics and transaction histories to generate official monthly statements in both print-ready and digital (HTML) formats.
5. Reporting, Analytics, and Data Migration
  • Downstream Business Intelligence : Account records are extracted and restructured into specialized formats to support historical trend analysis, risk modeling, and executive reporting.
  • System Integration and Migration : During branch restructuring, system mergers, or data archiving, the account data is consolidated with customer and card profiles into standardized export payloads for downstream ingestion.

AWS.M2.CARDDEMO.CARDDATA.PS

The dataset AWS.M2.CARDDEMO.CARDDATA.PS serves as the primary master source file for credit and debit card information within the card processing ecosystem.

MAT analysis
Business Overview of the Card Data Source Dataset

The dataset AWS.M2.CARDDEMO.CARDDATA.PS serves as the primary master source file for credit and debit card information within the card processing ecosystem. It acts as the authoritative offline repository containing the latest updates, issuances, and status changes for customer cards.

This dataset is designed to feed the live, customer-facing online banking and transaction systems, ensuring that customer service representatives and automated payment networks have access to accurate and current card details.

Business Importance and Role

The dataset plays a critical role in maintaining operational continuity, financial security, and customer satisfaction. Its key business contributions include:

  • Data Synchronization: It bridges the gap between back-office administrative processes (such as issuing new cards, updating card statuses, or blocking compromised cards) and the live transaction environment.
  • Operational Integrity: By serving as the clean, verified source of truth, it ensures that the online system is refreshed with validated data, minimizing the risk of transaction failures or unauthorized card usage.
  • Enhanced Customer Service: The data contained in this file enables downstream systems to link individual cards to customer accounts, allowing support staff to quickly resolve inquiries and verify cardholder identities.
Job and Program Interaction

The dataset is utilized during scheduled batch maintenance windows to refresh the active online database. The interaction flows as follows:

  • Data Ingestion: During the maintenance cycle, a dedicated administrative job ( CARDFILE ) accesses this sequential dataset as its primary input.
  • Database Refresh: The system reads the records from this dataset to populate the high-performance database used by the live CICS online application. This process completely refreshes the active card registry to reflect the most recent business updates.
  • Search Index Optimization: Once the data is loaded, the system automatically rebuilds search indexes based on this input. This allows business users and applications to search for card records not only by the card number itself but also by the associated customer account.
  • System Safeguards: To guarantee absolute data consistency, the online application temporarily locks access to the card database while this dataset is being processed, reopening immediately after the refresh is complete to resume normal business operations.

AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS

The dataset AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS serves as the central, authoritative repository for all issued credit and debit card information within the CardDemo application.

MAT analysis

Business Overview of the Card Master Dataset

The dataset AWS.M2.CARDDEMO.CARDDATA.VSAM.KSDS serves as the central, authoritative repository for all issued credit and debit card information within the CardDemo application. It acts as the operational backbone for card-related business processes, maintaining the active state, ownership, and security parameters of payment cards.

Business Importance and Role

This dataset is critical to the organization's daily financial operations, customer service, and risk management strategies. Its primary business roles include:

  • Transaction Authorization and Validation: It provides the real-time data required by online banking and point-of-sale systems to validate card status, verify security codes, and check expiration dates before authorizing financial transactions.
  • Fraud Prevention and Security: By maintaining up-to-date card security and operational status information, the dataset helps prevent unauthorized card usage, protecting both the business and its customers from financial loss.
  • Customer Relationship Management: It links physical cards to customer accounts, enabling customer service representatives to quickly resolve cardholder inquiries, manage card activations, and handle reissues.
  • Regulatory Compliance and Auditing: The dataset stores historical and current card states, which are essential for maintaining compliance with payment card industry standards and supporting internal and external audits.
Job and Program Interactions

The dataset is utilized across several key batch processes that handle data maintenance, business intelligence, and administrative auditing.

1. Data Maintenance and Synchronization (Job: CARDFILE)

To ensure that online customer-facing systems operate on the most accurate and current information, this job performs a scheduled refresh of the card database.

  • Business Flow: The job temporarily takes the online card inquiry systems offline to prevent data conflicts. It then repopulates the master dataset with updated card information received from upstream source systems.
  • Search Optimization: During this process, the system rebuilds alternate search paths. This allows business users and customer service representatives to search for card details using either the card number or the associated customer account number, significantly improving operational efficiency. Once the refresh is complete, online access is restored.
2. Data Consolidation and Migration (Job: CBEXPORT / Program: CBEXPORT)

This process supports strategic business initiatives such as branch restructuring, data archiving, and downstream business intelligence.

  • Business Flow: The export utility reads the card master dataset alongside customer profiles, financial accounts, and transaction histories. It consolidates these separate data streams into a single, standardized export file. This unified file provides a complete, temporally consistent snapshot of the business state, which is then used for system integration or downstream analytics.
3. Administrative Auditing and Verification (Job: READCARD / Program: CBACT02C)

This utility is designed for administrative oversight and data quality assurance.

  • Business Flow: The program sequentially scans the entire card database to verify data integrity and generate administrative reports. It acts as an audit tool, allowing system administrators to verify that card records are structured correctly and that active statuses align with business rules. If any data corruption or system errors are detected during this scan, the program halts immediately to safeguard data integrity and alert operations.

AWS.M2.CARDDEMO.CARDXREF.IMPORT

The AWS.M2.CARDDEMO.CARDXREF.IMPORT dataset serves as the foundational directory linking physical credit cards to their corresponding financial accounts within the CardDemo application.

MAT analysis

Card-to-Account Cross-Reference Import Dataset (AWS.M2.CARDDEMO.CARDXREF.IMPORT)

Business Overview

The AWS.M2.CARDDEMO.CARDXREF.IMPORT dataset serves as the foundational directory linking physical credit cards to their corresponding financial accounts within the CardDemo application.

In credit card operations, a payment card (the physical or virtual instrument used at a point of sale) and a financial account (the ledger holding the balance, credit limits, and billing history) are distinct business entities. A single financial account may have multiple cards associated with it—such as cards for authorized users or replacement cards issued over time. This dataset acts as the "glue" or mapping layer that explicitly defines which credit card belongs to which financial account and customer.

Business Importance and Role

This dataset is critical to the operational integrity of the credit card business, particularly during data migration events such as branch acquisitions or system upgrades. Its primary business roles include:

  • Transaction Authorization and Routing: When a cardholder initiates a transaction, downstream systems must instantly map the card number to the correct financial account to verify credit availability and authorize the purchase. This dataset provides the clean, normalized mapping required to support those downstream lookup tables.
  • Billing and Statement Accuracy: Ensuring that transactions made on individual cards are billed to the correct master account is paramount. Accurate cross-referencing prevents misallocated transactions, billing disputes, and financial reconciliation errors.
  • Seamless Customer Migration: During a branch migration, legacy data is often consolidated and compressed. This dataset ensures that as customer accounts are moved to the new system, the vital links between their active cards and accounts are preserved without disruption to card usage.
  • Customer Service and Support: Enables customer service representatives to quickly identify account ownership and customer profiles when a cardholder calls in with inquiries or reports a card lost or stolen.
Job and Program Interaction

The AWS.M2.CARDDEMO.CARDXREF.IMPORT dataset is populated during the data ingestion phase of a branch migration.

  • The Ingestion Process ( CBIMPORT Job): The batch job CBIMPORT executes the core import utility. It reads a single, consolidated export file containing mixed legacy data (including customer profiles, accounts, transactions, and cards) from the migrating branch.
  • Data Extraction and Normalization ( CBIMPORT Program): As the program processes the incoming stream, it identifies records representing card-to-account relationships. It extracts these records, unpacks legacy compressed data formats into standard, readable business formats, and writes the clean, structured output directly to the AWS.M2.CARDDEMO.CARDXREF.IMPORT dataset.
  • Downstream Readiness: Once this dataset is successfully populated, it serves as a verified, clean staging source. Downstream processes can safely load this data into core relational databases, ensuring the new system has an accurate map of card-to-account relationships from day one.

AWS.M2.CARDDEMO.CARDXREF.PS

Business Overview of the Card Cross-Reference Dataset The AWS.M2.CARDDEMO.CARDXREF.PS dataset serves as the master source registry for mapping credit cards to their corresponding customer accounts within the credit card processing system.

MAT analysis

Business Overview of the Card Cross-Reference Dataset

The AWS.M2.CARDDEMO.CARDXREF.PS dataset serves as the master source registry for mapping credit cards to their corresponding customer accounts within the credit card processing system. In retail banking and credit card operations, a physical payment card and a financial account are distinct entities. This dataset acts as the foundational translation layer that links individual payment cards to the master customer accounts responsible for funding and settling transactions.

Business Importance and Role

This dataset is critical to the daily operations of the credit card business for several key reasons:

  • Transaction Authorization and Routing: When a customer uses a card, the system must instantly identify which financial account to debit or credit. This cross-reference data is the key to routing those transactions correctly.
  • Customer Service and Inquiry Support: Support representatives often need to look up account details using a card number, or identify all active cards associated with a single account (such as for authorized users or family plans). This dataset enables bi-directional search capabilities.
  • Operational Continuity: During system maintenance, migrations, or daily batch cycles, having a clean, reliable master file ensures that the relationship between cards and accounts remains accurate and synchronized, preventing billing errors or unauthorized card usage.

How Jobs and Programs Interact with the Dataset

The dataset is utilized during system initialization, database refresh cycles, and batch maintenance windows.

  • Data Ingestion and Database Population: During batch processing, the system reads the raw records from this sequential dataset as its primary input. It copies this data directly into the high-performance operational database used by real-time applications.
  • Index Generation: The ingestion process uses this source data to build primary and secondary search paths. This ensures that downstream business applications can query the data efficiently, whether they are searching by the card identifier or the customer account identifier.

By serving as the trusted starting point for the database load process, this dataset ensures that the operational systems always have access to the most up-to-date card-to-account relationships.

AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH

In credit card processing systems, a clear distinction exists between a customer's financial account—where credit limits, balances, and interest rates are managed—and the physical credit card used to perform transactions.

MAT analysis

Card-to-Account Cross-Reference Alternate Access Path

Business Overview

In credit card processing systems, a clear distinction exists between a customer's financial account—where credit limits, balances, and interest rates are managed—and the physical credit card used to perform transactions. To maintain financial integrity, the system must constantly translate card-specific activities into account-level updates.

The AWS.M2.CARDDEMO.CARDXREF.VSAM.AIX.PATH dataset serves as an optimized, alternate search pathway for the master card-to-account cross-reference registry. It allows the system to rapidly associate credit card numbers with their corresponding financial accounts, ensuring that transactions, fees, and interest are accurately directed and recorded.

Business Importance and Role

This dataset plays a critical role in ensuring operational accuracy and efficiency within the credit card portfolio:

  • Seamless Financial Mapping: It acts as the operational bridge between customer-facing card transactions and back-office financial accounting, ensuring that every transaction is mapped to the correct billing entity.
  • Batch Processing Performance: During high-volume batch processing windows, standard sequential lookups can cause severe performance bottlenecks. This alternate path provides a highly efficient, direct lookup mechanism, significantly reducing processing times for critical financial runs.
  • Billing and Interest Accuracy: By facilitating rapid verification of card-to-account relationships, it ensures that monthly interest calculations and finance charges are posted to the correct customer accounts without delay or error.
Job and Program Interactions

This dataset is utilized during core financial processing cycles, specifically during the monthly interest calculation and posting run:

  • Job INTCALC (Step STEP15) / Program CBACT04C: This batch process is responsible for calculating monthly finance charges on outstanding balances and updating customer account balances.
  • Data Interaction: As the program processes transaction balances, it accesses this dataset as an input source. It uses this alternate path to quickly verify the relationship between the active credit cards and the master accounts being processed. This lookup ensures that the system-generated interest transactions are created with the correct card details and that the corresponding account master records are updated accurately to reflect the new balances for the upcoming billing cycle.

AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS

In a credit card management system, establishing a reliable link between physical payment instruments, the individuals who hold them, and the financial accounts that back them is fundamental.

MAT analysis

Cardholder Account Cross-Reference Master Dataset

Business-Level Description

In a credit card management system, establishing a reliable link between physical payment instruments, the individuals who hold them, and the financial accounts that back them is fundamental. The Cardholder Account Cross-Reference dataset serves as the central relational bridge for the CardDemo application. It maps physical credit cards to their respective customer profiles and financial accounts. This mapping ensures that any action taken on a physical card—such as a retail purchase, a payment, or an administrative change—is accurately attributed to the correct customer and reflected in the correct financial ledger.

Business Importance and Role

This dataset is the cornerstone of operational integrity and financial accuracy within the credit card system. Its primary roles include:

  • Transaction Attribution : Ensuring that daily transactions are posted to the correct financial accounts.
  • Financial Accuracy : Enabling accurate interest calculations and balance updates by linking account-level financial rules to card-level activities.
  • Customer Communications : Facilitating the generation of clear, accurate, and comprehensive billing statements by merging customer demographics with transaction histories.
  • Audit and Compliance : Providing a reliable, single source of truth for auditors and system administrators to verify the relationships between cards, customers, and accounts, thereby preventing fraud and operational errors.
How Jobs and Programs Interact with the Dataset

The dataset is utilized across the entire lifecycle of credit card operations, categorized into four key business functions:

1. Daily Transaction Processing and Validation

During daily operations, incoming transactions must be validated before they are posted. The transaction posting job queries this dataset to verify that the card used in a transaction is valid and to identify the associated financial account. This step is critical for checking credit limits and preventing unauthorized or over-limit transactions.

2. Financial Calculations and Account Updates

At the end of the billing cycle, the interest calculation process uses this dataset to map account-level balances and group-specific interest rates back to the physical cards. This ensures that finance charges are correctly calculated and posted to the master account.

3. Customer Statement and Report Generation

To produce monthly statements and daily transaction reports, reporting programs read this dataset to link transaction histories with customer names, addresses, and account balances. This allows the system to generate both printed and digital statements for cardholders, as well as detailed audit reports for business analysts.

4. System Maintenance, Migration, and Auditing

For administrative oversight, diagnostic utilities read this dataset to output and verify card-to-account mappings. Additionally, during system migrations or branch restructurings, data export utilities read this dataset to consolidate customer profiles, accounts, and card details into a unified export payload, ensuring no historical or relational data is lost. Finally, initialization jobs manage the setup and indexing of this dataset to ensure high-performance lookups for all downstream applications.

AWS.M2.CARDDEMO.CNTL(DB2FREE)

The dataset AWS.M2.CARDDEMO.CNTL(DB2FREE) serves as a critical operational control file used during the lifecycle management of the CardDemo (Credit Card Demonstration) application.

MAT analysis

Business Utility of Dataset: AWS.M2.CARDDEMO.CNTL(DB2FREE)

Business-Level Description

The dataset AWS.M2.CARDDEMO.CNTL(DB2FREE) serves as a critical operational control file used during the lifecycle management of the CardDemo (Credit Card Demonstration) application. Specifically, it acts as an environment-clearing configuration script. Its primary business purpose is to facilitate a "clean slate" prior to database updates, software deployments, or environment resets by decommissioning and releasing legacy database access structures (plans and packages) associated with the credit card processing system.

By automating the removal of outdated database access paths, this dataset ensures that subsequent database creation and data loading activities can proceed without technical conflicts, locking issues, or version mismatches.

Business Importance and Role

The dataset plays a vital role in maintaining the stability, reliability, and agility of the CardDemo application infrastructure:

  • Risk Mitigation and Conflict Prevention: In credit card processing environments, database structures and application logic frequently evolve. Leaving legacy database access plans active can cause severe operational conflicts when new application versions are deployed. This dataset mitigates that risk by ensuring old configurations are cleanly retired.
  • Deployment Automation and Efficiency: Rather than requiring database administrators to manually identify and drop obsolete application packages, this dataset automates the cleanup process. This accelerates deployment timelines for new features or system testing cycles.
  • Environment Consistency: Whether provisioning a new testing environment, resetting a training environment, or preparing for a production release, this dataset guarantees a standardized, repeatable starting state, reducing human error and operational downtime.
Job and Program Interactions

The dataset is utilized at the very beginning of the database initialization lifecycle to prepare the environment for subsequent setup steps:

  • Job Context ( CREADB2 ): This job is responsible for the complete initialization and setup of the CardDemo database. It orchestrates the entire process from environment cleanup to database creation and reference data ingestion.
  • Step Execution ( FREEPLN ): Within the CREADB2 job, the very first step ( FREEPLN ) utilizes the DB2FREE dataset. This step is strategically executed first to clear out old configurations before any new database structures are built.
  • Program Interaction ( IKJEFT01 ): The mainframe's Terminal Monitor Program ( IKJEFT01 ) runs this step and reads the DB2FREE dataset as its primary input ( SYSTSIN ). The program processes the commands stored within the dataset to communicate with the database subsystem, successfully freeing and removing the pre-existing application plans and packages. Once this cleanup is complete, the job safely proceeds to create the new database tables and load essential credit card transaction reference data.

AWS.M2.CARDDEMO.CNTL(DB2TEP41)

The dataset AWS.M2.CARDDEMO.CNTL(DB2TEP41) is a critical control configuration file used during the initialization and setup of the CardDemo (Credit Card Demonstration) application's database environment.

MAT analysis
Business Overview

The dataset AWS.M2.CARDDEMO.CNTL(DB2TEP41) is a critical control configuration file used during the initialization and setup of the CardDemo (Credit Card Demonstration) application's database environment. It contains the system commands required to launch the database utility responsible for executing SQL statements.

In a credit card processing system, database tables must be populated with foundational reference data before any customer transactions can be processed. This dataset acts as the operational trigger that enables the system to load this essential reference information into the database.

Business Importance and Role

The primary business value of this dataset lies in its role as an enabler for database readiness and data integrity.

  • Enabling Core Transaction Logic: For a credit card application to function, it must understand different types of financial activities (such as standard purchases, cash advances, or returns) and their associated categories. This dataset is crucial for loading these definitions into the system.
  • Automation and Consistency: By centralizing the utility execution commands within this dataset, the business ensures that database initialization and resets are performed consistently, rapidly, and without manual intervention. This reduces the risk of human error during system deployments or environment refreshes.
  • Operational Readiness: Without this control file, the database setup process cannot execute the scripts necessary to populate reference tables. Consequently, the credit card application would lack the foundational business rules needed to classify and process financial transactions.
Job and Program Interactions

This dataset is utilized as an input control stream during the database preparation phase. Specifically, it interacts with the database initialization job ( CREADB2 ) across two key operational steps:

  • Loading Transaction Types: During the first loading phase, the system execution program ( IKJEFT01 ) reads this dataset to launch the SQL execution utility. This utility then processes the data insertion scripts that populate the core Transaction Type reference table.
  • Loading Transaction Categories: In the subsequent phase, the program again references this dataset to re-invoke the SQL utility. This step populates the sub-classifications or categories associated with those transaction types, ensuring that the hierarchical relationship between transaction types and categories is properly established.

By serving as the common execution driver for these steps, the dataset ensures that the database is systematically populated with the reference framework required for daily credit card operations.

AWS.M2.CARDDEMO.CNTL(DB2TIAD1)

Business Overview of AWS.M2.CARDDEMO.CNTL(DB2TIAD1) The AWS.M2.CARDDEMO.CNTL(DB2TIAD1) dataset is a critical control configuration file used during the initialization and deployment phases of the CardDemo (Credit Card Demonstration) application.

MAT analysis

Business Overview of AWS.M2.CARDDEMO.CNTL(DB2TIAD1)

The AWS.M2.CARDDEMO.CNTL(DB2TIAD1) dataset is a critical control configuration file used during the initialization and deployment phases of the CardDemo (Credit Card Demonstration) application. It functions as an execution driver, containing the system-level commands required to launch the database creation utilities that establish the application's data repository.

Business-Level Description and Usage

In business terms, this dataset acts as the "ignition key" for building the CardDemo database. It does not contain the actual business data or the database design blueprints themselves; rather, it contains the precise operational instructions that tell the mainframe operating system how to start the database creation engine.

When the business needs to deploy a new instance of the credit card application, reset an existing environment, or recover from a system failure, this dataset is used to orchestrate the transition from a blank environment to a fully structured database ready to accept credit card and transaction data.

Business Importance and Role

The dataset plays a vital role in the lifecycle management of the CardDemo application:

  • Foundation for Business Operations: A credit card application cannot function without its underlying database. This dataset is the first step in establishing that foundation, enabling downstream business processes like transaction processing, customer management, and billing.
  • Automation and Reliability: By standardizing the commands needed to initialize the database, this dataset eliminates manual setup steps. This ensures that database environments are created consistently across development, testing, and production, reducing the risk of human error.
  • Disaster Recovery and Agility: In the event of a system outage or the need to rapidly spin up a new testing environment, this dataset allows the business to automate the database creation process, significantly reducing downtime and accelerating time-to-market for new features.

Job and Program Interactions

The dataset is utilized during the database setup phase through a coordinated sequence of system actions:

  • The Setup Job (CREADB2): This is the master job responsible for preparing the CardDemo database environment. It calls upon this dataset during the database creation step.
  • The Interface Program (IKJEFT01): The job executes a standard mainframe system program that acts as the bridge between the operating system and the database. This program accepts the AWS.M2.CARDDEMO.CNTL(DB2TIAD1) dataset as its primary input.
  • Execution Flow: The program reads the instructions inside this dataset to launch the database utility. Once launched, the utility reads the actual database design schemas (tables, indexes, and spaces) and constructs the physical database structure. This prepares the system for subsequent steps, such as loading transaction types and category reference data.

AWS.M2.CARDDEMO.CUSTDATA.IMPORT

In the credit card industry, business growth and consolidation often involve migrating customer portfolios from legacy systems, acquired financial institutions, or regional branches.

MAT analysis

Customer Profile Migration and Normalization Dataset

Business Overview

In the credit card industry, business growth and consolidation often involve migrating customer portfolios from legacy systems, acquired financial institutions, or regional branches. The AWS.M2.CARDDEMO.CUSTDATA.IMPORT dataset serves as the standardized staging repository for newly migrated customer profile information.

During a portfolio migration, data is typically received in a single, consolidated, and highly compressed format. This dataset represents the clean, unpacked, and structured "Customer" slice of that migrated data, containing essential demographic, contact, and credit profile information. It acts as the gateway for new customer records before they are permanently loaded into the core credit card database.

Business Importance and Role

The customer profile is the foundational anchor of any credit card system. This dataset plays several critical roles in ensuring business continuity and operational integrity:

  • Customer Relationship Management (CRM): It establishes the identity of the cardholders, ensuring that names, addresses, and contact details are accurately captured for billing, communications, and customer service.
  • Risk Management and Credit Assessment: The dataset carries vital creditworthiness indicators (such as credit scores) and identity verification details. This allows risk officers to establish appropriate credit limits and monitor portfolio risk from day one.
  • Regulatory Compliance: Accurate customer data is mandatory for compliance with Know Your Customer (KYC), Anti-Money Laundering (AML), and financial reporting regulations. This dataset ensures that all required regulatory fields are present and properly formatted.
  • Data Quality Assurance: By isolating customer profiles into a dedicated, normalized file, the business can perform targeted data-quality audits and address anomalies (such as missing contact info or invalid government IDs) before they impact core production databases.
Job and Program Interactions

This dataset is populated during the core branch migration batch process:

  • Data Extraction and Splitting: The batch job CBIMPORT executes the migration utility program. It reads a raw, consolidated export file containing a mix of customer, account, transaction, and card records.
  • Transformation and Normalization: The program identifies records belonging to customers, translates legacy compressed or binary formats into standard, readable business formats, and flattens complex structures (such as multiple addresses or phone numbers) into a clean, uniform layout.
  • Dataset Population: The validated and formatted customer profiles are written directly to the AWS.M2.CARDDEMO.CUSTDATA.IMPORT dataset.
  • Downstream Consumption: Once this batch process completes successfully, this dataset becomes the trusted source of customer data, ready to be consumed by downstream database load utilities that populate the active credit card master tables.

AWS.M2.CARDDEMO.CUSTDATA.PS

The dataset AWS.M2.CARDDEMO.CUSTDATA.PS serves as the primary sequential repository for Customer Master Data within the CardDemo credit card processing application.

MAT analysis

Business Utility and Importance of the Customer Master Data Source File

Business-Level Description

The dataset AWS.M2.CARDDEMO.CUSTDATA.PS serves as the primary sequential repository for Customer Master Data within the CardDemo credit card processing application. It acts as the central "source of truth" or staging file that aggregates up-to-date customer profile information—such as personal details, account associations, and demographic data—collected from various upstream business processes and administrative systems.

Rather than being accessed directly by real-time customer service representatives or cardholders, this dataset is designed as a high-performance batch feed. It is used to periodically refresh and synchronize the active, online databases that power day-to-day credit card operations.

Business Importance and Role

The Customer Master Data Source File is critical to the business for several key reasons:

  • Operational Accuracy and Integrity: Credit card processing relies heavily on accurate customer information. This dataset ensures that any changes to customer profiles (such as address changes, account status updates, or new customer onboarding) are systematically and reliably propagated to the core banking systems.
  • Risk Management and Fraud Prevention: Up-to-date customer records are essential for verifying identities, validating transactions, and running fraud detection algorithms. Ensuring the online system is refreshed with this master data helps mitigate financial and security risks.
  • Seamless Customer Experience: By serving as the clean source for database updates, this file ensures that customer service channels, mobile applications, and point-of-sale terminals operate on consistent and current information, preventing service disruptions or billing discrepancies.
  • System Performance Optimization: Storing master data in a sequential flat file allows the business to perform bulk updates and data preparation offline without impacting the performance of the live, online transaction processing systems.
Job and Program Interactions

This dataset is integrated into the system's scheduled maintenance and batch processing cycle, primarily interacting with the system through the CUSTFILE batch job:

  • Data Source for Database Refresh: During scheduled maintenance windows, the batch system accesses this dataset as its primary input.
  • Coordination with Online Systems: To ensure a safe update process without data corruption, the associated batch job coordinates with the online transaction region. It temporarily pauses online access to the active customer database, reads the fresh records from this sequential dataset, and uses them to completely rebuild and overwrite the active online database.
  • Restoring Service: Once the data from this source file has been successfully loaded into the online database, the system automatically restores online access, making the updated customer profiles immediately available to cardholders, merchants, and customer service agents.

AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS

The dataset AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS serves as the primary Customer Master Registry for the credit card processing application.

MAT analysis

Customer Master Registry: Business Value and Operational Summary

The dataset AWS.M2.CARDDEMO.CUSTDATA.VSAM.KSDS serves as the primary Customer Master Registry for the credit card processing application. It is the centralized, definitive repository for all customer-related information, housing comprehensive profiles that combine personal identification, contact details, and credit risk indicators.

Business Importance and Role

The Customer Master Registry is a critical asset for the organization, supporting both daily operations and long-term strategic goals. Its primary business roles include:

  • Customer Relationship Management (CRM): By maintaining accurate names, physical addresses, and contact details, the dataset ensures that the business can reliably communicate with cardholders, deliver billing statements, and provide high-quality customer service.
  • Credit Risk and Decisioning: The registry stores key creditworthiness indicators that allow the business to assess risk, manage credit limits, and make informed decisions regarding account statuses and credit extensions.
  • Regulatory Compliance and Security: Housing sensitive personal identification and government-issued identifiers, this dataset is the foundation for regulatory compliance, including Know Your Customer (KYC) guidelines, anti-money laundering (AML) monitoring, and financial auditing.
  • Operational Continuity: As a core data store, it links directly to accounts, cards, and transactions, ensuring that downstream financial processes have immediate access to verified customer demographics.
How Business Processes and Jobs Interact with the Dataset

The Customer Master Registry is actively utilized across several core batch processes, ranging from daily maintenance to monthly billing and strategic data migrations.

1. Customer Profile Maintenance and Synchronization
  • Associated Job: CUSTFILE
  • Business Function: To ensure the business operates on the most current information, this process performs a scheduled refresh of the customer registry. It safely reloads the master dataset with updated customer profiles received from upstream systems. To prevent operational disruptions, the process coordinates with online transaction networks, temporarily pausing online access to safely apply updates and immediately restoring services once the fresh data is loaded.
2. Billing and Statement Generation
  • Associated Job: CREASTMT | Program: CBSTM03A
  • Business Function: During the monthly billing cycle, the statement generation engine queries this dataset to retrieve customer names, mailing addresses, and credit metrics. This demographic information is merged with account balances and transaction histories to produce personalized, professional account statements in both print-ready and digital HTML formats for customer delivery.
3. Data Migration and Downstream Integration
  • Associated Job: CBEXPORT | Program: CBEXPORT
  • Business Function: When the business undergoes structural changes—such as branch migrations, system integrations, or the onboarding of downstream analytics platforms—this utility extracts the customer profiles. It packages them alongside corresponding account, card, and transaction data into a unified, standardized export payload, ensuring complete data portability without loss of historical context.
4. Administrative Auditing and Verification
  • Associated Job: READCUST | Program: CBCUS01C
  • Business Function: For business analysts, system operators, and auditors, this utility serves as an administrative reporting tool. It sequentially reads the active customer registry to generate comprehensive verification reports, allowing stakeholders to inspect customer records, verify data integrity, and perform routine administrative audits.

AWS.M2.CARDDEMO.DALYREJS

In the daily operations of a credit card processing network, thousands of financial transactions are submitted for posting.

MAT analysis

Daily Credit Card Transaction Rejects Dataset (DALYREJS)

Business Overview

In the daily operations of a credit card processing network, thousands of financial transactions are submitted for posting. While most transactions are processed successfully, a subset will inevitably fail critical business and safety checks—such as transactions attempted on expired accounts, purchases that exceed credit limits, or transactions associated with unrecognized card numbers.

The AWS.M2.CARDDEMO.DALYREJS dataset serves as the business's daily "exception ledger" or "rejects repository." It is a dedicated file where all daily credit card transactions that fail validation are safely quarantined. Rather than discarding these failed transactions, the system preserves them in this dataset and appends clear, human-readable explanations detailing exactly why each transaction was declined.

Business Importance and Role

This dataset plays a vital role in maintaining the financial, operational, and regulatory health of the credit card business:

  • Risk Management and Fraud Prevention: By isolating and documenting failed transactions (such as unrecognized card numbers), the dataset helps risk management teams identify potential fraudulent activity, card-cloning attempts, or systemic merchant errors early.
  • Operational Efficiency and Customer Service: When a customer's card is declined, customer service representatives and operations analysts need to know why. This dataset provides the exact business reason for the failure (e.g., credit limit exceeded or expired card), enabling rapid customer support and dispute resolution.
  • Financial Auditability and Compliance: Financial regulations require institutions to maintain a complete audit trail of all transaction attempts, not just successful ones. This dataset ensures the business remains compliant by archiving rejected financial events, proving that credit limits and account statuses are being actively enforced.
  • Data Quality and System Health: High volumes of rejected transactions can indicate upstream data corruption or transmission issues. Monitoring this dataset allows IT and business analysts to detect and resolve data quality issues before they impact the broader business.
System Interaction and Workflow

The dataset is integrated into the daily financial reconciliation cycle through the following interactions:

  • The Posting Process (POSTTRAN / CBTRN02C): During the nightly batch processing window, the core transaction posting program processes the day's incoming transactions. It compares each transaction against master customer accounts and card registries.
  • Exception Routing: If a transaction violates any business rule, the program immediately halts its processing for the main ledger, formats a reject record containing the original transaction details, appends a specific error description, and writes it to the DALYREJS dataset.
  • Operational Alerting: At the end of the batch run, if the program has written any records to this rejects dataset, it automatically issues a warning return code. This alerts the operations queue that exceptions occurred during the night and that the rejects file is ready for manual or automated review and reconciliation.

AWS.M2.CARDDEMO.DALYTRAN.PS

The AWS.M2.CARDDEMO.DALYTRAN.PS dataset serves as the primary daily intake ledger for all credit card transactions executed by cardholders.

MAT analysis
Daily Credit Card Transaction Intake Dataset

The AWS.M2.CARDDEMO.DALYTRAN.PS dataset serves as the primary daily intake ledger for all credit card transactions executed by cardholders. It captures the raw financial activity generated over a business day—including retail purchases, cash advances, and customer payments—before these transactions are officially validated, reconciled, and posted to customer accounts.

Business Importance and Role

This dataset is a critical asset for the financial institution's daily operations, directly impacting risk management, customer service, and financial integrity:

  • Financial Accuracy and Balance Reconciliation: It is the foundational source of data used to update customer account balances. Timely processing ensures that customers see accurate, up-to-date balances and available credit.
  • Credit Risk Mitigation: By feeding daily transactions into the validation pipeline, the business can actively enforce credit limits. This prevents cardholders from exceeding their authorized credit lines, reducing the bank's exposure to bad debt.
  • Fraud and Compliance Control: The dataset allows the system to verify that transactions are only processed for active, non-expired accounts, serving as an essential control point against unauthorized card usage.
  • Spending Analytics: It provides the raw data necessary to track customer spending habits across different categories (such as travel, retail, or dining), which supports loyalty programs and business intelligence.
Operational Interaction and Flow

The dataset is processed during the nightly batch window, serving as the starting point for the daily posting cycle:

  • Batch Ingestion: The daily transaction posting job ( POSTTRAN ) executes the core transaction processing program ( CBTRN02C ), which reads this dataset sequentially.
  • Validation Pipeline: Each transaction record from the dataset is evaluated against master customer databases to verify that the card number is valid, the associated account exists, the transaction does not exceed the customer's credit limit, and the card has not expired.
  • Downstream Updates:
  • Approved Transactions: For records that pass validation, the system updates the customer's master account balance, adjusts category-specific spending totals, and writes a permanent record to the master transaction history.
  • Rejected Transactions: Transactions that fail validation are segregated and written to a daily rejects file with specific error codes, allowing operational teams to review and resolve issues without disrupting the main posting process.

AWS.M2.CARDDEMO.DALYTRAN.PS.INIT

The AWS.M2.CARDDEMO.DALYTRAN.PS.INIT dataset serves as the primary gateway for daily financial transaction data entering the CardDemo credit card processing system.

MAT analysis

Business Overview of the Daily Transaction Initialization Dataset (AWS.M2.CARDDEMO.DALYTRAN.PS.INIT)

Business-Level Description

The AWS.M2.CARDDEMO.DALYTRAN.PS.INIT dataset serves as the primary gateway for daily financial transaction data entering the CardDemo credit card processing system. It acts as a consolidated daily ledger containing raw transaction records—such as customer purchases, payments, and adjustments—collected during batch processing cycles. This dataset is the foundational source of truth used to refresh the active, online transaction database, ensuring that customer-facing systems and customer service representatives have access to the most current financial activities.

Business Importance and Role

This dataset is critical to the daily operations and financial integrity of the credit card business. Its key roles include:

  • Operational Readiness : It enables the transition of transaction data from overnight batch processing to the active online system, ensuring the business starts each day with updated account histories.
  • Customer Experience : By feeding the master transaction database, it ensures that cardholders and customer service agents see accurate, up-to-date transaction histories when querying accounts online or via support channels.
  • Data Consistency : It serves as a clean, standardized starting point for the daily database refresh, minimizing the risk of data corruption or discrepancies between batch records and online systems.
  • Reporting and Auditing : It provides a reliable historical snapshot of daily transactions, which is essential for financial auditing, fraud detection, and compliance reporting.
System Interaction and Data Flow

The dataset is utilized during scheduled maintenance windows by the transaction database initialization job ( TRANFILE ).

  • Data Ingestion : The system reads this sequential file as its primary input.
  • Database Refresh : The data from this file is loaded directly into the core operational database. This process replaces outdated records with the fresh daily transaction set.
  • Search Optimization : During the load process, the system automatically establishes secondary search paths (such as transaction timestamps) based on the ingested data, allowing business users to quickly search and retrieve transaction records without system lag.
  • Online Activation : Once the data from this dataset is successfully loaded and indexed, the system restores online access, making the new transaction data immediately available to the online application.

AWS.M2.CARDDEMO.DATEPARM

The AWS.M2.CARDDEMO.DATEPARM dataset serves as a dynamic control and configuration file within the CardDemo credit card management system.

MAT analysis

Business Utility of the Date Parameter Dataset (AWS.M2.CARDDEMO.DATEPARM)

Business Overview

The AWS.M2.CARDDEMO.DATEPARM dataset serves as a dynamic control and configuration file within the CardDemo credit card management system. Its primary business purpose is to define the specific date range—or "reporting window"—for financial reporting, auditing, and reconciliation activities.

Rather than generating reports on the entire historical transaction ledger or relying on rigid, hardcoded dates, this dataset allows the system to dynamically target a precise timeframe. It acts as the steering mechanism that tells the reporting engine exactly which business day, week, or custom period is currently being analyzed and reconciled.

Business Importance and Value

This dataset plays a critical role in daily financial operations, offering several key business benefits:

  • Operational Flexibility: It allows business analysts, auditors, and operations teams to run reports for any specific timeframe (such as a standard business day, a holiday weekend, or a monthly closeout period) simply by updating the dates in this parameter file, without requiring any changes to the underlying software.
  • Financial Accuracy and Compliance: Financial auditing and reconciliation require strict boundaries. By establishing a precise reporting window, this dataset ensures that the resulting reports align perfectly with accounting periods, preventing data overlap and ensuring compliance with financial reporting standards.
  • Operational Efficiency: Processing millions of credit card transactions is resource-intensive. This dataset ensures the system only processes data within the requested window, significantly reducing mainframe processing time, lowering operational costs, and ensuring that critical reports are delivered to decision-makers on time.
  • Risk Mitigation: Changing reporting parameters through a external configuration file rather than modifying program code eliminates the risk of introducing software bugs into the production environment, ensuring high system stability.
Job and Program Interactions

The dataset is integrated into the core batch processing workflows of the credit card system, specifically interacting with the following components:

  • The Daily Transaction Reporting Job (TRANREPT): This batch workflow is responsible for generating the daily transaction and reconciliation reports. During its execution, it references the date parameter dataset to establish the boundaries for the reporting run.
  • The Reporting and Reconciliation Program (CBTRN03C): Upon startup, this program reads the date parameter dataset as its very first step. It extracts the start and end dates to initialize the reporting window. The program then uses these dates to filter the main transaction ledger, ensuring that only transactions falling within this specified window are processed, enriched with customer and merchant details, and formatted into the final Daily Transaction Report.

AWS.M2.CARDDEMO.DBRMLIB

The dataset AWS.M2.CARDDEMO.DBRMLIB is a critical system library that serves as the Database Request Module Library (DBRMLIB) for the CardDemo application, a core credit card processing and management system.

MAT analysis

Business Profile: AWS.M2.CARDDEMO.DBRMLIB

Business Overview

The dataset AWS.M2.CARDDEMO.DBRMLIB is a critical system library that serves as the Database Request Module Library (DBRMLIB) for the CardDemo application, a core credit card processing and management system.

In a mainframe database environment (specifically IBM DB2), application programs do not communicate with the database directly using raw code. Instead, their database access instructions (SQL statements) are precompiled and stored as specialized database blueprints, known as Database Request Modules (DBRMs). This dataset is the centralized repository that houses these blueprints, acting as the essential bridge between the business application logic and the physical database where financial and customer records reside.

Business Importance and Role

The DBRM library is vital to the daily operations, security, and performance of the credit card management system:

  • Operational Continuity: Without this dataset, the system cannot bind or execute any database transactions. Core business functions—such as processing credit card transactions, updating customer accounts, and managing transaction reference data—would fail to communicate with the database.
  • Data Integrity and Security: By storing precompiled database access paths, the library ensures that only authorized, structured, and validated database operations are executed. This prevents unauthorized database manipulation and safeguards sensitive financial data.
  • System Performance and Efficiency: Pre-compiling database queries and storing them in this library allows the database engine to optimize search and update paths beforehand. This ensures high-speed processing of high-volume financial transactions, minimizing latency for end-users and batch processes.
  • Change Management: It serves as a control point for software deployment. When business rules change and programs are updated, new database blueprints are generated and stored here, ensuring that the database interactions remain synchronized with the latest business requirements.
Job and Program Interactions

This dataset is utilized during the execution of batch jobs that require direct interaction with the application database:

  • Batch Execution and Database Binding: When a batch job is initiated, the system's terminal monitor program (such as IKJEFT01 ) references this dataset as an input source ( DBRMLIB ). This allows the system to locate the precompiled database access plans associated with the program being run.
  • Transaction Table Maintenance (Job: MNTTRDB2): In the context of transaction maintenance, the job MNTTRDB2 accesses this library to retrieve the database blueprints required to perform bulk updates, additions, and deletions on the transaction reference tables. By reading the DBRM library, the job safely and efficiently executes the database commands needed to keep transaction descriptions and codes synchronized across the enterprise.

AWS.M2.CARDDEMO.DISCGRP.BKUP

The AWS.M2.CARDDEMO.DISCGRP.BKUP dataset is a version-controlled historical archive of Disclosure Group reference data within the CardDemo credit card processing application.

MAT analysis

Business Overview of the CardDemo Disclosure Group Backup Dataset

1. Business-Level Description

The AWS.M2.CARDDEMO.DISCGRP.BKUP dataset is a version-controlled historical archive of Disclosure Group reference data within the CardDemo credit card processing application.

In the credit card industry, "Disclosures" represent the legally mandated terms of service, interest rate structures, fee schedules, and privacy policies that govern cardholder accounts. A "Disclosure Group" is a collection of these regulatory and contractual terms categorized for specific card products or customer segments.

This backup dataset acts as a historical ledger, maintaining a rolling record of the active disclosure configurations over time. It ensures that the business has a reliable, point-in-time record of the rules and terms that were active during any given processing cycle.

2. Business Importance and Role

The dataset plays a critical role in the operational integrity, legal compliance, and risk management of the credit card platform:

  • Regulatory Compliance and Auditing: Financial institutions are heavily regulated and must be able to prove exactly which terms and disclosures were active and presented to customers at any specific point in time. This dataset provides the audit trail necessary to satisfy internal audits and external regulatory inquiries.
  • Legal Dispute Resolution: In the event of customer disputes regarding interest rates, fees, or terms of service, this backup allows customer service and legal teams to verify the historical disclosure terms associated with the customer's account at the time of the transaction.
  • Business Continuity and Disaster Recovery: If the active production disclosure file is corrupted, accidentally deleted, or improperly modified during an update, this dataset serves as the primary recovery source, allowing the business to restore operations to a known, stable state with minimal disruption.
3. Job and Program Interactions

The dataset is managed and populated through automated batch processing:

  • Backup Creation and Version Control: The dataset is structured as a Generation Data Group (GDG), which automatically maintains a rolling history of the five most recent versions of the disclosure data. When a new backup is created, the oldest version is automatically retired, ensuring storage efficiency while preserving recent history.
  • The Initialization Job (DEFGDGD): This job is responsible for establishing the backup infrastructure. It defines the rules for how many historical versions to keep and immediately establishes the baseline backup.
  • Data Transfer (IEBGENER): Within the backup job, a standard system utility ( IEBGENER ) performs a direct, secure copy of the active production disclosure data ( AWS.M2.CARDDEMO.DISCGRP.PS ) and writes it into this backup dataset ( AWS.M2.CARDDEMO.DISCGRP.BKUP ). This process runs as an output operation, ensuring that a fresh snapshot of the business rules is captured before any subsequent batch processing or updates occur.

AWS.M2.CARDDEMO.DISCGRP.PS

The AWS.M2.CARDDEMO.DISCGRP.PS dataset serves as the master reference source for Disclosure Group information within the CardDemo credit card processing application.

MAT analysis

Business-Level Description of the Disclosure Group Dataset

The AWS.M2.CARDDEMO.DISCGRP.PS dataset serves as the master reference source for Disclosure Group information within the CardDemo credit card processing application. Disclosure groups represent the structured sets of regulatory mandates, terms of service, interest rate disclosures, and policy-related rules that govern credit card accounts.

This dataset acts as the definitive "source of truth" for these rules, ensuring that all credit card accounts are aligned with current legal and operational guidelines.

Business Importance and Role

The Disclosure Group dataset is critical to the business for several key reasons:

  • Regulatory Compliance and Legal Protection: Financial institutions are heavily regulated and must present accurate, up-to-date terms and disclosures to cardholders. This dataset ensures that the correct legal language and policy rules are consistently applied across all accounts, mitigating the risk of compliance violations, fines, or legal disputes.
  • Operational Consistency: By centralizing disclosure rules in a single master file, the business ensures that both real-time online customer interactions (such as customer service inquiries or mobile app disclosures) and nightly batch processing systems (such as statement generation) reference identical, synchronized information.
  • Data Integrity and Auditability: Maintaining a clean, version-controlled master file allows the business to track historical changes to disclosure terms. This is vital for auditing purposes, enabling the organization to verify exactly which terms were active at any specific point in time.

How Jobs and Programs Interact with the Dataset

This dataset is utilized in two primary operational workflows to support system initialization, daily processing, and business continuity:

1. Database Initialization and Refresh (Job: DISCGRP )

During system maintenance or data refresh cycles, this sequential dataset is used to populate the active, high-performance database utilized by the core application. The system reads the master records from this dataset and loads them into an indexed data store. This process ensures that downstream applications have rapid, indexed access to the most current disclosure rules during daily credit card operations.

2. Version Control and Business Continuity (Job: DEFGDGD )

To safeguard against data corruption and support disaster recovery, the dataset is integrated into a version-controlled backup process. The system reads the active master file and archives a copy into a historical backup group. By maintaining multiple generations of this data, the business ensures it can restore previous operational states and perform historical audits of disclosure rules if required.

AWS.M2.CARDDEMO.DISCGRP.VSAM.KSDS

The Disclosure Group Dataset serves as the central repository for regulatory, policy, and terms-and-conditions rules within the credit card processing system.

MAT analysis

Disclosure Group Reference Data: Business Utility and Importance

Business-Level Description

The Disclosure Group Dataset serves as the central repository for regulatory, policy, and terms-and-conditions rules within the credit card processing system. Specifically, it stores the interest rate structures and finance charge rules associated with different credit card account groups and transaction categories (such as standard purchases, balance transfers, or cash advances).

In the credit card industry, a "disclosure group" represents a specific set of financial terms agreed upon by the customer and the financial institution. This dataset acts as the authoritative rulebook that the system consults to ensure that interest calculations align precisely with these legal and contractual agreements.

Importance and Role to the Business

This dataset is critical to the core financial operations and compliance framework of the credit card business for several reasons:

  • Regulatory Compliance and Legal Protection: Financial institutions are legally mandated to charge interest rates exactly as disclosed to the customer. This dataset ensures that the automated billing systems remain in strict compliance with consumer lending laws and credit card disclosures, mitigating the risk of legal penalties and reputational damage.
  • Revenue Management: Interest charges represent a primary revenue stream for credit card issuers. By maintaining accurate and accessible rate structures, the business ensures it correctly calculates and recovers finance charges on outstanding balances.
  • Product Flexibility: It allows the business to offer diverse credit card products (e.g., student cards, rewards cards, premium cards) with tailored interest rate structures. The system can easily distinguish between different account tiers and apply the appropriate rates.
  • Operational Resilience: The dataset includes standardized default rates. If a specific account group's rate structure is missing or undefined, the system automatically falls back to these default rules, preventing processing delays and ensuring continuous billing operations.
Job and Program Interactions

The Disclosure Group Dataset is managed and utilized through two primary business processes:

1. Reference Data Maintenance and Refresh (Data Preparation)

To ensure that the system always operates on the most current terms and interest rates, a dedicated initialization job regularly refreshes this dataset.

  • The Process: The job performs a clean reset of the active database. It removes outdated rules and loads the latest, approved disclosure group records from a master sequential source file.
  • Business Value: This guarantees that downstream financial calculations are never performed using stale or unauthorized interest rate data.
2. Monthly Interest Calculation and Posting (Data Consumption)

During the monthly billing cycle, the core interest calculation engine heavily relies on this dataset to process customer accounts.

  • The Process: For every account with an outstanding balance, the calculation program queries the Disclosure Group Dataset. It matches the customer's account classification and transaction types against the registry to retrieve the applicable interest rate. If a specific rate is not found, it applies the default rate.
  • Business Value: The retrieved rates are used to compute the monthly finance charges, generate system-initiated interest transactions, and update the customer's total outstanding balance, directly driving the monthly statement generation.

AWS.M2.CARDDEMO.ESDSRRDS.PS

The AWS.M2.CARDDEMO.ESDSRRDS.PS dataset serves as the primary staging area for initializing and provisioning user security profiles within the CardDemo application.

MAT analysis

Business Overview of the CardDemo User Security Staging Dataset

Business-Level Description

The AWS.M2.CARDDEMO.ESDSRRDS.PS dataset serves as the primary staging area for initializing and provisioning user security profiles within the CardDemo application. It acts as a master seed file containing the default administrative and standard user accounts, along with their initial access credentials and profile information. This dataset is crucial for establishing the baseline identity and access management (IAM) configuration for the application environment.

Business Importance and Role

In any financial or transactional application like CardDemo, security and access control are paramount. This dataset plays a vital role in the system's security lifecycle by:

  • Enabling Environment Provisioning: It allows the business to quickly and reliably set up new environments (such as development, testing, or training) with a standardized set of pre-configured users.
  • Supporting System Recovery and Resets: During system maintenance or database resets, this dataset ensures that administrative access can be restored immediately, preventing lockouts and ensuring business continuity.
  • Securing Application Access: By establishing distinct administrative and standard user roles, it ensures that only authorized personnel can perform sensitive operations, thereby maintaining regulatory compliance and operational integrity.
Job and Program Interactions

The dataset is managed and utilized through a structured initialization process (the ESDSRRDS job) that coordinates its lifecycle:

  • Initialization and Cleanup: Before any data is loaded, the system performs a cleanup step to remove any pre-existing version of this dataset, ensuring that the security setup starts from a clean, uncorrupted state.
  • Data Staging: The dataset is then populated with the master list of default user security profiles. This step consolidates the initial credentials into a single, standardized sequential file.
  • Operational Database Population: Once the staging dataset is ready, utility programs read this file to populate the live, operational security databases. These target databases are optimized for different application access patterns—such as rapid direct lookups for user logins and sequential processing for security audits—ensuring that the live CardDemo application can authenticate users efficiently and securely.

AWS.M2.CARDDEMO.EXPORT.DATA

The dataset AWS.M2.CARDDEMO.EXPORT.DATA serves as a vital data bridge and consolidation point within the CardDemo credit card application.

MAT analysis

Business Overview of the CardDemo Export Dataset

The dataset AWS.M2.CARDDEMO.EXPORT.DATA serves as a vital data bridge and consolidation point within the CardDemo credit card application. It is specifically designed to facilitate major business events, such as branch migrations, system integrations, portfolio restructuring, or data archiving.

Rather than requiring downstream systems to interact with multiple separate databases, this dataset acts as a single, unified repository that captures a complete, point-in-time snapshot of the credit card business.

Business-Level Description

At its core, this dataset is a consolidated, multi-record export file. It packages highly interrelated business information from across the credit card lifecycle into a single standardized format. The dataset contains a comprehensive view of the business state, including:

  • Customer Profiles : Core customer demographic and contact information.
  • Account Financial Statuses : Financial metrics, credit limits, and balance details.
  • Card Cross-Reference Mappings : The relational links connecting physical cards to specific customers and accounts.
  • Historical Transaction Records : Logs of financial transactions, including merchant details and purchase amounts.
  • Active Card Details : Operational card statuses, expiration dates, and security verification details.

By housing these diverse entities in a single file, the dataset simplifies the logistics of moving complex, relational credit card data across different business environments or technology platforms.

Business Importance and Role

The dataset plays a critical role in ensuring operational continuity, data integrity, and risk management during transition periods:

  • Risk Reduction in Data Migration : Moving credit card portfolios between branches or systems is a high-risk operation. This dataset minimizes risk by ensuring that all related data (customer, account, card, and transaction) is exported simultaneously, maintaining temporal consistency and preventing orphaned records.
  • Operational Efficiency : Downstream integration tools, cloud-native batch processes, and reporting systems only need to ingest a single file rather than coordinating complex, multi-database queries.
  • Auditability and Reconciliation : The dataset contains standardized tracking metadata, such as generation timestamps and sequence numbers. This allows business analysts and audit teams to reconcile the exported data against target systems, ensuring 100% data completeness and zero loss during migrations.
  • Standardization : It translates complex, internal mainframe storage formats into a standardized structure, making legacy mainframe data accessible and usable for modern, downstream business intelligence and analytics platforms.
Job and Program Interactions

The dataset is the central link between two primary batch processes: the Export Phase (which populates the dataset) and the Import Phase (which consumes it).

1. The Export Phase (Data Consolidation)
  • Associated Job/Program : CBEXPORT
  • Interaction : OUTPUT
  • Business Function : During this phase, the system extracts active business data from five core credit card databases. The export utility sequentially reads these databases, formats each record with standardized tracking headers (including branch and regional identifiers), and writes them into the AWS.M2.CARDDEMO.EXPORT.DATA dataset. This creates the master migration payload.
2. The Import Phase (Data Distribution & Normalization)
  • Associated Job/Program : CBIMPORT
  • Interaction : INPUT
  • Business Function : Once the export dataset is prepared, the import process ingests it to execute an ETL (Extract, Transform, Load) pipeline. The utility reads the consolidated file, identifies each record type, translates the data into standard display formats, and distributes the records into separate, normalized target files. Any malformed or unrecognized records are routed to an error log for administrative review, ensuring only clean data enters the target system.
Summary of Business Value

The AWS.M2.CARDDEMO.EXPORT.DATA dataset is a key strategic asset for the credit card business. It transforms siloed operational databases into a portable, auditable, and highly structured data package. Whether executing a branch merger, migrating to a cloud-native platform, or feeding downstream analytical engines, this dataset ensures that the business's most critical financial and customer relationships are transferred safely, accurately, and efficiently.

AWS.M2.CARDDEMO.IMPORT.ERRORS

During credit card branch migrations, legacy data from acquired or merging branches must be ingested and integrated into the core banking system.

MAT analysis

CardDemo Branch Migration Error Log (AWS.M2.CARDDEMO.IMPORT.ERRORS)

Business Overview

During credit card branch migrations, legacy data from acquired or merging branches must be ingested and integrated into the core banking system. The AWS.M2.CARDDEMO.IMPORT.ERRORS dataset serves as the central repository for capturing, isolating, and logging any malformed, unrecognized, or corrupted records encountered during this migration process.

By acting as a dedicated exception log, this dataset ensures that data anomalies do not disrupt the broader migration pipeline. It allows the system to separate invalid data from high-value business assets—such as customer profiles, financial accounts, and transaction histories—ensuring that only clean, validated information is promoted to the core production databases.

Business Importance and Role

The migration error log plays a critical role in data governance, operational continuity, and risk management:

  • Data Integrity and Quality Assurance: It acts as a gatekeeper, preventing corrupted or non-standard legacy data from polluting the core credit card system. This protects the accuracy of downstream financial ledgers, credit scoring, and customer profiles.
  • Operational Resilience: Rather than allowing a few corrupted records to crash the entire migration process, the system handles anomalies gracefully. By routing bad records to this error log, the migration job can continue processing valid records, preventing costly operational delays and system downtime.
  • Auditability and Remediation: The dataset provides a clear, structured audit trail for data migration teams and business analysts. It documents exactly which records failed and why, enabling targeted data-cleansing efforts and manual remediation to ensure that no customer or transaction is left behind.
Job and Program Interaction

The primary interaction with this dataset occurs during the execution of the branch migration batch pipeline:

  • The CBIMPORT Job: This batch job executes the core Extract, Transform, Load (ETL) pipeline that ingests consolidated legacy branch data. It is responsible for splitting and normalizing this data into separate, entity-specific files.
  • The CBIMPORT Program: As the underlying program processes the incoming data stream, it validates each record to determine if it represents a valid business entity (such as a Customer, Account, Card Cross-Reference, or Transaction).
  • Successful Records: Validated records are transformed and written to their respective production-ready target files.
  • Anomalous Records: If the program encounters an unrecognized record type or a malformed entry, it bypasses normal processing for that record. Instead, it formats a diagnostic error entry—complete with a timestamp and sequence identifier—and writes it directly to the AWS.M2.CARDDEMO.IMPORT.ERRORS dataset.
  • Reconciliation and Reporting: At the conclusion of the migration run, the program generates a summary report. Business operations teams can compare the number of errors logged in this dataset against the total processed records to measure migration success rates and initiate data-cleansing workflows.

AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0

The AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0 dataset is a sequential, point-in-time export of the core transaction authorization data from the CardDemo application.

MAT analysis

Business Utility and Importance of the Card Authorization Export Dataset (AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0)

Business Overview

The AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0 dataset is a sequential, point-in-time export of the core transaction authorization data from the CardDemo application.

In the credit card and payment processing industry, "authorization" is the critical, real-time decisioning process that determines whether a customer's transaction is approved or declined at the point of sale. This dataset serves as the primary consolidated repository for extracted authorization records, capturing vital business information regarding credit limits, account statuses, and transaction approval rules. By converting complex, live database structures into a standardized sequential format, this dataset makes critical financial data accessible for administrative, analytical, and system maintenance purposes.

Business Importance and Role

This dataset plays a vital role in maintaining the operational integrity, security, and agility of the card processing business:

  • Business Continuity and Disaster Recovery: It acts as a secure, point-in-time backup of active authorization records. In the event of a system failure or data corruption, this dataset is essential for restoring the authorization system to a consistent state, minimizing financial and operational risk.
  • Operational Performance Optimization: To ensure that real-time transaction approvals occur in milliseconds, the underlying database must be regularly reorganized to reclaim storage space and optimize search paths. This dataset is the vehicle used to hold the data during these critical maintenance windows, preventing transaction latency for cardholders.
  • Data Modernization and Cloud Integration: As businesses transition to cloud-based architectures, this dataset serves as the bridge between legacy mainframe systems and modern cloud environments (such as AWS). It provides a clean, structured extract that can be easily ingested by modern data warehouses, analytics platforms, and reporting engines.
Operational Interaction and Data Lifecycle

The dataset is managed and populated through a structured, automated batch process designed to ensure data integrity and consistency:

  • Initialization and Housekeeping (Preparation Phase): Before new data is extracted, the system runs a housekeeping step (utilizing the utility program IEFBR14 ). This step identifies and deletes any pre-existing or outdated versions of the export file. This prevents data overlap, avoids system allocation conflicts, and ensures that downstream processes only work with the most current business data.
  • Database Extraction (Unload Phase): Once the environment is prepared, the primary database utility (running under the IMS controller DFSRRC00 ) executes. It reads the live, active authorization database and extracts the hierarchical records, writing them directly into the AWS.M2.CARDDEMO.IMSDATA.DBPAUTP0 dataset. This process successfully packages the live operational data into a stable, sequential format ready for archiving, migration, or reporting.

AWS.M2.CARDDEMO.JCL(INTRDRJ2)

The dataset AWS.M2.CARDDEMO.JCL(INTRDRJ2) is a critical workflow orchestration component within the CardDemo application environment.

MAT analysis

Business Overview of Dataset AWS.M2.CARDDEMO.JCL(INTRDRJ2)

Business-Level Description

The dataset AWS.M2.CARDDEMO.JCL(INTRDRJ2) is a critical workflow orchestration component within the CardDemo application environment. Rather than containing transactional customer or financial data, this dataset serves as an automated instruction set (a job control script) that defines a specific downstream business process.

In the context of daily operations, it acts as the "next step" in a multi-stage processing sequence. Once an initial business event—such as a data preservation or backup routine—completes successfully, this dataset is read by the system to automatically initiate the subsequent phase of the business cycle.

Business Importance and Role

The primary value of this dataset lies in its ability to facilitate automated workflow dependency management and operational risk mitigation :

  • Process Automation and Efficiency: By housing the instructions for the next phase of processing, this dataset eliminates the need for manual operator intervention. This seamless transition between tasks reduces operational latency and ensures faster overall processing times.
  • Data Integrity and Safeguarding: The workflow is structured so that the instructions in INTRDRJ2 are only triggered after preceding data protection steps (like backups) are completed. This guarantees that subsequent business processing only occurs when data is fully secured, preventing data loss or corruption.
  • Operational Reliability: Automating the transition between business tasks standardizes execution, significantly reducing the risk of human error, missed steps, or out-of-sequence processing.
Job and Program Interaction

This dataset is utilized as an input control file to transition from one business process to the next:

  • Workflow Triggering (Job: INTRDRJ1): The primary job, INTRDRJ1 , is responsible for executing initial data preparation and backup tasks. Once these safety measures are successfully executed, the job transitions to its orchestration phase.
  • Instruction Reading (Program: IEBGENER): Within the orchestration phase, the system utility IEBGENER accesses AWS.M2.CARDDEMO.JCL(INTRDRJ2) as an input source.
  • Downstream Submission: The utility reads the execution instructions contained within this dataset and passes them directly to the system's active job queue (the Internal Reader). This action automatically bootstraps and launches the next business application in the pipeline, completing the automated handoff.

AWS.M2.CARDDEMO.LOADLIB

The dataset AWS.M2.CARDDEMO.LOADLIB serves as the central repository of compiled, executable application logic (the "Load Library") for the CardDemo credit card processing system.

MAT analysis

Business Directory of Executable Assets: AWS.M2.CARDDEMO.LOADLIB

Business-Level Description

The dataset AWS.M2.CARDDEMO.LOADLIB serves as the central repository of compiled, executable application logic (the "Load Library") for the CardDemo credit card processing system. In mainframe environments, a load library does not store raw business data records; instead, it houses the actual machine-readable programs that execute the business rules, calculations, and database operations.

This specific library contains the core software engines responsible for managing credit card pre-authorizations, processing transaction holds, maintaining reference lookup tables, and executing critical data-safeguarding procedures such as database backups and archiving.

Business Importance and Role

This dataset is of critical importance to the organization's financial operations, risk management, and data governance strategies:

  • Execution of Core Financial Logic: It contains the software modules that govern credit card pre-authorizations. These programs place temporary holds on cardholder accounts to verify funds before transactions are finalized, directly protecting the business from credit risk and fraud.
  • Operational Continuity and Performance: The library hosts database maintenance and reorganization utilities. These programs ensure that the active transactional databases remain highly performant, preventing system slowdowns during peak customer transaction hours.
  • Regulatory Compliance and Auditing: By housing the utilities that extract and archive pending transaction data, this library enables the business to securely offload historical records for downstream financial reporting, auditing, and long-term compliance storage.
  • System Synchronization: It provides the programs necessary to perform bulk updates to transaction reference data, ensuring that transaction types and descriptions remain consistent across all customer-facing and back-office systems.
How Jobs and Programs Interact with the Dataset

The dataset acts as an indispensable "read-only" execution source for the system's scheduled batch processing window. Whenever a business process needs to run, the operating system accesses this library to retrieve and run the required program:

  • Database Unload and Archiving Jobs (e.g., DBPAUTP0, UNLDGSAM, UNLDPADB): These jobs call extraction programs stored within the load library to safely read active credit card authorization databases and write the information into sequential files for reporting or backup.
  • Database Loading and Update Jobs (e.g., LOADPADB): These jobs execute loading programs from the library to ingest new transaction files and update the live database with current account holds and credit limits.
  • Reference Data Maintenance Jobs (e.g., MNTTRDB2): This job utilizes database interface programs within the library to perform bulk inserts, updates, or deletions on transaction lookup tables, keeping business definitions synchronized.

In summary, AWS.M2.CARDDEMO.LOADLIB is the operational backbone of the CardDemo application, containing the executable intelligence required to run, maintain, and secure the credit card processing business.

AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO

The AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO dataset is a core operational file within the credit card processing system.

MAT analysis

Business Overview of the Pre-Authorization Detail Dataset

Business-Level Description

The AWS.M2.CARDDEMO.PAUTDB.CHILD.FILEO dataset is a core operational file within the credit card processing system. It is dedicated to storing detailed, transaction-level information for pending credit card pre-authorizations.

Pre-authorizations are temporary holds placed on a cardholder’s account to verify the availability of funds before a transaction is finalized (for example, during hotel check-ins or gas station purchases). While summary-level financial metrics (such as overall credit limits and account balances) are stored separately, this specific dataset captures the granular details of each individual pending transaction, including transaction amounts, approval statuses, and merchant information. It represents the "child" details that are linked back to the "parent" account summaries.

Importance and Role to the Business

This dataset plays a critical role in risk management, financial accuracy, and operational continuity for the credit card business:

  • Credit Risk and Fraud Mitigation: By maintaining a precise, detailed record of pending holds, the business can prevent cardholders from exceeding their credit limits and detect potential fraudulent activity before transactions are fully settled.
  • Data Portability and Integration: The dataset acts as a standardized bridge between the core transactional database and downstream business systems. It enables the extraction of detailed transaction histories for risk analysis, financial reporting, and customer service inquiries.
  • System Migration and Archiving: During system upgrades, cloud migrations, or daily archiving cycles, this dataset ensures that complex, hierarchical transaction relationships are preserved in a flat, portable format without losing the connection between an account and its pending transactions.
  • Operational Resilience: It supports database backup and recovery processes, ensuring that active transaction holds can be safely restored in the event of a system outage.
Operational Workflow and Program Interactions

This dataset is positioned at the center of the system's batch processing cycle, serving as both an output for data extraction and an input for database synchronization.

Data Extraction (Unloading)

During scheduled maintenance or reporting cycles, the database unload job ( UNLDPADB ) executes. This process reads the active transactional database and extracts all pending authorization details.

  • The system ensures a clean processing environment by clearing any previous versions of this file.
  • It then extracts the detailed transaction records, pairs them with their corresponding parent account identifiers to maintain relational integrity, and writes them into this dataset. This creates an offline, sequential snapshot of all active credit card holds.
Data Loading and Synchronization

Conversely, during database initialization, recovery, or batch update cycles, the database load job ( LOADPADB ) is executed.

  • This process reads the detailed transaction records directly from this dataset.
  • It validates the transaction details and safely loads them back into the core transactional database, linking each detail record to its appropriate parent account. This ensures that online customer service representatives and authorization systems have access to the most up-to-date transaction histories and credit limits.

AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM

The dataset AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM serves as a specialized, sequential repository for detailed, transaction-level pending credit card authorization data.

MAT analysis

Business Overview of the Pending Authorization Detail Dataset

The dataset AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM serves as a specialized, sequential repository for detailed, transaction-level pending credit card authorization data.

When a cardholder initiates a transaction, the purchase undergoes an authorization process where funds are temporarily held or "pending" before final settlement. While high-level account summaries are kept in a primary file, this specific dataset captures the granular, individual transaction details associated with those pending events. It records the specific circumstances of each authorization attempt, including where, when, and how the card was used, as well as the transaction amounts and initial fraud evaluation statuses.

Business Importance and Role

This dataset plays a critical role in the credit card processing lifecycle, supporting several key business functions:

  • Audit and Regulatory Compliance: Financial institutions are required to maintain strict audit trails of all transaction attempts. This dataset provides a detailed historical record of pending authorizations, which is essential for resolving customer disputes, verifying transaction histories, and satisfying regulatory compliance audits.
  • Fraud Detection and Risk Management: By capturing granular transaction details—such as merchant identifiers, transaction locations, and fraud-match indicators—this dataset provides the raw material needed for downstream risk-assessment engines and fraud-detection models to identify suspicious spending patterns.
  • Operational Efficiency: Storing high volumes of historical transaction details in the primary, active transactional database can degrade system performance. Extracting this detailed data into a sequential archive file ensures that the core credit card processing system remains fast, responsive, and highly available for real-time customer transactions.
  • Business Intelligence and Reporting: This dataset acts as a bridge to downstream data warehouses. Business analysts use this data to evaluate merchant performance, analyze consumer spending behaviors, and monitor authorization approval and decline rates.
Data Interaction and Flow

The dataset is populated through a structured batch extraction and archiving process:

  • Data Extraction: During scheduled batch processing, the job UNLDGSAM executes the utility program DBUNLDGS . This program sequentially scans the active transactional database to retrieve pending authorization records.
  • Validation and Relationship Preservation: The program validates the integrity of each account. For every valid account summary identified, the program extracts all associated detailed transaction records. This ensures that the granular transaction details remain logically linked to their parent account summaries.
  • Output Generation: The program writes these detailed transaction records directly into the AWS.M2.CARDDEMO.PAUTDB.CHILD.GSAM dataset. (Simultaneously, the high-level account summaries are written to a separate companion dataset).
  • Downstream Consumption: Once the extraction job completes successfully, this dataset is made available to downstream financial reporting systems, risk management platforms, and data warehousing applications for further analysis and long-term archiving.

AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO

The dataset AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO represents the master repository for high-level pending credit card pre-authorization summaries within the CardDemo application.

MAT analysis

Business Overview of the Pending Authorization Root Dataset

Business-Level Description

The dataset AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO represents the master repository for high-level pending credit card pre-authorization summaries within the CardDemo application.

In the credit card industry, a pre-authorization is a temporary hold placed on a cardholder’s account to verify that funds are available and that the card is valid before a transaction is finalized (for example, when booking a hotel room or renting a car). This specific dataset acts as the "Root" or header file, containing the primary account-level summary records for these active holds. It captures critical financial and operational metadata, such as overall account status, credit limits, current balances, and summary metrics of approved or declined authorization attempts.

Business Importance and Role

This dataset plays a vital role in risk management, financial control, and operational continuity for the credit card processing system:

  • Financial Risk Mitigation: By maintaining an accurate, consolidated view of pending pre-authorizations, the business can prevent cardholders from exceeding their credit limits, thereby reducing bad debt and credit risk.
  • Operational Synchronization: It serves as a critical bridge between batch processing systems and online transaction authorization. It ensures that the live, customer-facing systems have an up-to-date view of temporary holds and available credit.
  • Data Portability and Auditing: By consolidating hierarchical database records into a standardized sequential flat file, this dataset facilitates downstream business intelligence, financial auditing, fraud analysis, and data migration activities without impacting live transaction databases.
Job and Program Interactions

The dataset is positioned at the center of data extraction and synchronization processes, interacting with two primary batch operations:

1. Data Extraction and Archiving (The Unload Process)

During scheduled maintenance or end-of-day processing, the database unload job ( UNLDPADB running program PAUDBUNL ) extracts active pending authorization summaries from the live hierarchical database.

  • Interaction: The program reads the live database and writes the validated master header records directly into AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO .
  • Business Purpose: This secures a point-in-time snapshot of all pending authorizations for archiving, downstream reporting, or preparation for system migrations.
2. Database Population and Synchronization (The Load Process)

Conversely, when the live database needs to be populated, restored, or updated with batch-processed authorization data, the database load job ( LOADPADB running program PAUDBLOD ) is executed.

  • Interaction: The program reads AWS.M2.CARDDEMO.PAUTDB.ROOT.FILEO as an input source.
  • Business Purpose: It uses this summary data to safely rebuild or update the active pre-authorization database, ensuring that online credit checks and authorization services operate with the most current account limits and transaction histories.

AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM

The AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM dataset serves as a centralized, sequential repository for high-level summaries of pending credit card transactions.

MAT analysis

Business Overview of the Pending Authorization Summary Dataset

Business Description

The AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM dataset serves as a centralized, sequential repository for high-level summaries of pending credit card transactions.

When a cardholder initiates a purchase, the transaction is temporarily placed in a "pending" state while awaiting final settlement. This dataset captures the essential summary information of these active, pending authorizations. It provides a structured snapshot of outstanding financial commitments, account statuses, and credit utilization across the organization's entire cardholder base.

Business Importance and Role

This dataset plays a critical role in balancing daily operational performance with robust back-office financial management:

  • System Performance Optimization: By regularly extracting pending transaction data from the active, high-volume transactional database into this sequential file, the business prevents database bloat. This ensures that the core credit card processing systems remain fast, responsive, and reliable for consumers at the point of sale.
  • Financial Reporting and Liquidity Management: It provides downstream business units, such as finance and treasury, with the necessary data to analyze pending liabilities, credit limits, and cash flow projections without disrupting live customer transactions.
  • Audit and Regulatory Compliance: Financial institutions must maintain strict, immutable audit trails of all transaction attempts. This dataset acts as a historical archive of pending authorizations, supporting regulatory compliance reviews and internal audits.
  • Risk and Fraud Mitigation: Consolidating pending transaction summaries allows risk management systems and fraud analysts to monitor purchasing trends, identify unusual activity, and detect potential fraud before transactions are finalized.
Job and Program Interaction

The dataset is populated and maintained through a scheduled batch extraction and archiving process:

  • Data Extraction: The batch job UNLDGSAM executes the utility program DBUNLDGS to interface with the primary, live transactional database.
  • Data Validation: During execution, the program reads the active database and performs critical business-rule validations to ensure data integrity. Only records with valid, structured account identifiers are approved for extraction. Any corrupted or invalid records are bypassed to prevent downstream reporting errors.
  • Sequential Archiving: Once validated, the high-level summary records are written directly to this dataset ( AWS.M2.CARDDEMO.PAUTDB.ROOT.GSAM ).

By archiving this data into a sequential format, the business successfully decouples heavy analytical and reporting workloads from the core transactional engine, protecting the customer experience while enabling deep business intelligence.

AWS.M2.CARDDEMO.STATEMNT.HTML

The dataset AWS.M2.CARDDEMO.STATEMNT.HTML is a vital business asset within the credit card processing domain.

MAT analysis

Business Overview of the Cardholder HTML Statement Dataset

The dataset AWS.M2.CARDDEMO.STATEMNT.HTML is a vital business asset within the credit card processing domain. It contains the digital, web-ready version of monthly customer account statements, formatted specifically for modern electronic distribution channels.

Business-Level Description

This dataset represents the digital transformation of traditional credit card statements. While legacy systems historically relied on plain-text files for physical printing and archiving, this dataset stores statements in HTML format. It consolidates customer demographic information, account balances, credit summaries, and detailed transaction histories into structured, styled digital documents.

These HTML statements are designed for immediate integration into customer-facing digital touchpoints, such as:

  • Online Banking Portals : Allowing customers to view their statements interactively via a web browser.
  • Mobile Applications : Powering the statement-viewing features on smartphones and tablets.
  • Email Delivery Systems : Enabling the automated dispatch of monthly electronic statements directly to customers' inboxes.
Business Importance and Role

The dataset plays a critical role in modernizing customer communications and driving operational efficiency:

  • Enhanced Customer Experience : By providing structured HTML statements, the business delivers a visually appealing, easy-to-read, and professional layout of financial activities, which improves customer satisfaction and trust.
  • Cost Reduction : Supporting digital statement delivery directly contributes to "paperless billing" initiatives, significantly reducing the business's operational expenses related to paper, printing, and postage.
  • Digital Enablement : It serves as the bridge between legacy mainframe core processing and modern web-based distribution systems, ensuring that backend financial calculations are seamlessly translated into customer-friendly digital formats.
  • Operational Agility : Having a dedicated digital statement dataset allows the business to quickly feed downstream customer service applications, enabling support representatives to view the exact same statement layout as the customer during inquiries.
Job and Program Interactions

The dataset is managed and populated through a structured batch process that ensures data freshness and integrity:

Initialization and Cleanup (Job: CREASTMT , Step: STEP030 ) :

Before new statements are generated, the system utilizes a standard utility program ( IEFBR14 ) to clear out or delete the HTML dataset from the previous run. This prevents data duplication and ensures that only current billing cycle information is processed.

Data Aggregation and Generation (Job: CREASTMT , Step: STEP040 , Program: CBSTM03A ) :

The core statement generation program, CBSTM03A , is responsible for populating this dataset. The program sequentially processes cardholder accounts, retrieves their corresponding profile details and financial balances, and matches them with their transaction history for the billing cycle.

As it compiles this information, the program dynamically wraps the financial data in HTML tags and inline styles. It then writes these formatted digital documents directly into the AWS.M2.CARDDEMO.STATEMNT.HTML dataset, making them immediately available for downstream digital distribution.

AWS.M2.CARDDEMO.STATEMNT.PS

The AWS.M2.CARDDEMO.STATEMNT.PS dataset is the central repository for newly generated, plain-text credit card account statements.

MAT analysis

Credit Card Customer Account Statements Dataset

Business-Level Description

The AWS.M2.CARDDEMO.STATEMNT.PS dataset is the central repository for newly generated, plain-text credit card account statements. It represents the finalized billing cycle output for cardholders, capturing their demographic information, credit summaries, and detailed transaction ledgers for a specific billing period.

Rather than just storing raw data, this dataset holds fully formatted, human-readable statements. It serves as the primary "print-ready" master file from which customer communications are derived, capturing a complete snapshot of what a customer expects to see on their monthly bill.

Business Importance and Role

This dataset plays a critical role in the financial institution's customer relations, operational workflow, and compliance strategies:

  • Primary Customer Touchpoint: Monthly statements are the most frequent and critical communication channel between a credit card issuer and its customers. This dataset is the source of truth for those communications.
  • Operational Bridge to Digital Channels: While formatted in a traditional plain-text layout suitable for legacy printing and archiving, this dataset acts as the foundational input for modern digital distribution. It is the starting point for generating customer-facing PDFs and web-portal documents.
  • Financial Transparency and Trust: By accurately consolidating account balances, credit metrics, and individual transaction histories, the dataset ensures customers receive clear, reliable, and timely billing information.
  • Audit and Compliance: The sequential statements provide a historical, immutable record of billing activity, which is essential for regulatory compliance, dispute resolution, and financial auditing.
Job and Program Interactions

The dataset is managed and utilized through a structured batch processing lifecycle consisting of cleanup, generation, and downstream transformation:

1. Statement Generation ( CREASTMT Job)
  • Cleanup ( STEP030 / IEFBR14 ): Before a new billing run begins, the system references this dataset to delete any outdated or temporary statement files from previous cycles, ensuring data integrity and preventing duplicate billing records.
  • Data Aggregation and Formatting ( STEP040 / CBSTM03A ): This is the core creation step. The statement generation program processes cardholder cross-reference files, customer profiles, account balances, and transaction histories. It consolidates this information into formatted, customer-ready billing statements and writes them directly to the AWS.M2.CARDDEMO.STATEMNT.PS dataset.
2. Digital Transformation ( TXT2PDF1 Job)
  • PDF Conversion ( TXT2PDF Step / IKJEFT1B ): Once the plain-text statements are successfully generated, this post-processing job reads the AWS.M2.CARDDEMO.STATEMNT.PS dataset as its primary input. A conversion utility processes the text and formats it into a standard PDF document. This transformation enables the business to deliver statements electronically via email, archive them in digital document management systems, or publish them to online customer portals.

AWS.M2.CARDDEMO.SYSTRAN

The AWS.M2.CARDDEMO.SYSTRAN dataset serves as a critical staging repository for system-generated financial transactions within the credit card processing lifecycle.

MAT analysis

Business Overview of the System Transactions Dataset (AWS.M2.CARDDEMO.SYSTRAN)

Business-Level Description

The AWS.M2.CARDDEMO.SYSTRAN dataset serves as a critical staging repository for system-generated financial transactions within the credit card processing lifecycle. Unlike customer-initiated transactions (such as retail purchases or ATM withdrawals), this dataset captures automated, system-initiated financial events. The primary business events recorded here are monthly interest charges and finance fees calculated and applied by the system to outstanding customer account balances at the end of a billing cycle.

Business Importance and Role

This dataset plays a vital role in maintaining financial integrity, accounting accuracy, and operational efficiency:

  • Staging and Control: It acts as an intermediary buffer. By isolating system-generated transactions in a dedicated staging file, the business can perform complex batch calculations (like interest accruals) without directly impacting or locking the live master transaction database.
  • Financial Accuracy: It ensures that all automated monthly finance charges are systematically captured, formatted, and prepared for ledger posting, preventing discrepancies in customer billing.
  • Auditability: It provides a clear audit trail of automated system adjustments made during the billing cycle, allowing financial auditors to verify that interest calculations match the established disclosure terms before they are permanently committed to customer accounts.
Job and Program Interactions

The dataset is the central link between the interest calculation engine and the transaction consolidation process, interacting through two primary business phases:

1. Transaction Generation (Output Phase)

During the monthly billing cycle, the interest calculation job ( INTCALC ) processes customer account balances against their respective interest rate terms. For every calculated finance charge, the system generates an automated transaction record. These records are written directly into the AWS.M2.CARDDEMO.SYSTRAN dataset, capturing the calculated interest amounts, associated card details, and processing timestamps.

2. Transaction Consolidation and Posting (Input Phase)

Once the system-generated transactions are finalized, the transaction consolidation job ( COMBTRAN ) is executed. This job reads the newly generated transactions from AWS.M2.CARDDEMO.SYSTRAN and merges them with historical or backup transaction files. The consolidated stream is sorted and loaded into the primary transaction master database, updating the customer's official financial ledger and preparing the accounts for the next billing cycle.

AWS.M2.CARDDEMO.TCATBALF.BKUP

The AWS.M2.CARDDEMO.TCATBALF.BKUP dataset represents a point-in-time snapshot of credit card account balances, categorized by specific transaction types (such as retail purchases, cash advances, interest charges, or fees).

MAT analysis

Business Utility and Importance of the Transaction Category Balance Backup Dataset

1. Business-Level Description

The AWS.M2.CARDDEMO.TCATBALF.BKUP dataset represents a point-in-time snapshot of credit card account balances, categorized by specific transaction types (such as retail purchases, cash advances, interest charges, or fees).

In credit card portfolio management, tracking balances by category is essential for calculating interest, managing credit limits, and understanding consumer spending behavior. This dataset captures a sequential copy of these active balances from the live operational database, preserving a reliable historical record of financial positions at a specific moment in the business cycle.

2. Business Importance and Role

This dataset is a critical asset for operational integrity, risk management, and financial reporting:

  • Business Continuity and Risk Mitigation : Financial regulations require strict data protection standards. This dataset serves as a secure backup, ensuring that categorized balance information can be restored in the event of system anomalies, thereby safeguarding the core financial ledger.
  • Operational Performance Optimization : Running complex analytical queries or generating reports directly against live, customer-facing databases can degrade system performance and slow down real-time transaction authorization. This backup dataset acts as an offline staging area, allowing intensive reporting processes to run safely without impacting the customer experience.
  • Audit and Financial Reconciliation : The dataset provides the trusted baseline data used to generate structured audit reports. Financial analysts and auditors rely on this data to reconcile balances, verify ledger accuracy, and ensure compliance with banking standards.
3. Job and Program Interactions

The dataset serves as a vital intermediary bridge within the batch processing lifecycle, facilitating the transition from live operations to offline reporting:

  • The Extraction Phase (Data Capture) : A system utility extracts active balance records from the live online database and writes them directly into this backup dataset. This process secures a clean, uncompromised snapshot of the business's financial state.
  • The Reporting Phase (Data Utilization) : Once the backup is successfully created, downstream sorting and formatting programs read this dataset as their primary input. The data is systematically organized and transformed into highly readable, formatted reports ready for business distribution, auditing, and downstream financial systems.

AWS.M2.CARDDEMO.TCATBALF.PS

In credit card processing systems, tracking financial totals by specific transaction types—such as retail purchases, cash advances, dining, and travel—is essential for account maintenance, interest calculation, and financial reporting.

MAT analysis

Business Overview of the Transaction Category Balance Source Dataset

Business-Level Description

In credit card processing systems, tracking financial totals by specific transaction types—such as retail purchases, cash advances, dining, and travel—is essential for account maintenance, interest calculation, and financial reporting. The AWS.M2.CARDDEMO.TCATBALF.PS dataset serves as the primary sequential source file containing baseline or updated transaction category balance records.

This dataset acts as the foundational "golden copy" or staging area for category-specific financial balances. It holds the structured raw data required to initialize, reset, or refresh the active master database used by the CardDemo application.

Business Importance and Role

The dataset plays a vital role in ensuring the financial integrity, stability, and operational readiness of the credit card processing platform:

  • System Initialization and Recovery: It provides a clean, validated baseline to reset or restore transaction category balances. This is crucial during system deployments, testing cycles, or disaster recovery scenarios where the active database must be rebuilt from a trusted source.
  • Accurate Financial Reporting: By maintaining distinct balances for different transaction categories, the business can accurately track revenue streams, monitor consumer spending trends, and support regulatory reporting requirements.
  • Operational Continuity: It prevents data corruption and duplication by serving as the clean input source during database maintenance windows, ensuring that downstream customer-facing and back-office applications operate with accurate financial figures.
Job and Program Interactions

The dataset is integrated into the system's database maintenance and initialization workflows:

  • Data Loading and Refresh (Job TCATBALF): The primary interaction occurs during the execution of the database setup job. This job reads the sequential records from AWS.M2.CARDDEMO.TCATBALF.PS as its direct input.
  • Database Population: A system utility copies the data from this sequential file to populate the master Transaction Category Balance database.
  • Downstream Enablement: Once the data from this dataset is successfully loaded into the master database, it becomes actively accessible to online inquiry screens, customer service portals, and daily batch processing runs that manage ongoing credit card transactions.

AWS.M2.CARDDEMO.TCATBALF.REPT

The AWS.M2.CARDDEMO.TCATBALF.REPT dataset is the final, formatted Transaction Category Balance Report within the CardDemo credit card processing application.

MAT analysis

Transaction Category Balance Report Dataset

Business Overview

The AWS.M2.CARDDEMO.TCATBALF.REPT dataset is the final, formatted Transaction Category Balance Report within the CardDemo credit card processing application. It provides a structured, consolidated, and highly readable summary of financial balances categorized by specific transaction types (such as retail purchases, cash advances, interest charges, or fees) across all active customer accounts.

Rather than displaying raw, system-level data, this dataset presents financial information in a standardized layout, making it immediately accessible for business analysis, operational reviews, and financial oversight.

Business Importance and Value

This dataset plays a critical role in the daily financial operations and strategic management of the card program:

  • Financial Reconciliation and Accuracy: It serves as a key tool for accounting and finance teams to verify that daily transaction activities align perfectly with outstanding account balances, ensuring the integrity of the ledger.
  • Audit and Regulatory Compliance: Financial institutions are subject to strict regulatory oversight. This report provides a clear, point-in-time audit trail of category-specific balances, which is essential for internal audits and external regulatory reporting.
  • Business Intelligence and Portfolio Health: By analyzing balances across different transaction categories, business analysts can monitor portfolio performance, track fee-based revenue streams, evaluate interest accumulation, and gain insights into customer spending and repayment behaviors.
  • Operational Decision-Making: Management relies on this structured data to make informed decisions regarding credit limits, interest rate adjustments, promotional offers, and risk management strategies.
Workflow and System Interactions

The dataset is managed and populated through a structured batch processing job ( PRTCATBL ) that ensures data freshness and consistency:

  • Environment Preparation: At the start of the reporting cycle, the system performs a cleanup step to safely remove any outdated version of the report, ensuring that business decisions are always based on the most current data and preventing processing conflicts.
  • Data Extraction and Formatting: The system extracts active balance records from the core online database. A specialized sorting and formatting program organizes these records systematically—grouping them by customer account and transaction category—and converts raw numeric values into a standard decimal format suitable for business presentation.
  • Report Delivery: The finalized, sorted, and formatted records are written directly to this dataset, making it ready for distribution to business stakeholders, executive dashboards, or downstream financial reporting systems.

AWS.M2.CARDDEMO.TCATBALF.VSAM.KSDS

The Transaction Category Balance dataset acts as a specialized financial sub-ledger within the credit card processing system.

MAT analysis

Transaction Category Balance Ledger: Business Overview

Business-Level Description

The Transaction Category Balance dataset acts as a specialized financial sub-ledger within the credit card processing system. Rather than maintaining only a single, aggregate balance for a customer's account, this dataset tracks outstanding balances broken down by specific transaction categories (such as retail purchases, cash advances, travel, and dining).

In modern credit card operations, this granular tracking is essential. Different types of transactions often carry distinct financial rules, promotional terms, or interest rates. By maintaining balances at the category level, the business can execute sophisticated billing strategies, offer targeted promotions, and ensure precise financial accounting.

Business Importance and Role

This dataset is a cornerstone of the credit card platform's financial integrity and revenue generation. Its importance to the business includes:

  • Accurate Revenue Generation : It enables the system to apply different interest rates to different types of balances (for example, charging a higher interest rate on cash advances than on standard retail purchases), directly impacting the portfolio's profitability.
  • Billing Accuracy and Customer Trust : By maintaining a precise breakdown of how a customer's total balance is distributed, the business ensures that monthly statements are accurate, transparent, and compliant with consumer protection regulations.
  • Auditability and Compliance : Financial regulators require credit card issuers to demonstrate exactly how interest and fees are calculated. This dataset provides the historical, category-by-category balance details necessary to satisfy internal and external audits.
  • Operational Risk Mitigation : Serving as a point-in-time snapshot of customer liabilities, it supports daily reconciliation processes that detect processing anomalies or potential fraud early.
Job and Program Interactions

Several core batch processes interact with the Transaction Category Balance dataset to manage the lifecycle of credit card accounts, from daily spending to monthly billing and reporting.

1. Daily Transaction Posting (Job: POSTTRAN / Program: CBTRN02C )
  • Interaction : Input and Output (Read and Update)
  • Business Function : As customers use their cards daily, this process ingests raw transaction files, validates them, and updates the ledger. If a customer makes a new purchase or payment, the program retrieves the corresponding category balance, adjusts it by the transaction amount, and saves the updated balance. If a customer transacts in a new category for the first time, the program initializes a new balance record for that category.
2. Monthly Interest Calculation and Posting (Job: INTCALC / Program: CBACT04C )
  • Interaction : Input (Read)
  • Business Function : At the end of each billing cycle, this process reads the outstanding category balances to calculate monthly finance charges. It matches each category balance against the account's specific interest rate rules, computes the interest owed, generates system transactions to post those charges, and prepares the account balances for the next billing cycle.
3. Balance Reporting and Archiving (Job: PRTCATBL )
  • Interaction : Input (Read)
  • Business Function : To support business intelligence, management reporting, and risk management, this job unloads the active category balance data to create a point-in-time backup. It then sorts and formats this data into structured business reports, allowing auditors and financial analysts to review outstanding balances across the entire card portfolio.
4. Ledger Initialization and Recovery (Job: TCATBALF )
  • Interaction : Output (Write)
  • Business Function : This administrative process is responsible for the setup, reset, or recovery of the category balance ledger. It establishes the database structure and populates it with baseline or restored balance data, ensuring that downstream online and batch systems have a clean, validated starting point.

AWS.M2.CARDDEMO.TRANCATG.PS

The AWS.M2.CARDDEMO.TRANCATG.PS dataset serves as the primary staging and distribution file for Transaction Category reference data within the CardDemo credit card processing application.

MAT analysis

CardDemo Transaction Category Reference Data (AWS.M2.CARDDEMO.TRANCATG.PS)

Business Overview

The AWS.M2.CARDDEMO.TRANCATG.PS dataset serves as the primary staging and distribution file for Transaction Category reference data within the CardDemo credit card processing application. Transaction categories are standard business classifications used to group financial transactions into recognizable sectors, such as retail, dining, travel, utilities, and entertainment.

This dataset acts as a vital bridge between the system of record (the relational database) and the high-performance operational files used during daily batch runs and online transaction processing. It ensures that all transaction classification data is standardized, validated, and uniformly formatted before being consumed by downstream applications.

Business Importance and Value

Accurate transaction categorization is a cornerstone of modern credit card operations, directly impacting customer experience, financial reporting, and risk management:

  • Enhanced Customer Experience: Categorized transactions allow cardholders to see clear, structured breakdowns of their spending on monthly statements and mobile banking applications (e.g., "Food & Dining" vs. "Transportation").
  • Rewards and Loyalty Programs: Many credit card products offer specialized rewards (e.g., 3% cashback on groceries). This dataset provides the foundational rules that allow the system to identify which transactions qualify for specific promotional categories.
  • Financial Reporting and Compliance: Standardized categories ensure that internal financial audits, merchant category code (MCC) reporting, and regulatory compliance disclosures are accurate and consistent.
  • Operational Resilience: By maintaining a dedicated, sequential staging file, the business can safely refresh, back up, and restore transaction category definitions without disrupting active, real-time card authorization systems.
Operational Lifecycle and Job Interactions

This dataset is managed through a structured lifecycle of extraction, backup, and operational loading, coordinated by three key batch processes:

1. Data Extraction and Refresh

The dataset is populated by the TRANEXTR job. This process extracts the most up-to-date transaction category classifications directly from the master relational database. The job formats and standardizes this data into a sequential flat file structure, overwriting the active dataset with fresh reference data to ensure the system reflects the latest business classifications.

2. Business Continuity and Backup

To safeguard against data corruption and support disaster recovery, the dataset is backed up regularly:

  • During the TRANEXTR run, the existing version of the dataset is copied to a backup file before the refresh occurs.
  • The DEFGDGD job integrates this dataset into a version-controlled backup rotation (Generation Data Groups). This maintains up to five historical versions of the category data, establishing a reliable baseline for audits and system recovery.
3. Operational Loading

Once the sequential dataset is refreshed and verified, the TRANCATG job loads the data into a high-performance, indexed operational file (VSAM KSDS). This step is critical because it translates the flat reference data into an optimized format that online credit card processing systems can query with sub-second latency during real-time transaction authorization and posting.

AWS.M2.CARDDEMO.TRANCATG.PS.BKUP

The dataset AWS.M2.CARDDEMO.TRANCATG.PS.BKUP serves as the secure, version-controlled backup repository for Transaction Category reference data within the CardDemo credit card processing application.

MAT analysis

Business Utility and Importance of the Transaction Category Backup Dataset

Business Overview

The dataset AWS.M2.CARDDEMO.TRANCATG.PS.BKUP serves as the secure, version-controlled backup repository for Transaction Category reference data within the CardDemo credit card processing application.

In credit card processing, transaction categories are critical business rules used to classify financial transactions (such as retail, dining, travel, or entertainment). These classifications dictate how transactions are reported, how rewards or fees are calculated, and how statements are generated for cardholders. Because these categories directly impact financial reporting and customer billing, maintaining a reliable history of this data is vital for business operations.

This dataset is structured as a Generation Data Group (GDG), which automatically maintains up to five historical versions of the transaction category classifications. This ensures that the business always has access to recent, historically accurate configurations.

Business Importance and Role

The transaction category backup dataset plays a critical role in risk management, operational stability, and regulatory compliance:

  • Operational Resilience and Disaster Recovery: If a system failure, database corruption, or erroneous update affects the active transaction processing environment, this dataset provides an immediate rollback mechanism. The business can quickly restore a previous, verified version of the transaction categories to prevent processing delays or billing errors.
  • Audit and Compliance: Financial institutions are subject to strict regulatory audits. This dataset preserves historical versions of transaction classifications, allowing auditors to verify the exact business rules that were in place when historical transactions were processed.
  • Data Integrity during Refreshes: Before any automated updates or database refreshes occur, the system secures the existing state of transaction categories in this backup. This guarantees that the business never loses its previous operational state during routine maintenance.
Job and Program Interactions

Two key batch processes interact with this dataset to manage its lifecycle and ensure continuous data protection:

Infrastructure Setup and Initialization (Job: DEFGDGD )

This job is responsible for establishing the version-controlled backup framework. It defines the backup structure in the system catalog and immediately populates the very first backup generation by copying the active production transaction category data. This establishes a secure baseline before any subsequent processing occurs.

Routine Maintenance and Data Refresh (Job: TRANEXTR )

During regular business processing, transaction category definitions may be updated in the master database. Before these updates are applied to the active files, this job automatically archives the current active transaction category data into a new generation of this backup dataset. Once the backup is safely secured, the job proceeds to refresh the active files with the latest database updates. This ensures a seamless, risk-free update cycle.

AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS

The AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS dataset serves as the centralized master reference repository for transaction categories within the CardDemo credit card processing system.

MAT analysis

Business Utility: Transaction Category Reference Dataset

Business-Level Description

The AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS dataset serves as the centralized master reference repository for transaction categories within the CardDemo credit card processing system. It stores the standard classifications used to group and identify financial transactions, such as retail purchases, dining, travel, entertainment, and utilities.

By maintaining a single, authoritative source for these classifications, the system ensures that all financial activities are categorized uniformly across the organization.

Business Importance and Role

This dataset plays a critical role in financial reporting, operational integrity, and customer experience:

  • Data Standardization and Consistency: It prevents discrepancies by ensuring that every transaction is mapped to an officially recognized business category. This consistency is vital for downstream accounting and general ledger systems.
  • Information Enrichment: Raw transaction records typically contain compact, system-generated codes to optimize processing speed. This dataset acts as a translation key, converting those cryptic codes into clear, human-readable descriptions.
  • Financial Auditing and Compliance: Accurate categorization is essential for internal audits, regulatory reporting, and tax compliance. It allows auditors to verify that transactions are being classified correctly according to corporate and legal standards.
  • Business Intelligence and Analytics: By enabling clear categorization, this dataset supports business analysts in tracking consumer spending trends, evaluating merchant category performance, and developing targeted marketing campaigns.
System Interactions and Data Flow

The dataset is integrated into both administrative maintenance workflows and daily financial reporting cycles:

1. Reference Data Maintenance (Job: TRANCATG )

To ensure the system operates with the most current business definitions, this administrative job performs routine maintenance on the dataset. It clears out legacy or stale records and performs a clean load of fresh, authorized transaction category reference data from a sequential source file. This process is typically executed during system deployment, environment refreshes, or scheduled maintenance windows when new transaction categories are introduced by the business.

2. Daily Financial Reporting and Reconciliation (Job: TRANREPT / Program: CBTRN03C )

During end-of-day batch processing, the system generates the Daily Transaction Report, which is used by finance teams to reconcile accounts and monitor daily operations.

  • As the reporting program processes the day's raw transaction ledger, it queries this transaction category dataset in real-time.
  • It retrieves the descriptive category names associated with each transaction's classification code.
  • This enriched information is printed directly onto the final report, transforming raw data into an actionable financial document for business stakeholders and auditors.

AWS.M2.CARDDEMO.TRANREPT

The AWS.M2.CARDDEMO.TRANREPT dataset is the final, formatted output repository for the Daily Transaction Report within the CardDemo credit card management system.

MAT analysis

Business Utility and Importance of the Daily Transaction Report Dataset (AWS.M2.CARDDEMO.TRANREPT)

Business-Level Description

The AWS.M2.CARDDEMO.TRANREPT dataset is the final, formatted output repository for the Daily Transaction Report within the CardDemo credit card management system. Rather than storing raw, system-level data, this dataset contains a highly structured, human-readable document designed for business users. It provides a comprehensive, chronological log of credit card transactions executed within a specified reporting window. The report is organized by cardholder account and features clear financial summaries, including account-level sub-totals, page-level totals, and overall grand totals.

Business Importance and Role

This dataset plays a critical role in the daily financial and operational management of the credit card business. Its primary business functions include:

  • Financial Auditing and Compliance: It serves as an official, time-stamped audit trail of daily financial activities. This is essential for maintaining regulatory compliance and supporting both internal and external financial audits.
  • Account Reconciliation: Financial analysts and accounting teams rely on this report to reconcile daily transaction volumes and monetary amounts against general ledger balances. This ensures that all processed transactions are accounted for and helps identify discrepancies or processing errors immediately.
  • Operational Oversight: The report provides management with visibility into daily cardholder activity, transaction volumes, and spending patterns. This operational intelligence supports risk management and strategic decision-making.
  • Business-Friendly Data Enrichment: By translating raw, technical system codes (such as transaction types and category identifiers) into clear, descriptive business terms, the dataset ensures that operational staff can easily interpret and act upon the report's contents without needing technical system knowledge.
Job and Program Interactions

The creation of the AWS.M2.CARDDEMO.TRANREPT dataset is the culmination of a structured batch processing workflow:

  • Job TRANREPT (Daily Transaction Reporting and Reconciliation): This batch job orchestrates the entire reporting lifecycle. It begins by backing up the active transaction ledger, filtering the transactions to isolate only those within the requested business date range, and sorting the records by cardholder. Once the data is prepared, the job executes the reporting program to populate this dataset.
  • Program CBTRN03C (Daily Transaction Detail Reporting and Reconciliation Program): This program is the core reporting engine that directly writes to the AWS.M2.CARDDEMO.TRANREPT dataset. It processes the sorted transaction data sequentially. For each transaction, it performs real-time lookups against customer cross-reference files and transaction category master files to enrich the raw data with descriptive text. It manages the report's layout by inserting standardized headers, calculating page-level and account-level financial totals, and writing the final, polished multi-page report into the dataset.

AWS.M2.CARDDEMO.TRANSACT.BKUP

The AWS.M2.CARDDEMO.TRANSACT.BKUP dataset serves as the central historical ledger and safety backup for all credit card transactions processed within the CardDemo application.

MAT analysis

Business Overview of the Transaction Backup and History Dataset

The AWS.M2.CARDDEMO.TRANSACT.BKUP dataset serves as the central historical ledger and safety backup for all credit card transactions processed within the CardDemo application. It acts as a critical bridge between daily online transaction processing, financial reporting, and system maintenance. By storing a complete snapshot of historical transaction records, this dataset ensures that the business maintains a continuous, auditable, and secure record of all customer financial activities.

Business Importance and Role

This dataset is vital to the organization's financial operations, risk management, and compliance frameworks for several key reasons:

  • Data Protection and Business Continuity: Before any destructive database maintenance or initialization occurs, this dataset captures the current state of the active transaction ledger. This prevents data loss and provides a reliable recovery point in the event of system failures.
  • Financial Auditing and Compliance: Financial institutions are legally required to maintain accurate, immutable records of transactions. This dataset serves as the historical source of truth used to generate daily audit reports, reconcile accounts, and resolve customer disputes.
  • Operational Integrity: By archiving older transactions, the system can safely clear and optimize the active database for high-performance daily operations without losing historical context. It also allows the business to merge past transaction history with newly generated transactions to keep the master database complete and up-to-date.
Operational Workflow and Job Interactions

The dataset is utilized across multiple core batch processes, serving as both a secure destination for active data and a starting point for downstream processing.

1. Securing and Archiving Active Transactions (Writing to the Dataset)

During routine maintenance cycles (managed by jobs like TRANBKP and TRANREPT ), the system unloads the active transaction database into this backup dataset. This operation secures all processed transactions before the active database is cleared and prepared for the next business cycle. This ensures that no transaction history is lost during system resets.

2. Financial Reporting and Reconciliation (Reading from the Dataset)

When the business requires daily financial summaries, the TRANREPT job reads this backup dataset. The job filters the historical records for a specific date range and sorts them to generate the Daily Transaction Report. This report is used by business analysts and auditors to verify account balances, track spending patterns, and perform daily reconciliations.

3. Transaction Consolidation and Master Database Updates (Reading from the Dataset)

To ensure the master transaction database remains comprehensive, the COMBTRAN job reads this backup dataset and merges its historical records with newly generated system transactions. This consolidated data is then sorted and loaded back into the primary transaction database, ensuring that customer-facing applications (like online banking portals or customer service screens) have access to a complete and seamless transaction history.

AWS.M2.CARDDEMO.TRANSACT.COMBINED

The AWS.M2.CARDDEMO.TRANSACT.COMBINED dataset serves as the central, consolidated staging repository for credit card transactions within the CardDemo application.

MAT analysis

Business Overview of the Combined Transaction Dataset (AWS.M2.CARDDEMO.TRANSACT.COMBINED)

Business-Level Description

The AWS.M2.CARDDEMO.TRANSACT.COMBINED dataset serves as the central, consolidated staging repository for credit card transactions within the CardDemo application. It acts as a unified collection point, merging newly generated transactions from recent operational cycles with historical or backup transaction records. By combining these two streams, the dataset provides a complete, chronological, and unified view of all financial activities before they are finalized in the core system of record.

Business Importance and Role

This dataset plays a critical role in maintaining financial accuracy, operational efficiency, and data integrity across the credit card processing lifecycle:

  • Ensuring a Complete Audit Trail: By merging active daily transactions with historical backups, the business maintains a continuous, unbroken history of customer financial activities. This prevents data loss and ensures that no transactions are missed during system updates.
  • Optimizing Database Performance: Updating a master database with unsorted or fragmented data can lead to processing bottlenecks and system degradation. This dataset acts as an optimized preparation layer, organizing transactions sequentially so they can be loaded into the master database efficiently. This minimizes processing windows and ensures that downstream systems remain highly responsive.
  • Supporting Customer Service and Trust: Accurate and timely transaction updates ensure that customer-facing portals, mobile applications, and customer service representatives have access to the most current account balances and transaction histories, directly impacting customer satisfaction and trust.
  • Facilitating Compliance and Reporting: Clean, consolidated transaction data is foundational for downstream business functions, including fraud detection, regulatory compliance reporting, and financial auditing.
System and Program Interactions

The dataset serves as the vital bridge between daily transaction processing and the permanent master database. It is utilized in a two-step batch process:

  • Consolidation and Ordering: The system gathers pending transactions from recent operational cycles and merges them with existing historical backups. It then organizes this combined pool into a strict sequential order based on unique transaction identifiers, saving the finalized, ordered list into this combined dataset.
  • Master Database Synchronization: Once the combined dataset is prepared, a subsequent system process reads this file to perform a bulk update of the primary transaction master database. This ensures the master database is fully synchronized and ready for online inquiries and subsequent business day processing.

AWS.M2.CARDDEMO.TRANSACT.DALY

The AWS.M2.CARDDEMO.TRANSACT.DALY dataset serves as the primary staging area for daily credit card transaction data within the CardDemo system.

MAT analysis

Daily Transaction Staging Dataset (AWS.M2.CARDDEMO.TRANSACT.DALY)

Business Overview

The AWS.M2.CARDDEMO.TRANSACT.DALY dataset serves as the primary staging area for daily credit card transaction data within the CardDemo system. It contains a highly focused, pre-filtered subset of financial transactions that occurred within a specific business reporting window. To facilitate structured reporting and analysis, these transactions are organized systematically by cardholder, allowing the business to review activities on an account-by-account basis.

Rather than processing the entire historical transaction ledger, this dataset acts as a curated "working file" that captures only the active transactions needed for the current business day's reporting cycle.

Business Importance and Role

This dataset plays a critical role in the daily financial operations and risk management of the credit card business:

  • Financial Reconciliation and Auditing: It is the foundation for daily financial balancing. By isolating a single day's or period's activities, it allows accounting and audit teams to verify that all processed transactions match expected totals, ensuring complete financial integrity.
  • Operational Efficiency: Processing millions of historical credit card transactions daily is resource-intensive. This dataset optimizes batch processing operations by filtering out unnecessary historical data, ensuring that downstream reporting systems only process relevant, active records.
  • Structured Customer Insights: By pre-sorting transactions by cardholder, the dataset enables the business to view a consolidated timeline of an individual customer's daily spending behavior, which is essential for customer service, dispute resolution, and fraud monitoring.
  • Streamlined Reporting: It serves as the direct source of truth for generating the final Daily Transaction Report, which management and operational oversight teams rely on for daily decision-making.
Job and Program Interactions

The dataset acts as a vital bridge between raw transaction logging and final business reporting during the daily batch cycle:

1. Data Extraction and Preparation (The Creator)

During the daily batch run, a sorting and filtering job step accesses the main transaction ledger. It filters out transactions that fall outside the desired reporting dates and sorts the remaining records by cardholder. The resulting curated list is written directly into the AWS.M2.CARDDEMO.TRANSACT.DALY dataset.

2. Report Generation and Enrichment (The Consumer)

Once the staging dataset is prepared, the Daily Transaction Detail Reporting program reads it sequentially. As the program processes this dataset, it performs automated lookups against customer cross-reference and transaction category files to translate raw codes into human-readable descriptions. This enriched data is then formatted into the final Daily Transaction Report, complete with account-level subtotals, page totals, and grand financial totals.

AWS.M2.CARDDEMO.TRANSACT.IMPORT

The AWS.M2.CARDDEMO.TRANSACT.IMPORT dataset serves as a critical staging repository for financial transaction data during credit card branch migration activities.

MAT analysis

Credit Card Transaction Migration Staging Dataset

Business Overview

The AWS.M2.CARDDEMO.TRANSACT.IMPORT dataset serves as a critical staging repository for financial transaction data during credit card branch migration activities. When credit card portfolios are migrated from legacy systems or external branches into the core CardDemo application, all historical and pending financial activities—such as purchases, payments, refunds, and adjustments—must be safely transferred. This dataset holds the newly standardized and isolated transaction records, preparing them for seamless integration into the core financial ledger and customer account databases.

Business Importance and Role

This dataset plays a vital role in maintaining operational integrity and financial accuracy during system transitions:

  • Financial Continuity and Accuracy : Transactions represent the core financial history of cardholders. Ensuring these records are accurately captured and isolated prevents discrepancies in account balances, interest calculations, and billing statements.
  • Auditability and Compliance : Financial institutions are subject to strict regulatory standards. This dataset provides a clean, auditable trail of migrated transactions, ensuring that every historical charge or payment can be verified post-migration.
  • Customer Experience : A seamless migration relies on preserving transaction history. If transaction records are lost or corrupted, customers cannot view their past statements, leading to disputes, customer service overload, and reputational damage.
Job and Program Interaction

The dataset is populated during the execution of the CBIMPORT batch job, specifically by the CBIMPORT program:

  • Data Extraction and Isolation : The CBIMPORT program acts as an ETL (Extract, Transform, Load) engine. It reads a single, consolidated migration file containing mixed data types (customers, accounts, cards, and transactions).
  • Standardization : When the program identifies a transaction-related record, it extracts the data, translates legacy or compressed formats into standardized business formats, and writes the clean transaction record directly to the AWS.M2.CARDDEMO.TRANSACT.IMPORT dataset.
  • Downstream Readiness : Once the batch job completes successfully, this dataset serves as the clean, validated source of truth for downstream processes that load transaction history into the core operational databases.

AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS

The AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS dataset serves as the Transaction Master Ledger for the CardDemo credit card processing application.

MAT analysis

Credit Card Transaction Master Ledger (AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS)

Business Overview

The AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS dataset serves as the Transaction Master Ledger for the CardDemo credit card processing application. It is the central, authoritative system of record for all financial transactions executed by cardholders. Every purchase, payment, cash advance, and fee associated with the credit cards managed by the institution is permanently recorded and maintained within this dataset.

As a core financial ledger, this dataset provides the historical and real-time transactional foundation required to support customer billing, financial auditing, credit limit management, and regulatory compliance.

Business Importance and Role

The Transaction Master Ledger is critical to the daily operations and financial integrity of the credit card business. Its primary roles include:

  • Financial Accuracy and Trust : It maintains the definitive history of customer spending and payments, which directly impacts account balances, credit availability, and billing accuracy.
  • Regulatory Compliance and Auditing : Financial institutions are legally required to maintain immutable, traceable records of all monetary transactions. This dataset serves as the primary source for financial audits and dispute resolutions.
  • Customer Experience : It feeds downstream customer-facing channels, enabling cardholders to view their transaction histories online and receive accurate monthly statements.
  • Risk Management : By tracking transaction histories, the business can analyze spending patterns, monitor credit utilization, and support fraud detection mechanisms.
How Business Processes and Jobs Interact with the Dataset

The lifecycle of transaction data—from ingestion and validation to reporting, statement generation, and archiving—is managed through a series of batch jobs and programs that interact with this master dataset.

1. Daily Transaction Posting and Validation

During daily processing cycles, new credit card transactions generated across the network must be validated and posted.

  • Posting Process ( POSTTRAN / CBTRN02C ) : This process acts as the gatekeeper for the ledger. It ingests raw daily transactions, validates them against customer account rules (such as active status and credit limits), and writes successfully approved transactions into the Transaction Master Ledger.
  • Consolidation and Master Load ( COMBTRAN / IDCAMS ) : This process merges newly generated system transactions with historical backups, sorting and loading them into the master ledger to ensure the database remains consolidated, organized, and optimized for quick retrieval.
2. Customer Statement Generation

At the end of a billing cycle, the business must provide cardholders with clear, formatted statements.

  • Statement Generation ( CREASTMT ) : This process reads transaction records directly from the master ledger, groups them by cardholder, and merges them with customer demographic data to generate both printed (plain-text) and digital (HTML) monthly statements.
3. Financial Auditing and Reconciliation

To ensure operational oversight and financial control, the business requires regular reporting.

  • Daily Transaction Reporting ( TRANREPT / CBTRN03C ) : This process extracts data from the master ledger to generate formatted Daily Transaction Reports. These reports summarize transaction activities within specific date ranges, allowing financial analysts to perform daily reconciliations and audits.
4. Business Continuity and Database Maintenance

To safeguard financial records against system failures and maintain database performance, routine maintenance is performed.

  • Database Backup ( TRANBKP ) : This process creates a secure, sequential backup of the active Transaction Master Ledger. Once the backup is verified, the active database is safely reinitialized to prepare for the next processing cycle, ensuring historical data is preserved.
  • Database Initialization ( TRANFILE ) : This process manages the transition of transaction data between batch processing and online systems (such as CICS). It refreshes the master ledger with daily batch data and establishes secondary search paths (alternate indexes) so customer service representatives can perform rapid transaction lookups in real-time.
5. System Integration and Data Migration

When the business undergoes restructuring, such as branch migrations or system upgrades, transaction data must be shared with downstream systems.

  • Data Export ( CBEXPORT / CBEXPORT ) : This utility performs a comprehensive extraction of the Transaction Master Ledger, consolidating it with customer profiles, account statuses, and card details into a single, standardized export file for downstream integration or migration.

AWS.M2.CARDDEMO.TRANTYPE.BKUP

The AWS.M2.CARDDEMO.TRANTYPE.BKUP dataset serves as the historical backup repository for Transaction Type reference data within the CardDemo credit card processing application.

MAT analysis

Business Summary: Transaction Type Backup Dataset (AWS.M2.CARDDEMO.TRANTYPE.BKUP)

Business Overview

The AWS.M2.CARDDEMO.TRANTYPE.BKUP dataset serves as the historical backup repository for Transaction Type reference data within the CardDemo credit card processing application.

Transaction types are foundational business rules that define and classify card activities—such as standard purchases, cash advances, refunds, reversals, and fee assessments. This dataset is structured as a version-controlled Generation Data Group (GDG), which automatically maintains multiple historical snapshots (up to five generations) of these transaction definitions. This ensures that the business has a reliable, time-series record of how transactions were classified and processed over different operational cycles.

Business Importance and Role

This dataset plays a critical role in maintaining the stability, compliance, and integrity of the card processing platform:

  • Operational Resilience and Disaster Recovery: In credit card processing, reference data must be highly accurate and continuously available. If a system update, database refresh, or batch processing error corrupts the active transaction type definitions, this backup dataset allows operations teams to immediately restore the system to a known, stable state, preventing costly processing disruptions.
  • Auditability and Regulatory Compliance: Financial institutions are subject to strict regulatory oversight and regular audits. Maintaining historical versions of transaction definitions allows the business to reconstruct past processing states, proving to auditors exactly how transactions were categorized and handled at any specific point in time.
  • Data Integrity Safeguards: By capturing a snapshot of the reference data immediately before any major database extraction or batch update, the business ensures that active processing rules are never permanently lost or overwritten without a recovery point.
Job and Program Interactions

The dataset is managed and updated through automated batch jobs that secure the data during key lifecycle events:

Infrastructure Initialization ( DEFGDGD ):

This job is responsible for establishing the version-controlled backup framework. It initializes the backup structure and immediately populates the first historical generation using the active production transaction type reference data. This establishes a secure baseline before any subsequent batch processing or updates occur.

Pre-Refresh Archiving ( TRANEXTR ):

During routine data maintenance, the system extracts fresh transaction type definitions from the core relational database to refresh active files. Before this refresh occurs, the TRANEXTR job automatically copies the existing active transaction type file into a new generation of this backup dataset. This "backup-before-refresh" pattern ensures that a safety net is always created, allowing the business to roll back to the previous day's definitions if the new database extract is corrupted or incomplete.

AWS.M2.CARDDEMO.TRANTYPE.PS

The AWS.M2.CARDDEMO.TRANTYPE.PS dataset serves as the master reference file for Transaction Types within the CardDemo credit card processing application.

MAT analysis

Business Summary of the Transaction Type Reference Dataset

Business-Level Description

The AWS.M2.CARDDEMO.TRANTYPE.PS dataset serves as the master reference file for Transaction Types within the CardDemo credit card processing application. In the payment card industry, transactions must be categorized precisely—such as standard purchases, cash advances, deposits, refunds, or reversals. This dataset acts as the standardized dictionary for these transaction types, ensuring that every financial activity processed by the system is recognized, validated, and handled according to established business rules.

Business Importance and Role

This dataset is a foundational asset for the credit card processing lifecycle, playing a critical role in several key business areas:

  • Operational Consistency: It provides a single source of truth for transaction classifications. This ensures that downstream systems—including billing, interest calculation, rewards programs, and customer statement generation—interpret transaction codes identically.
  • Real-Time Validation: The data in this file is used to populate high-performance lookup structures. These structures are accessed during real-time transaction authorization to verify that incoming transaction codes are valid before a purchase is approved.
  • Regulatory Compliance and Auditing: Accurate transaction classification is vital for financial reporting and regulatory compliance. By maintaining a controlled, historical record of transaction types, the business can confidently support financial audits and resolve cardholder disputes.
  • Business Continuity: The dataset is integrated into automated backup routines, ensuring that reference data can be quickly restored in the event of a system failure, thereby minimizing operational downtime.
How Jobs and Programs Interact with the Dataset

The dataset is managed and utilized through a structured lifecycle involving data extraction, backup protection, and operational loading:

1. Data Extraction and Synchronization (Job: TRANEXTR)

The dataset is periodically refreshed to reflect the latest business definitions. A database extraction process unloads the most up-to-date transaction type definitions from the relational database of record (the system of truth) and writes them into this sequential dataset. This ensures that any new transaction types introduced by the business are synchronized with the batch processing environment.

2. Business Continuity and Version Control (Jobs: DEFGDGD and TRANEXTR)

To safeguard against data corruption and support historical auditing, the system automatically backs up this dataset.

  • Before the dataset is refreshed with new database records, backup jobs copy the existing data into a version-controlled history group (Generation Data Group).
  • The system retains multiple historical generations of this data, allowing administrators to restore previous reference states or audit past transaction behaviors if discrepancies arise.
3. Operational Loading for Real-Time Systems (Job: TRANTYPE)

Once the sequential dataset is refreshed and validated, it serves as the staging source for operational systems. A dedicated initialization job reads this dataset and loads its contents into a high-speed, indexed file structure (VSAM). This indexed structure is optimized for rapid access, enabling online customer-facing applications and nightly batch processing runs to perform instantaneous lookups on transaction codes.

AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS

The AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS dataset serves as the central reference registry for transaction classifications within the CardDemo credit card management system.

MAT analysis

Business Dataset Profile: Transaction Type Reference Data

Business-Level Description

The AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS dataset serves as the central reference registry for transaction classifications within the CardDemo credit card management system. In financial systems, individual transactions are recorded using compact, standardized codes to optimize storage and processing speed. This dataset acts as the "translation dictionary" that maps those abstract system codes to human-readable descriptions of financial activities, such as retail purchases, cash advances, deposits, fee assessments, or payment reversals.

By maintaining these definitions in a dedicated, indexed reference file, the system ensures that all downstream applications, customer service portals, and financial reports use consistent and standardized terminology.

Business Importance and Role

This dataset plays a critical role in the daily operations, financial auditing, and customer service functions of the credit card business:

  • Financial Transparency and Auditing: Raw transaction logs are difficult for human auditors or business analysts to interpret without context. This dataset enables the system to enrich raw data, transforming cryptic codes into clear, descriptive terms. This is vital for regulatory compliance, internal audits, and financial reconciliation.
  • Operational Consistency: By serving as a single source of truth, this dataset guarantees that a specific transaction code is interpreted identically across all business units—whether on a customer's monthly statement, an internal management report, or during a customer service inquiry.
  • System Performance: Organized as an indexed structure, the dataset is optimized for high-speed, real-time lookups. This allows both high-volume batch reporting jobs and online customer-facing applications to retrieve transaction descriptions instantly without degrading system performance.
System Interactions and Data Flow

The dataset is positioned at the intersection of reference data maintenance and daily financial reporting. It is utilized in two primary business contexts:

1. Reference Data Maintenance and Synchronization

The dataset is managed and kept up to date through the TRANTYPE batch job.

  • Role: This is an administrative utility process that performs a clean reset of the transaction type registry.
  • Interaction: It clears any outdated or stale records and loads the latest, validated transaction type definitions from a master sequential source file into this indexed dataset. This synchronization ensures that any new transaction categories introduced by the business are immediately available to the system.
2. Daily Financial Reporting and Reconciliation

During end-of-day processing, the dataset is accessed by the TRANREPT job, specifically through the reporting program CBTRN03C .

  • Role: This process generates the Daily Transaction Report, which is used by management and auditors to review the day's financial activities.
  • Interaction: As the reporting program processes the daily transaction ledger, it performs rapid, automated lookups against this dataset. By matching the transaction codes found in the ledger with the descriptions stored in this reference file, the program enriches the final report with clear, descriptive names, converting raw operational data into meaningful business intelligence.

AWS.M2.CARDDEMO.TRXFL.SEQ

The AWS.M2.CARDDEMO.TRXFL.SEQ dataset serves as a vital intermediate staging area for credit card transaction data during the statement generation cycle.

MAT analysis

Business Utility and Importance of the Cardholder Transaction Staging Dataset (AWS.M2.CARDDEMO.TRXFL.SEQ)

Business-Level Description

The AWS.M2.CARDDEMO.TRXFL.SEQ dataset serves as a vital intermediate staging area for credit card transaction data during the statement generation cycle. It holds a consolidated, sorted, and restructured version of raw transaction records, specifically organized to facilitate efficient matching with individual customer accounts. By transforming raw operational logs into an organized sequential format, this dataset prepares transaction histories for downstream financial reporting and customer communication.

Business Importance and Role

In the credit card industry, delivering accurate, clear, and timely statements is fundamental to maintaining customer trust, resolving billing inquiries, and meeting regulatory compliance standards. This dataset plays a critical role in this process by:

  • Optimizing Batch Processing Windows: Processing millions of raw, unsorted transactions directly during statement generation would be highly inefficient. This dataset pre-organizes the data, drastically reducing the processing time and system resources required to generate statements.
  • Ensuring Financial Accuracy: By establishing a structured and sorted sequence of transactions, the business ensures that every purchase, payment, and fee is accurately attributed to the correct cardholder account before balances are calculated.
  • Enabling Multi-Channel Customer Delivery: The structured data prepared within this dataset ultimately enables the business to generate statements in multiple formats simultaneously—supporting both traditional printed paper statements for archiving and modern digital HTML statements for online customer portals.
Job and Program Interactions

This dataset acts as a operational bridge within the automated statement generation pipeline ( CREASTMT ):

  • Data Preparation and Sorting: The process begins when a sorting program reads raw, unsorted transaction logs. It restructures and sorts these records by cardholder and transaction sequence, writing the organized output directly into the AWS.M2.CARDDEMO.TRXFL.SEQ sequential dataset.
  • Database Loading for Reporting: Once the sequential staging file is populated, a system utility reads it to load the structured data into an indexed, high-performance temporary database. This indexed database is then queried by the core statement-generation application to compile the final customer-facing reports.

AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS

The AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS dataset serves as a specialized, optimized repository of credit card transactions prepared specifically for the customer billing and statement generation cycle.

MAT analysis

Business Overview of the Cardholder Transaction Statement Dataset

Business-Level Description

The AWS.M2.CARDDEMO.TRXFL.VSAM.KSDS dataset serves as a specialized, optimized repository of credit card transactions prepared specifically for the customer billing and statement generation cycle. Rather than processing raw, unsorted transaction logs directly—which would be highly inefficient—this dataset holds a restructured and indexed version of the transaction history. It groups and organizes financial activities by individual credit card accounts, making the data ready for immediate matching with customer profiles and account balances.

Business Importance and Role

In the credit card industry, delivering accurate, clear, and timely account statements is critical for maintaining customer trust, ensuring regulatory compliance, and facilitating prompt payments. This dataset plays a vital role in this process by acting as a high-performance data bridge.

By pre-organizing transaction records, it enables the statement generation system to run highly efficient lookups. This minimizes system processing time, reduces operational costs, and ensures that every transaction during the billing cycle is correctly attributed to the right cardholder. Ultimately, it supports the seamless, high-volume delivery of both traditional printed statements and modern digital/HTML statements to customers.

Job and Program Interactions

This dataset is dynamically managed and utilized during the statement generation batch cycle through the following interactions:

  • Data Preparation and Loading (Job: CREASTMT ) : During the initial phases of the statement generation job, raw transaction data is extracted, sorted, and restructured. This organized data is then loaded into this dataset to establish a high-performance index.
  • Statement Generation (Program: CBSTM03A ) : The core statement generation program reads this dataset at startup. It loads the transaction histories into memory, grouping them by cardholder. The program then matches these transactions with customer demographic details and account balances to compile and output the final customer-facing statements in both plain-text and web-ready HTML formats.

AWS.M2.CARDDEMO.USRSEC.PS

The AWS.M2.CARDDEMO.USRSEC.PS dataset serves as the primary staging repository for user security and access control profiles within the CardDemo application.

MAT analysis
CardDemo User Security Staging Dataset: Business Overview
Business-Level Description

The AWS.M2.CARDDEMO.USRSEC.PS dataset serves as the primary staging repository for user security and access control profiles within the CardDemo application. It acts as a secure, temporary holding area for foundational identity data, capturing the initial set of system users and distinguishing between administrative personnel and standard business users.

By holding these baseline security profiles, the dataset facilitates the safe setup, reset, and initialization of the application's security infrastructure, ensuring that user identities and their associated access levels are properly defined before they are deployed to the active system.

Business Importance and Role

In credit card processing and financial management systems, robust Identity and Access Management (IAM) is a critical operational and compliance requirement. This dataset plays a vital role in the business in several ways:

  • Foundational Security and Access Control: It establishes the initial security boundaries of the application, ensuring that administrative privileges (such as system configuration and user management) are strictly separated from standard operational privileges (such as processing card transactions).
  • System Initialization and Disaster Recovery: During system deployment, testing cycles, or disaster recovery events, this dataset provides a reliable, clean baseline of authorized users. This allows the business to quickly restore or stand up a secure environment with known, trusted access controls.
  • Compliance and Audit Readiness: By maintaining a structured, predictable set of initial user roles, the dataset supports compliance with financial industry standards (such as PCI-DSS) which mandate strict controls over user access, administrative privileges, and the segregation of duties.
How Jobs and Programs Interact with the Dataset

The dataset is utilized within a structured batch initialization workflow that prepares and loads security data into the active application database. The interaction occurs in three distinct phases:

Environment Preparation (Cleanup):

Before any new security data is generated, an initialization job performs a cleanup step. It identifies if a previous version of this staging dataset exists and safely removes it. This prevents legacy or corrupted security data from contaminating the new setup.

Security Profile Generation (Seeding):

Once the environment is cleared, a system utility populates this staging dataset with the baseline user profiles. This step writes the initial administrative and standard user accounts, along with their encrypted or plaintext credentials, directly into the sequential staging file.

Active Database Loading:

In the final phase, a database utility reads the validated security profiles from this staging dataset and loads them into the live, high-performance indexed security database. Once loaded into the active database, this data is used by the online application to authenticate users and authorize transactions in real time.

AWS.M2.CARDDEMO.USRSEC.VSAM.ESDS

CardDemo User Security Data Store (ESDS) - Business Overview Business Description and Usage The AWS.M2.CARDDEMO.USRSEC.VSAM.ESDS dataset serves as a foundational security registry for the CardDemo application.

MAT analysis

CardDemo User Security Data Store (ESDS) - Business Overview

Business Description and Usage

The AWS.M2.CARDDEMO.USRSEC.VSAM.ESDS dataset serves as a foundational security registry for the CardDemo application. It is designed to store and manage the core user profiles, credentials, and access privileges required to secure the application's environment. By maintaining a record of authorized personnel—ranging from system administrators to standard operational users—this dataset acts as the primary authority for identity verification.

Because this specific dataset is structured as an Entry-Sequenced Data Set (ESDS), it stores records in the order they are received. This sequential nature makes it highly suitable for security auditing, historical tracking of user provisioning, and sequential access patterns where a complete ledger of user accounts needs to be processed or verified.

Business Importance and Strategic Role

In any financial or credit card processing application, robust identity and access management (IAM) is critical. This dataset plays a vital role in the business in several key areas:

  • Access Control and Security: It prevents unauthorized access to sensitive financial data, customer records, and transaction processing systems by ensuring only validated users can log in.
  • Operational Integrity: By distinguishing between administrative and standard users, the dataset supports the principle of least privilege, ensuring staff members only have access to the functions necessary for their roles.
  • Regulatory Compliance: Maintaining a secure, structured repository of user identities is a fundamental requirement for compliance with financial industry standards (such as PCI-DSS) and data protection regulations.
  • System Readiness: This dataset is essential for environment provisioning. During system installations, upgrades, or disaster recovery events, this file is initialized to ensure that security controls are active and operational from day one.

Application and Job Interactions

The dataset is integrated into the system's administrative and operational workflows through automated jobs and utility programs:

  • Provisioning and Initialization: The dataset is managed by administrative jobs such as ESDSRRDS. During system setup or reset procedures, this job utilizes system utility programs (specifically IDCAMS) to define the storage structure and load the baseline security profiles.
  • Data Loading: The initialization process stages raw security data and uses high-speed replication utilities to populate this ESDS file, establishing the initial security baseline.
  • Authentication Services: Once populated, the dataset is accessed by online and batch application programs to validate user credentials during the login process and to enforce security boundaries across different functional areas of the CardDemo application.

AWS.M2.CARDDEMO.USRSEC.VSAM.KSDS

The CardDemo User Security dataset serves as the central repository for managing user identities, authentication credentials, and access permissions within the CardDemo application.

MAT analysis

CardDemo User Security and Access Control Database

Business-Level Description

The CardDemo User Security dataset serves as the central repository for managing user identities, authentication credentials, and access permissions within the CardDemo application. It acts as the system's "single source of truth" for security, distinguishing between different tiers of users, such as system administrators who manage the platform and standard business users who handle day-to-day credit card operations.

Business Importance and Role

In any financial or credit card processing system, security and regulatory compliance are paramount. This dataset plays a critical role in the business by:

  • Securing Sensitive Data: Ensuring that only verified personnel can access credit card information, customer profiles, and transaction histories.
  • Enforcing Role-Based Access Control (RBAC): Restricting system capabilities based on a user's job function. For example, preventing standard users from performing administrative tasks or modifying system configurations.
  • Supporting Audit and Compliance: Providing a structured framework to track who has access to the system, which is essential for meeting industry security standards (such as PCI-DSS) and internal corporate governance policies.
  • Preventing Fraud: Protecting the application from unauthorized external or internal access, thereby mitigating the risk of fraudulent activities.
Job and Program Interaction

The dataset is integrated into both batch and online application workflows:

  • System Initialization and Maintenance: During system setup or scheduled maintenance windows, dedicated batch jobs initialize and populate this dataset. These processes clean up legacy security records, establish the baseline user registry, and load authorized administrative and operational accounts into the secure database.
  • Authentication and Authorization: Although initialized via batch processes, this dataset is continuously referenced by the application's sign-on and security modules. Whenever a user attempts to log in or perform a restricted action, the system queries this dataset to verify their identity and confirm they possess the necessary permissions to complete the request.

AWS.M2.CARDDEMO.USRSEC.VSAM.RRDS

The AWS.M2.CARDDEMO.USRSEC.VSAM.RRDS dataset serves as the primary security and access control registry for the CardDemo credit card management application.

MAT analysis

CardDemo User Security Registry (RRDS)

Business-Level Description

The AWS.M2.CARDDEMO.USRSEC.VSAM.RRDS dataset serves as the primary security and access control registry for the CardDemo credit card management application. It acts as the central repository for user identity and credential information, housing profiles for both administrative personnel and standard application users. By maintaining this critical security data, the dataset enables the application to verify user identities and enforce appropriate access permissions across the platform.

Business Importance and Role

In any financial or credit card processing system, security, data privacy, and regulatory compliance are paramount. This dataset is the cornerstone of the CardDemo application's security architecture. Its key business roles include:

  • Authentication and Authorization: It ensures that only verified users can log into the system and perform actions aligned with their specific roles (e.g., administrative tasks versus standard user operations).
  • Data Protection: By acting as the gatekeeper, it prevents unauthorized access to sensitive customer financial data and credit card information, helping the organization maintain compliance with industry security standards.
  • Operational Efficiency: The dataset is structured specifically to support rapid, direct-access lookups. This ensures that user login and authorization checks occur instantaneously, providing a seamless and responsive experience for business users without introducing system latency.
  • System Provisioning: It establishes the baseline security environment during system installation, testing, or disaster recovery procedures, ensuring the application is secure from the moment it is initialized.
Job and Program Interactions

The dataset is integrated into the system's lifecycle through specific administrative and operational processes:

  • System Initialization and Setup: The dataset is created and populated by the system initialization job ( ESDSRRDS ). Using system utilities (such as IDCAMS ), this job establishes the secure storage structure and loads a default set of administrative and standard user profiles. This process is critical during environment provisioning, system resets, or deployment phases to ensure a secure "day-one" operating state.
  • Direct Access Lookups: Once initialized, the dataset's direct-access structure allows online transaction processing systems to quickly query individual user profiles during login attempts or privilege verification steps, ensuring real-time security enforcement.

AWS.M2.CARDEMO.FTP.TEST

The AWS.M2.CARDEMO.FTP.TEST dataset is a core component of the Credit Card Demonstration (CARDEMO) testing environment.

MAT analysis

Business Analysis of Dataset: AWS.M2.CARDEMO.FTP.TEST

Business Overview

The AWS.M2.CARDEMO.FTP.TEST dataset is a core component of the Credit Card Demonstration (CARDEMO) testing environment. It represents simulated or test data used to validate File Transfer Protocol (FTP) operations and data integration pipelines. In a financial services context, secure and reliable file transfers are critical for exchanging transaction records, customer accounts, and billing information between internal systems and external partners (such as payment gateways or credit bureaus). This dataset acts as the standardized input for testing these critical data transmission channels.

Business Importance and Role

The dataset plays a vital role in ensuring operational readiness, system reliability, and risk mitigation:

  • Validation of Integration Channels: It allows the business to safely test data ingestion and transmission processes, ensuring that file transfer mechanisms are robust, secure, and capable of handling financial data formats without risking actual production data.
  • Data Preservation and Environment Stability: Because testing environments are dynamic and subject to frequent updates, preserving a baseline of test data is essential. The dataset is backed up systematically to ensure that testing cycles can be repeated from a known, stable state, preventing data corruption or loss during automated test runs.
  • Workflow Automation: The dataset serves as the catalyst for automated testing pipelines. Its presence and successful processing trigger downstream validation jobs, ensuring that the entire end-to-end credit card processing workflow functions seamlessly.
System Interaction and Workflow

The dataset is integrated into the automated batch processing environment through a structured workflow designed to maintain data integrity:

  • Data Safeguarding (Backup): Before any processing or transformation occurs, the system initiates a data preservation step. The primary dataset ( AWS.M2.CARDEMO.FTP.TEST ) is duplicated to a backup file. This ensures that a clean copy of the test data is always available for recovery or subsequent test iterations.
  • Process Orchestration: Once the backup is successfully completed, the system automatically triggers the next phase of the testing cycle. This is achieved by submitting a secondary job stream to the system's job scheduler.
  • Downstream Execution: The triggered secondary job utilizes the verified data to perform downstream application testing, simulating real-world credit card processing activities.

AWS.M2.CARDEMO.FTP.TEST.BKUP

The AWS.M2.CARDEMO.FTP.TEST.BKUP dataset serves as a dedicated data preservation and staging repository within the Card Demonstration (CARDEMO) environment.

MAT analysis

Business Analysis of Dataset AWS.M2.CARDEMO.FTP.TEST.BKUP

Business-Level Description

The AWS.M2.CARDEMO.FTP.TEST.BKUP dataset serves as a dedicated data preservation and staging repository within the Card Demonstration (CARDEMO) environment. It holds a verified, point-in-time backup copy of FTP test data. In the context of financial and card-processing application testing, this dataset acts as a secure checkpoint, ensuring that baseline test data is safely duplicated before being utilized in downstream testing, database initialization, or application validation workflows.

Business Importance and Role

This dataset plays a critical role in maintaining operational efficiency, data integrity, and automation within the testing lifecycle:

  • Data Integrity and Risk Mitigation: By maintaining a dedicated backup copy of the FTP test data, the business mitigates the risk of data corruption, loss, or accidental modification during active test cycles. If a test run alters the active data, the system can easily restore the baseline from this backup.
  • Workflow Synchronization: The dataset serves as the physical "handshake" or bridge between two automated phases of the testing pipeline. Its successful creation signals that the environment is ready for the next phase of testing.
  • Testing Consistency and Repeatability: It ensures that downstream testing processes—such as database staging, application simulation, or demonstration runs—always execute against a standardized, predictable, and clean set of records.
Job and Program Interactions

The dataset is positioned at the center of a two-step automated workflow chain, acting first as a target and then as a source:

1. Data Capture and Safeguarding (Job: INTRDRJ1)
  • Role of the Dataset: Target (Output)
  • Business Interaction: The process begins by copying the active FTP test data into this backup dataset. This step establishes a secure, static baseline of the test data. Once this backup is successfully written, the system automatically triggers the next job in the sequence, ensuring that downstream processes only run after the data is safely preserved.
2. Data Staging and Preparation (Job: INTRDRJ2)
  • Role of the Dataset: Source (Input)
  • Business Interaction: The subsequent job automatically reads from this backup dataset to replicate the data into a staging environment. This staging file is then used to initialize databases or feed application test runs, ensuring that the actual testing occurs on a replica and the backup itself remains pristine.

AWS.M2.CARDEMO.FTP.TEST.BKUP.INTRDR

The dataset AWS.M2.CARDEMO.FTP.TEST.BKUP.INTRDR serves as a critical data staging and preparation file within a credit card application demonstration and testing environment (CARDEMO).

MAT analysis

Business Overview of the Dataset

The dataset AWS.M2.CARDEMO.FTP.TEST.BKUP.INTRDR serves as a critical data staging and preparation file within a credit card application demonstration and testing environment (CARDEMO). In financial and credit card processing systems, maintaining rigorous testing environments is essential to validate software updates, system integrations, and batch processing runs without risking production data.

This dataset acts as a dedicated target area where backup test data is staged. It is specifically prepared to facilitate database initialization, system recovery testing, or simulated job submissions. By holding a standardized copy of test data, it ensures that testing processes have a reliable and consistent data source to work from.

Business Importance and Value

The primary business value of this dataset lies in its role in enabling repeatable, risk-free testing and quality assurance .

  • Environment Consistency: It allows testing teams to establish a clean, known baseline of data. This is crucial for verifying that credit card processing logic, interest calculations, and transaction postings operate correctly under simulated conditions.
  • Operational Efficiency: By automating the replication of backup data into this staging dataset, the business reduces the manual effort required to set up test environments. This accelerates the software development lifecycle and speeds up the deployment of new features.
  • Risk Mitigation: Utilizing a dedicated test backup dataset ensures that actual production databases remain completely isolated and secure, preventing accidental data corruption or exposure of sensitive financial information during testing cycles.

System and Job Interactions

The dataset is populated and utilized through automated system utilities that manage data preparation:

  • Data Replication and Refresh: The mainframe job INTRDRJ2 interacts directly with this dataset. It executes a system utility to perform a direct, record-for-record copy of data from a master backup file into this target dataset. This process effectively refreshes the staging area, ensuring it contains the exact data needed for subsequent testing phases.
  • Downstream Testing Preparation: Once populated, this dataset serves as the launchpad for initializing test databases (such as simulated IMS or VSAM databases) or staging input streams for automated test runs. It ensures that downstream testing applications receive a clean, standardized input stream every time a test cycle is initiated.

AWS.M2.LBD.TXT2PDF.EXEC

The dataset AWS.M2.LBD.TXT2PDF.EXEC serves as a centralized business utility library containing the automated logic and scripts required to modernize customer communications.

MAT analysis

Business Utility Profile: Statement Conversion Executable Library (AWS.M2.LBD.TXT2PDF.EXEC)

Business-Level Description

The dataset AWS.M2.LBD.TXT2PDF.EXEC serves as a centralized business utility library containing the automated logic and scripts required to modernize customer communications. Specifically, it houses the execution scripts responsible for converting raw, legacy text-based reports and customer account statements into standard, universally accessible PDF documents.

In a financial or transactional environment (such as the CardDemo credit card application), system outputs are natively generated in plain text formats. This dataset acts as the "translation engine" that transforms these raw data dumps into professional, customer-ready documents suitable for digital distribution, online banking portals, and long-term archiving.

Business Importance and Role

The dataset plays a critical role in customer experience, operational efficiency, and digital transformation initiatives:

  • Customer Experience & Accessibility: It enables the business to deliver clean, readable, and professionally formatted statements to customers via web portals or email, replacing hard-to-read legacy text layouts.
  • Operational Efficiency: By automating the conversion process directly within the batch processing cycle, the business eliminates the need for manual document formatting or expensive third-party post-processing software.
  • Digital Archiving and Compliance: Financial regulations often require institutions to retain customer statements in an unalterable, standardized format. This library ensures that raw transaction data is reliably archived as compliant PDF documents.
  • Bridge to Modern Infrastructure: As the business migrates workloads to cloud environments (such as AWS), this dataset preserves the core business logic needed to transition legacy print streams into modern digital assets.
Job and Program Interactions

The dataset is utilized during the post-processing phase of the statement generation cycle:

  • Execution Orchestration: The batch job TXT2PDF1 initiates the document conversion process. It calls upon the system program IKJEFT1B (a terminal monitor program) to establish the processing environment.
  • Script Retrieval: During execution, the program accesses AWS.M2.LBD.TXT2PDF.EXEC as an input library (via the SYSEXEC DD statement). It retrieves the specific conversion script ( TXT2PDF ) stored within this dataset.
  • Data Transformation: The retrieved script processes the raw customer statement text file, applies formatting rules (such as page breaks, margins, and alignment), and outputs the finalized PDF document to the target storage location for customer access.

IMS.DBDLIB

The IMS.DBDLIB (Database Description Library) serves as the master structural blueprint for an organization's core mainframe databases.

MAT analysis

Business Utility and Importance of IMS.DBDLIB

Business-Level Description

The IMS.DBDLIB (Database Description Library) serves as the master structural blueprint for an organization's core mainframe databases. In business terms, it acts as the "data dictionary" or "architectural map" that defines how critical business information—such as customer profiles, financial transactions, and security authorizations—is physically organized, structured, and related within the system.

Rather than containing the actual business transactions or customer records, this dataset contains the rules and definitions that govern how those records are stored and accessed. It ensures that any application program interacting with the database interprets the data in a consistent, standardized, and secure manner.

Business Importance and Role

The IMS.DBDLIB dataset is fundamental to the stability, security, and efficiency of enterprise operations. Its primary business roles include:

  • Data Integrity and Standardization: By centralizing database definitions, the business ensures that all applications adhere to the same data standards. This prevents data corruption and ensures that critical business records remain accurate and reliable.
  • Operational Continuity: Without this library, the system cannot locate or interpret any of the information stored in the databases. It is a critical dependency for daily online transaction processing (OLTP) and batch processing.
  • Regulatory Compliance and Data Governance: To comply with data privacy laws (such as GDPR, CCPA, or PCI-DSS), businesses must be able to precisely locate, update, and purge sensitive information. This dataset provides the structural mapping required to execute data retention and cleanup policies successfully.
  • System Performance: Optimized database structures defined within this library ensure that customer-facing applications and backend batch processes run efficiently, minimizing transaction response times and operational costs.
Job and Program Interactions

The IMS.DBDLIB dataset is accessed during the execution of database-dependent programs to facilitate safe and accurate data processing.

  • System Initialization and Mapping: When a batch job—such as CBPAUP0J (Expired Authorizations Deletion)—is executed, the system's region controller (e.g., DFSRRC00 ) references the IMS.DBDLIB. It uses these definitions to understand the physical layout of the target database (in this case, the Authorization Database).
  • Safe Data Manipulation: By reading the database descriptions, the running application program (such as CBPAUP0C ) knows exactly how to navigate the database to find, evaluate, and delete expired records. This ensures that the program only modifies the intended records without accidentally corrupting adjacent business data.
  • Integration with Access Rules: The database descriptions work in tandem with Program Specification Blocks (PSBs) to enforce security. While the DBD defines what the database looks like, the system uses this information to ensure the program only accesses the specific areas it is authorized to modify, protecting sensitive business assets.

IMS.PROCLIB

The IMS.PROCLIB (Information Management System Procedure Library) dataset serves as the central configuration and governance repository for the organization's core database and transaction management environment.

MAT analysis

Business Overview of the IMS.PROCLIB Dataset

Business-Level Description

The IMS.PROCLIB (Information Management System Procedure Library) dataset serves as the central configuration and governance repository for the organization's core database and transaction management environment. In business terms, it acts as the "system blueprint" or "instruction manual" that defines how the database management system initializes, secures, and executes business applications.

Rather than containing transactional business data (such as customer accounts or authorization records), this dataset contains the standardized system parameters, operational procedures, and execution rules required to run the database infrastructure. It ensures that all database activities—whether real-time customer transactions or overnight batch processing—occur within a controlled, secure, and optimized environment.

Business Importance and Role

The IMS.PROCLIB dataset is critical to the organization’s daily operations, directly impacting system availability, compliance, and performance:

  • Operational Consistency and Stability: By centralizing system startup and execution parameters, the dataset ensures that all database programs run under identical, pre-approved operational standards. This minimizes human error and prevents system outages.
  • Regulatory Compliance and Data Governance: The dataset configures logging, auditing, and security protocols. This is vital for maintaining compliance with industry standards (such as PCI-DSS or HIPAA) by ensuring that data modifications are securely tracked and that unauthorized access is blocked.
  • Resource Optimization and Cost Control: It defines memory allocations, processing limits, and database buffer sizes. Proper configuration within this library prevents system bottlenecks, optimizes mainframe resource consumption, and reduces operational costs.
  • Business Continuity: In the event of a system failure, the configurations stored in this dataset guide the automated recovery processes, ensuring that business-critical databases are restored quickly with minimal disruption to customer-facing services.
How Jobs and Programs Interact with the Dataset

The IMS.PROCLIB dataset is accessed during the initialization phase of database utility and batch processing jobs.

A prime example of this interaction is found in the CBPAUP0J job, which is responsible for the critical business function of purging expired authorization records to maintain database hygiene and compliance:

  • Environment Initialization: When the job is submitted, the system's region controller program ( DFSRRC00 ) is executed. Before it can process any business data, it must establish a secure and stable connection to the database.
  • Configuration Retrieval: The controller program accesses IMS.PROCLIB as an input resource. It reads the predefined system parameters to determine how the execution environment should be configured (e.g., defining memory limits, logging requirements, and database access paths).
  • Execution of Business Logic: Once the environment is successfully configured using the instructions from IMS.PROCLIB, the system launches the application program ( CBPAUP0C ) to safely identify and delete expired authorizations.

Without the foundational configuration data supplied by IMS.PROCLIB, the system cannot establish the necessary runtime environment, preventing critical maintenance and compliance jobs from executing.

IMS.PSBLIB

IMS.PSBLIB (Program Specification Block Library) is a foundational system library that serves as the central repository for database access rules and logical data blueprints.

MAT analysis

Business Utility and Importance of IMS.PSBLIB

Business-Level Description

IMS.PSBLIB (Program Specification Block Library) is a foundational system library that serves as the central repository for database access rules and logical data blueprints. In a mainframe environment, business applications do not access databases directly or unconditionally. Instead, they rely on Program Specification Blocks (PSBs) stored within this library to define their "view" of the database.

Think of IMS.PSBLIB as a secure directory of access contracts. Each contract (or PSB) specifies exactly which databases, segments, and records an application program is permitted to read, write, update, or delete. This ensures that business applications interact with corporate data in a controlled, secure, and structured manner.

Business Importance and Role

The IMS.PSBLIB dataset is critical to the organization’s operational integrity, security posture, and compliance framework for several key reasons:

  • Data Security and Governance: It enforces the principle of least privilege. By restricting programs to only the data segments they absolutely need to perform their functions, it prevents unauthorized data access and accidental data corruption.
  • Regulatory Compliance: In industries handling sensitive information (such as financial authorizations or personally identifiable information), this library ensures that only approved programs can modify or delete sensitive records, providing a clear audit trail of data access permissions.
  • System Stability and Business Continuity: By decoupling the physical database structure from the application logic, the library allows database administrators to make physical database changes without breaking the underlying business applications. This minimizes downtime and maintenance costs.
How Jobs and Programs Interact with the Dataset

When a business process is executed, the system references IMS.PSBLIB to establish the operational boundaries for that specific run.

  • Initialization and Access Validation: At the start of a job step, the IMS system controller accesses IMS.PSBLIB as an input resource. It retrieves the specific PSB associated with the program scheduled to run.
  • Enforcing Database Boundaries: For example, in the expired authorization cleanup job ( CBPAUP0J ), the program CBPAUP0C requires access to the authorization database to purge outdated records. The system reads the profile PSBPAUTB from IMS.PSBLIB to verify that this program has the explicit authority to perform delete ( DLET ) operations on that specific database.
  • Execution Safeguards: Once the access rules are loaded from the library, the program is allowed to execute its business logic (e.g., scanning and deleting expired authorizations) under the strict guardrails defined by the PSB. The dataset is accessed in a read-only capacity during this initialization phase to ensure the integrity of the access rules themselves.

IMS.SDFSRESL

IMS.SDFSRESL is a foundational system library that serves as the core execution engine for the organization's Information Management System (IMS).

MAT analysis

Business Utility Profile: IMS.SDFSRESL (Core Database Engine Library)

Business-Level Description

IMS.SDFSRESL is a foundational system library that serves as the core execution engine for the organization's Information Management System (IMS). In a mainframe environment, IMS is the database and transaction management system responsible for handling high-volume, mission-critical business data.

Rather than storing business records directly, IMS.SDFSRESL contains the essential system software and operational modules required to run and manage the database environment. It acts as the underlying engine that powers database access, transaction processing, and utility executions. Any business application that needs to read, update, or delete information stored within the IMS database relies on this library to establish a secure and reliable connection to the data.

Business Importance and Role

The IMS.SDFSRESL dataset is critical to the organization’s daily operations, data integrity, and regulatory compliance. Its business importance is highlighted by the following roles:

  • Operational Continuity: It is the backbone of the database runtime environment. Without this library, the system cannot launch the database controllers required to process business transactions, leading to operational downtime.
  • Data Lifecycle and Compliance Management: The library enables automated maintenance jobs—such as purging expired customer authorizations, deleting obsolete records, and archiving old data. This ensures the organization complies with data retention policies and privacy regulations (e.g., GDPR, CCPA) by preventing the indefinite storage of sensitive, outdated information.
  • Performance Optimization: By facilitating regular database cleanup and maintenance activities, this library helps prevent database bloat. This directly translates to faster transaction response times for active customer accounts and lower storage costs.
  • System Security and Control: It houses the authorized system programs that govern database access, ensuring that only validated business programs can modify sensitive corporate data.
Job and Program Interactions

The dataset interacts with business applications and system utilities to facilitate database maintenance and transaction processing.

1. Establishing the Database Connection (The Bridge)

When a business process needs to interact with the database, it does not access the data directly. Instead, it calls upon a system controller program (such as DFSRRC00 ) stored within IMS.SDFSRESL. This controller acts as a secure bridge, initializing the environment, verifying security credentials, and establishing the logical connection between the business application and the physical database.

2. Executing Maintenance and Cleanup (e.g., Job CBPAUP0J)

In the context of database maintenance, such as the Expired Authorizations Deletion job ( CBPAUP0J ):

  • Environment Initialization: The job references IMS.SDFSRESL to load the necessary system utilities required to run in Batch Message Processing (BMP) mode—a hybrid execution mode that allows batch cleanup jobs to run safely alongside active online transactions.
  • Execution Support: During the run, the system program utilizes modules within IMS.SDFSRESL to manage database locks, handle transaction checkpoints (ensuring the database can recover in case of a failure), and safely commit deletions of expired records to the database.

INPFILE

The INPFILE dataset serves as the primary bulk data feed for maintaining the organization's master transaction reference registry.

MAT analysis

Business Overview of the Transaction Maintenance Dataset (INPFILE)

Business-Level Description

The INPFILE dataset serves as the primary bulk data feed for maintaining the organization's master transaction reference registry. In any financial or transactional system, transactions must be categorized and labeled accurately (for example, distinguishing between a purchase, a refund, a fee, or a reversal).

Rather than requiring database administrators to manually enter, modify, or delete these transaction categories one by one, business operations and upstream planning systems compile these changes into the INPFILE dataset. This file acts as a consolidated batch instruction sheet, containing all the necessary updates to keep the system's transaction definitions synchronized with current business offerings and regulatory requirements.

Importance and Role to the Business

The INPFILE dataset is critical for maintaining operational integrity, reporting accuracy, and data consistency across the enterprise:

  • Operational Accuracy: Downstream applications—such as credit card processing, billing, and customer service portals—rely on the master transaction table to recognize and process financial events. This dataset ensures that new transaction types are registered promptly so they can be processed without system rejections.
  • Clarity in Customer and Financial Reporting: The descriptive names updated via this dataset appear directly on customer statements, online banking portals, and internal financial ledgers. Accurate descriptions prevent customer confusion, reduce billing inquiries, and streamline auditing.
  • Efficiency through Automation: By consolidating administrative changes into a single batch file, the business avoids the overhead, delays, and human-error risks associated with manual database updates.
Job and Program Interaction

The dataset is processed within the core batch environment to safely apply updates to the database:

  • The Maintenance Job (MNTTRDB2): This batch job is scheduled to run whenever transaction reference data needs to be synchronized. It acts as the automated custodian for the transaction lookup table.
  • Program Execution (IKJEFT01): The job utilizes this system utility to establish a secure connection to the relational database. The program reads the INPFILE sequentially, interpreting each record's business intent—whether to register a brand-new transaction category, update the descriptive text of an existing one, or retire an obsolete category.
  • Database Synchronization: As the program processes the dataset, it translates the business instructions into direct database commands, ensuring the central transaction reference table is updated in-place with zero manual intervention.

OEM.CICSTS.DFHCSD

The dataset OEM.CICSTS.DFHCSD serves as the central configuration registry—commonly referred to as the CICS System Definition (CSD) file—for the online transaction processing environment.

MAT analysis

Business Utility and Importance of Dataset: OEM.CICSTS.DFHCSD

Business-Level Description

The dataset OEM.CICSTS.DFHCSD serves as the central configuration registry—commonly referred to as the CICS System Definition (CSD) file—for the online transaction processing environment. In the context of the CardDemo credit card application, this dataset acts as the master directory that defines how the system operates, how it routes user requests, and how it displays information.

Rather than storing financial transaction data itself, this dataset stores the structural "blueprint" of the application. It registers the locations of the compiled business logic (the programs that process credit card transactions) and defines the layouts of the user interface screens (such as login portals, account menus, transaction detail viewers, and administrative consoles) that bank employees and customer service representatives interact with daily.

Business Importance and Role

The OEM.CICSTS.DFHCSD dataset is critical to the daily operations and stability of the credit card business unit. Its importance is highlighted by the following key business roles:

  • System Availability and Accessibility: It is the bridge between the end-user and the core banking application. Without this registry, the online system cannot start, and users would be unable to access any credit card management screens, view accounts, or process payments.
  • Operational Continuity during Upgrades: When new features, security patches, or screen updates are deployed, this dataset is updated to point to the new software versions. This allows the business to seamlessly transition to upgraded systems without disrupting ongoing customer service operations.
  • User Experience Consistency: By defining the exact screens and menus (such as the Account Menu, Transaction Reports, and Bill Pay Setup), this dataset ensures that customer service agents have a consistent, reliable, and structured interface to assist cardholders.
  • Resource Management: It organizes application components into logical groups, allowing IT operations to manage, secure, and scale specific business functions (like "Transactions" vs. "Account Administration") independently.
Job and Program Interactions

The dataset is maintained and utilized through automated system administration processes:

  • Configuration and Deployment (Job: CBADMCDJ / Program: DFHCSDUP):

When the credit card application is installed, updated, or migrated, administrative jobs execute specialized system utilities to interact with this dataset. The job reads configuration commands and writes updates directly to the registry.

  • Registering Business Functions:

During these updates, the utility registers the paths to the executable programs and maps out the user interface screens. For example, when a new "Bill Pay Setup" or "Transaction Details" screen is introduced, the job updates this dataset so the online system knows exactly how to render the screen and which back-end program should handle the user's input.

  • Verification and Validation:

The system administration programs read the existing definitions within the dataset to verify that there are no conflicts or missing components before applying updates, ensuring that the live production environment remains stable and error-free.

OEM.IMS.IMSP.DBDLIB

Business Utility and Importance of the Database Description Library (OEM.IMS.IMSP.DBDLIB) The dataset OEM.IMS.IMSP.DBDLIB serves as the central structural repository—or "blueprint"—for the credit card application's databases, specifically focusing on the Pre-Authorization and Pending Authorization systems.

MAT analysis

Business Utility and Importance of the Database Description Library (OEM.IMS.IMSP.DBDLIB)

The dataset OEM.IMS.IMSP.DBDLIB serves as the central structural repository—or "blueprint"—for the credit card application's databases, specifically focusing on the Pre-Authorization and Pending Authorization systems. In a credit card processing environment, pre-authorizations are critical temporary holds placed on accounts to verify funds before transactions are finalized. This dataset contains the master definitions that dictate how this vital financial data is organized, related, and accessed by the core banking systems.

Business Importance and Role

This dataset is foundational to the operational integrity and continuity of the credit card business. Its primary roles include:

Data Integrity and Standardization: It ensures that all programs accessing credit card authorization data interpret the database structure identically, preventing data corruption and ensuring consistent financial calculations.

Operational Continuity: It enables critical administrative tasks such as database backups, performance optimization, and system recovery, which protect the business against data loss and system downtime.

Regulatory Compliance and Reporting: By defining the structure of pending transactions, it allows the business to reliably extract data for downstream financial auditing, fraud monitoring, and regulatory reporting.

Job and Program Interactions

Several key business processes rely on this structural library to interact with the live transaction databases:

Database Backup and Maintenance (Unload Jobs): Administrative jobs use this library to safely extract point-in-time snapshots of authorization data. This supports disaster recovery preparation and database reorganization to maintain high system performance.

Transaction Loading and Updates (Load Jobs): Daily batch processes use these definitions to safely import and update new pre-authorization records from front-end systems into the core database, ensuring customer credit limits and balances are up to date.

Data Archiving and Downstream Reporting (Extraction Jobs): Reporting utilities reference this library to extract pending transaction histories into flat files. These files are then used for business intelligence, data warehousing, and financial auditing.

OEM.IMS.IMSP.PAUTHDB

The OEM.IMS.IMSP.PAUTHDB dataset is a core operational database within the CardDemo credit card processing application.

MAT analysis

Business Overview of the Pending Authorization Database (OEM.IMS.IMSP.PAUTHDB)

The OEM.IMS.IMSP.PAUTHDB dataset is a core operational database within the CardDemo credit card processing application. It serves as the primary repository for pending credit card transaction authorizations. When a cardholder initiates a transaction, the system evaluates and temporarily holds the transaction in a "pending" state before final settlement. This dataset stores both the high-level account summaries (such as current credit limits and outstanding balances) and the granular transaction-level details (such as transaction amounts, merchant information, and approval statuses) associated with these active, in-flight authorizations.

Business Importance and Role

This dataset is critical to the daily financial operations, risk management, and regulatory compliance of the credit card business:

  • Risk Mitigation and Credit Control: By maintaining real-time records of pending authorizations, the business can accurately calculate a customer's remaining available credit. This prevents over-limit spending and protects the institution from credit risk.
  • Fraud Prevention: Tracking active authorization attempts allows the business to monitor transaction patterns, identify suspicious activities, and flag potential fraud before transactions are finalized.
  • Financial Reporting and Auditing: The data stored here provides a transparent audit trail of all approved and declined transaction attempts. This is essential for resolving customer disputes, reconciling accounts, and meeting strict financial regulatory compliance standards.
  • Operational Performance: As a high-volume transactional database, its continuous availability and optimal performance are vital for ensuring a seamless checkout experience for cardholders.
How Jobs and Programs Interact with the Dataset

The dataset acts as the primary source of truth for several critical batch processes. These processes run periodically to secure the data, optimize database performance, and share information with downstream business units:

1. Data Protection and Database Maintenance

The job DBPAUTP0 interacts directly with the dataset to perform routine administrative maintenance. It extracts the entire contents of the database into a standardized sequential format. This process serves two key business functions:

  • Point-in-Time Backups: Creating secure copies of active transaction data to ensure business continuity and disaster recovery readiness.
  • Database Reorganization: Preparing the database for structural cleanups that reclaim storage space and maintain high-speed transaction processing performance.
2. Downstream Reporting and Business Intelligence

The job UNLDGSAM (utilizing program DBUNLDGS ) reads the active pending authorization data to support downstream analytics. It extracts and separates the high-level account summaries and detailed transaction records into dedicated sequential files. These files are then ingested by data warehouses and business intelligence tools to analyze approval/decline rates, merchant performance, and consumer spending trends.

3. System Integration and Archiving

The job UNLDPADB (utilizing program PAUDBUNL ) performs a specialized extraction designed to facilitate data sharing and archiving. It reads the dataset, validates the integrity of the account records, and formats the hierarchical data into flat files. This process is crucial for:

  • Data Migration: Moving mainframe transaction data into modern relational databases or cloud-based storage systems.
  • Historical Archiving: Offloading older pending records to long-term storage to keep the active transactional database lean and fast, while still preserving records for future audit requirements.

OEM.IMS.IMSP.PAUTHDBX

The OEM.IMS.IMSP.PAUTHDBX dataset serves as the primary search and retrieval index for pending credit card authorization data within the CardDemo application.

MAT analysis

Business Overview of the Pending Credit Card Authorization Index Dataset (OEM.IMS.IMSP.PAUTHDBX)

Business-Level Description

The OEM.IMS.IMSP.PAUTHDBX dataset serves as the primary search and retrieval index for pending credit card authorization data within the CardDemo application.

In the credit card industry, when a cardholder makes a purchase, the transaction is temporarily held in a "pending" status until it is fully cleared, settled, or declined. This index dataset acts as a highly optimized directory for those active, pending transactions. It allows the core banking system to quickly locate, organize, and reference specific authorization records without having to search through the entire primary database.

Importance and Role to the Business

This dataset is a critical component of the financial institution's transactional infrastructure, playing a key role in several business areas:

  • Operational Performance: By providing a fast-access index, the dataset ensures that customer service representatives, fraud detection systems, and credit managers can retrieve up-to-the-minute pending transaction details instantly, maintaining high system responsiveness.
  • Data Integrity and Consistency: The index maintains the structural relationship between high-level customer account summaries (such as credit limits and current balances) and granular transaction details (such as merchant names and transaction amounts). This prevents data mismatching and ensures accurate financial reporting.
  • Business Continuity and Risk Management: Regular maintenance and backup of this index ensure that the business can quickly recover transactional data in the event of a system outage, minimizing financial and operational risk.
  • Downstream Financial Intelligence: It enables the clean extraction of pending transaction data, which is vital for daily auditing, regulatory compliance, liquidity management, and credit risk analysis.
How Jobs and Programs Interact with the Dataset

The dataset is utilized as an essential input source by several key administrative and operational batch jobs. These jobs do not modify the index directly during these processes; instead, they read it to locate and extract data efficiently:

Database Backup and Maintenance (Job: DBPAUTP0):

This job reads the index dataset to perform a secure, point-in-time backup of the pending authorization database. This process is vital for disaster recovery planning and prepares the database for routine performance optimization.

Data Archiving and Reporting (Job: UNLDGSAM / Program: DBUNLDGS):

This process accesses the index to systematically extract pending transaction summaries and their associated details. The program uses the index to verify account validity and safely archive the records into sequential files, which are then used for long-term storage and historical auditing.

Downstream Integration and Data Warehousing (Job: UNLDPADB / Program: PAUDBUNL):

This job utilizes the index to extract and format pending credit card transactions into flat files. These files are delivered to downstream business intelligence systems, data warehouses, and reporting tools, allowing business analysts to perform trend analysis and financial forecasting.

OEM.IMS.IMSP.PSBLIB

The dataset OEM.IMS.IMSP.PSBLIB is a core system control library that serves as the access control and structural blueprint directory for the CardDemo credit card processing application.

MAT analysis

Business Overview of the IMS Program Specification Block Library (OEM.IMS.IMSP.PSBLIB)

Business-Level Description

The dataset OEM.IMS.IMSP.PSBLIB is a core system control library that serves as the access control and structural blueprint directory for the CardDemo credit card processing application. In a mainframe database environment, this library stores Program Specification Blocks (PSBs).

From a business perspective, a PSB defines exactly which parts of the customer and transaction databases an application program is allowed to view, search, or modify. It acts as a security contract and logical gateway, ensuring that financial processing programs interact with sensitive credit card and authorization data in a highly controlled, secure, and authorized manner.

Business Importance and Role

This dataset is critical to the daily operations, security, and compliance of the credit card management system. Its primary roles include:

  • Data Governance and Security: It enforces the principle of least privilege by restricting batch programs to only the specific database segments required for their business function. This protects sensitive cardholder and transaction data from unauthorized access or accidental corruption.
  • Operational Stability: By defining clear logical views of the database, it ensures that batch processing programs (such as those handling transaction authorizations, data archiving, and backups) execute reliably without disrupting online customer transactions.
  • Regulatory Compliance: In financial services, strict control over who and what can access credit card data is mandatory. This library is a key technical control that supports compliance audits by documenting and enforcing database access rules.
How Jobs and Programs Interact with the Dataset

The library is accessed as an input source by critical batch jobs that manage the lifecycle of credit card authorization data. These interactions support three main business functions:

1. Database Maintenance and Backups (Unload Operations)

When administrative jobs (such as DBPAUTP0 and UNLDPADB ) run to back up or extract pending authorization data, they reference this library to obtain the authorized logical view of the database. This allows them to safely extract point-in-time data for system optimization, database reorganization, or downstream reporting.

2. Data Loading and Synchronization (Load Operations)

When the system needs to update or populate the database with new pre-authorization records (such as in job LOADPADB ), the program uses the definitions in this library to safely insert and link new transaction records while maintaining database integrity and preventing concurrent access conflicts.

3. Archiving and Reporting (Extraction Operations)

For historical archiving and financial auditing (such as in job UNLDGSAM ), programs read this library to locate and extract specific transaction relationships. This ensures that archived files accurately reflect the business relationships between account summaries and detailed transaction histories.

OEM.IMS.IMSP.RECON1

The OEM.IMS.IMSP.RECON1 dataset serves as the central operational registry and control ledger for the Information Management System (IMS).

MAT analysis

Business Role and Importance of the IMS Recovery Control Dataset (RECON1)

1. Business-Level Description

The OEM.IMS.IMSP.RECON1 dataset serves as the central operational registry and control ledger for the Information Management System (IMS). In business terms, it acts as the "source of truth" regarding the status, health, and history of the organization's core databases—specifically those supporting the CardDemo application's credit card authorization services.

Rather than storing actual customer or transaction records, this dataset stores the metadata and operational state of the databases. It records when databases are backed up, which transaction logs are active, and whether the data is currently in a safe, consistent state for processing. It functions much like an automated audit log and traffic controller for database operations.

2. Business Importance and Role

The RECON1 dataset is vital to the business for several key reasons:

  • Data Integrity and Trust: For financial and card authorization systems, data accuracy is paramount. This dataset ensures that administrative actions (such as backups, unloads, or reorganizations) only occur when the database is in a valid, consistent state, preventing data corruption.
  • Business Continuity and Disaster Recovery: In the event of a system outage or hardware failure, this dataset provides the exact blueprint required to restore the database. It tracks recovery points and image copies, ensuring the business can recover quickly with minimal data loss and downtime.
  • Operational Safety and Coordination: It prevents conflicting operations—such as attempting to modify database structures while an active backup is running—thereby protecting core business assets from operational errors.
3. How Jobs and Programs Interact with the Dataset

The dataset is integrated into standard database maintenance and administrative workflows:

  • Validation and Authorization: When administrative jobs like DBPAUTP0 (the Database Unload utility) are executed, the underlying system program ( DFSRRC00 ) accesses RECON1 as an input.
  • State Verification: Before the system allows the extraction of sensitive card authorization data, it queries RECON1 to verify that the database is authorized for utility access, check its current logging status, and ensure there are no outstanding recovery actions required.
  • Safe Execution: This interaction guarantees that the extracted data used for downstream reporting, migration, or archiving is a true, consistent, and authorized representation of the business's operational state.

OEM.IMS.IMSP.RECON2

In a high-volume mainframe environment, maintaining data integrity, system availability, and disaster recovery readiness is paramount.

MAT analysis

Business Overview of the IMS Recovery Control Dataset (RECON2)

In a high-volume mainframe environment, maintaining data integrity, system availability, and disaster recovery readiness is paramount. The dataset OEM.IMS.IMSP.RECON2 is a critical component of the Database Recovery Control (DBRC) system within the Information Management System (IMS). It serves as a specialized, highly secure metadata registry and operational ledger that tracks the state, history, and recovery requirements of the organization's core databases.

1. Business-Level Description

The RECON2 dataset acts as a "source of truth" regarding the operational status of the business's databases. It records vital administrative information, including:

  • Which databases are currently online and active.
  • When the last successful backups (image copies or unloads) were performed.
  • Which transaction logs are associated with specific timeframes.
  • Whether any databases are currently locked for maintenance or reorganization.

To ensure continuous business operations and prevent a single point of failure, IMS utilizes a redundant set of these recovery control files (typically RECON1, RECON2, and RECON3). If one file becomes inaccessible, the system automatically switches to another, ensuring that critical business applications—such as credit card authorization processing—never experience downtime due to control file failure.

2. Business Importance and Role

The RECON2 dataset is fundamental to business continuity, data governance, and risk management. Its primary business values include:

  • Data Integrity and Corruption Prevention: By tracking database authorization states, RECON2 prevents conflicting batch jobs or online transactions from accessing and modifying the same data simultaneously, thereby eliminating the risk of data corruption.
  • Disaster Recovery and Business Continuity: In the event of a system outage or hardware failure, RECON2 provides the exact blueprint required to restore databases to a consistent state. It tells the system precisely which backups and transaction logs must be applied to recover lost data up to the point of failure.
  • Audit and Compliance Readiness: Financial and operational regulations require businesses to prove that their data is securely backed up and recoverable. RECON2 maintains the historical record of database backups and reorganizations, serving as evidence of compliant data management practices.
3. Job and Program Interaction

The RECON2 dataset is accessed during critical database maintenance and administrative workflows.

Context: Database Unload Operations (Job: DBPAUTP0)

During the execution of the DBPAUTP0 job—which is responsible for unloading and backing up credit card authorization data—the system must ensure that the data being extracted is consistent and safe to copy.

  • Program Interaction: The IMS region controller program ( DFSRRC00 ) accesses RECON2 as an input source.
  • Operational Flow: Before the program begins extracting data from the physical database, it queries RECON2 to verify the database's current status. It checks whether the database is in a valid state for unloading, registers the start of the utility execution, and ensures that no conflicting updates are occurring.
  • Result: This interaction guarantees that the resulting backup file is structurally sound, chronologically accurate, and ready to be used for downstream reporting, migration, or disaster recovery.

OEM.IMS.IMSP.RECON3

The OEM.IMS.IMSP.RECON3 dataset serves as a critical administrative ledger and governance registry for the mainframe's database environment.

MAT analysis

Business Role and Importance of the RECON3 Dataset

1. Business-Level Description

The OEM.IMS.IMSP.RECON3 dataset serves as a critical administrative ledger and governance registry for the mainframe's database environment. In an Information Management System (IMS), RECON (Recovery Control) datasets act as the central "source of truth" regarding the status, health, and history of the business's databases.

Operating as part of a highly redundant, tri-allocation system (alongside RECON1 and RECON2), RECON3 ensures continuous availability and data integrity. It records vital operational metadata, including:

  • Which databases are currently active or offline.
  • The exact timing and status of database backups and unloads.
  • Information required to restore the database to a precise point in time in the event of a system failure.

For the CardDemo application—which manages sensitive credit card authorization data—this dataset represents the operational safety net that guarantees data is always tracked, auditable, and recoverable.

2. Business Importance and Value

The RECON3 dataset is fundamental to the business's risk management, compliance, and disaster recovery strategies. Its primary business values include:

  • Business Continuity and Disaster Recovery: In the event of a hardware failure, software corruption, or data loss, the business relies on the RECON datasets to orchestrate a precise recovery. It tells the system exactly which backup files and transaction logs to apply, minimizing downtime and preventing financial loss.
  • Data Integrity and Prevention of Corruption: By maintaining a real-time record of database states, RECON3 prevents conflicting operations. For example, it ensures that a database cannot be modified while a critical backup or unload process is running, protecting the integrity of customer authorization records.
  • High Availability through Redundancy: Mainframe environments require 24/7 availability. By utilizing a three-way redundant structure (RECON1, RECON2, and RECON3), the system can tolerate the loss of one or even two recovery control files without interrupting core business processing or credit card authorization services.
  • Audit and Regulatory Compliance: Financial systems are subject to strict regulatory audits. RECON3 provides an immutable, system-generated log of database administrative actions, proving to auditors that data is being backed up and managed according to corporate governance policies.
3. System and Program Interaction

The RECON3 dataset is utilized during critical database maintenance and administrative workflows.

Interaction in the Database Unload Process (Job: DBPAUTP0)

During the execution of the DBPAUTP0 job—which is responsible for extracting and backing up the CardDemo authorization database—the system interacts with RECON3 in the following manner:

  • State Verification (Input): Before the IMS Region Controller program ( DFSRRC00 ) begins unloading the database, it reads RECON3 as an input source. The program queries this dataset to verify that the target database ( DBPAUTP0 ) is in a valid state to be copied (e.g., that it is not locked by another process and that there are no outstanding recovery errors).
  • Coordination: The program coordinates the information read from RECON3 with the other RECON datasets to ensure absolute consensus across the system before proceeding with the data extraction. This guarantees that the resulting sequential backup file is consistent and reliable for downstream business use.

OEMA.DB2.VERSIONA.SDSNLOAD

The dataset OEMA.DB2.VERSIONA.SDSNLOAD is a foundational system library containing the executable programs, utilities, and runtime modules required to operate and interact with the DB2 relational database management system.

MAT analysis

Business Overview of the DB2 System Load Library (OEMA.DB2.VERSIONA.SDSNLOAD)

1. Business-Level Description

The dataset OEMA.DB2.VERSIONA.SDSNLOAD is a foundational system library containing the executable programs, utilities, and runtime modules required to operate and interact with the DB2 relational database management system.

In the context of the CardDemo (Credit Card Demonstration) application, this dataset serves as the core engine that enables all database-related business processes. It provides the necessary software tools to create database structures, perform bulk data updates, and extract critical financial and transaction reference data. Without this library, the credit card application would be unable to access or manage its underlying database.

2. Business Importance and Role

This dataset is critical to the business operations of the CardDemo application for several key reasons:

  • Operational Readiness and Provisioning: It enables the automated setup and initialization of the database environment. This is vital when deploying the application to new environments, resetting test systems, or recovering from system failures.
  • Data Integrity and Standardization: The library powers the utilities that establish and maintain core reference data, such as transaction types (e.g., Purchases, Cash Advances) and categories. Standardizing this data ensures consistent financial processing and reporting across the entire organization.
  • Efficiency through Automation: Instead of requiring manual, one-by-one database updates, this library enables high-volume batch processing. This allows the business to process bulk changes to transaction rules and classifications quickly and with minimal risk of human error.
  • Business Continuity and Downstream Integration: It facilitates the secure extraction and formatting of database records into sequential files. These files are essential for creating system backups, feeding downstream reporting systems, and supporting business intelligence activities.
3. How Jobs and Programs Interact with the Dataset

The dataset is utilized as a system execution library (via STEPLIB ) across various critical batch jobs. It provides the underlying database utilities that execute the following business functions:

Database Environment Setup and Initialization (Job: CREADB2 )

During application deployment or environment resets, the database setup job calls upon this library to:

  • Clean up and remove obsolete database plans to ensure a clean installation.
  • Execute database definition scripts to construct the tables and indexes required to store credit card information.
  • Load initial reference data (such as transaction classifications) into the newly created tables.
Bulk Transaction Maintenance (Job: MNTTRDB2 )

When business administrators need to update transaction rules, they submit a bulk change file. The maintenance job utilizes this library to:

  • Process the change file in batch.
  • Apply bulk additions, updates, and deletions to the transaction reference tables, ensuring the database remains synchronized with current business policies.
Data Extraction and Archiving (Job: TRANEXTR )

To support reporting, auditing, and system backups, the extraction job relies on this library to:

  • Safely unload active transaction and category data directly from the relational database.
  • Format and structure the extracted data so it can be easily consumed by downstream business applications or archived for compliance purposes.

OEMA.IMS.IMSP.SDFSRESL

The dataset OEMA.IMS.IMSP.SDFSRESL is a foundational system library containing the core execution modules for IBM’s Information Management System (IMS).

MAT analysis

Business Overview of the IMS System Library (OEMA.IMS.IMSP.SDFSRESL)

Business-Level Description

The dataset OEMA.IMS.IMSP.SDFSRESL is a foundational system library containing the core execution modules for IBM’s Information Management System (IMS). In the context of the CardDemo credit card processing application, this dataset serves as the runtime engine that powers all database operations. It does not store business transaction data itself; instead, it contains the critical system software required to access, update, back up, and manage the databases that store credit card holder accounts, credit limits, and pending transaction authorizations.

Whenever the business needs to process credit card pre-authorizations, update account balances, or extract financial data for auditing, this library is called upon to provide the necessary system utilities and database controllers.

Business Importance and Strategic Role

This dataset is vital to the daily operations and long-term stability of the credit card processing system. Its business importance is highlighted by the following key roles:

  • Transactional Integrity and Continuity: It enables the safe, concurrent processing of online credit card transactions and batch updates. This ensures that cardholders can make purchases against up-to-date credit limits without system conflicts.
  • Data Protection and Disaster Recovery: The library provides the utilities used to perform point-in-time backups (unloads) of the authorization databases. These backups are critical for disaster recovery planning and safeguarding sensitive financial data.
  • Regulatory Compliance and Auditing: By enabling data extraction utilities, this library allows the business to archive pending authorization histories and export them to downstream data warehouses. This supports financial reporting, fraud detection, and compliance with industry regulations (such as PCI-DSS).
  • System Performance Optimization: It contains the software tools necessary to reorganize databases, reclaim storage space, and tune performance, ensuring that transaction authorization response times remain fast and reliable for customers.
Job and Program Interactions

Several critical batch processes interact with this dataset as a read-only system library (referenced via STEPLIB and DFSRESLB DD statements). It acts as the prerequisite environment for executing any program that communicates with the IMS database:

  • Database Backup and Maintenance (Job: DBPAUTP0): This job accesses the library to run standard database unload utilities. This process extracts authorization data into flat files for backup purposes or in preparation for database maintenance.
  • Transaction Loading and Updates (Job: LOADPADB): This job utilizes the library to run batch update programs. It safely imports new pre-authorization records into the live database, ensuring that online customer accounts reflect recent holds and transactions.
  • Data Archiving and Reporting (Jobs: UNLDGSAM & UNLDPADB): These jobs rely on the library to execute extraction programs. They pull pending authorization summaries and detailed transaction histories out of the active database and write them to sequential files, which are then used for downstream financial analysis, auditing, and reporting.

OEMA.IMS.IMSP.SDFSRESL.V151

The dataset OEMA.IMS.IMSP.SDFSRESL.V151 is a core system software library containing the executable modules for IBM’s Information Management System (IMS) Database Trust (specifically Version 15.1).

MAT analysis

Business Utility and Importance of the IMS System Library (OEMA.IMS.IMSP.SDFSRESL.V151)

Business Overview

The dataset OEMA.IMS.IMSP.SDFSRESL.V151 is a core system software library containing the executable modules for IBM’s Information Management System (IMS) Database Trust (specifically Version 15.1). In the context of the CardDemo credit card processing application, this dataset serves as the foundational runtime engine. It provides the necessary system-level programs, database drivers, and region controllers required to execute batch jobs that interact with the application's hierarchical databases.

Rather than containing business transaction data itself, this dataset contains the "engine" that allows the business to read, write, update, and manage its critical credit card pre-authorization and transaction databases.

Business Importance and Role

The pre-authorization process is a critical control point in credit card processing. It places temporary holds on cardholder accounts to verify available funds and prevent fraud before a transaction is finalized. This system library is vital to the business for several reasons:

  • Operational Continuity and Concurrency: The library enables batch jobs to run in Batch Message Processing (BMP) mode. This allows the system to safely update active databases in the background while online customers continue to swipe their cards and make purchases without experiencing system downtime or performance degradation.
  • Data Integrity and Security: By providing the official IMS database access routines, the library ensures that all database reads and writes conform to strict transactional rules. This prevents data corruption, ensures that credit limits and balances are calculated accurately, and maintains the relational integrity between account summaries and detailed transaction records.
  • Downstream Business Intelligence: The library powers the utilities that extract pending transaction data. This extracted data is essential for downstream financial auditing, regulatory reporting, risk management, and data warehousing.

Without this system library, the core database engine could not run, halting all batch processing for credit card pre-authorizations, database updates, and financial archiving.

Job and Program Interactions

Several critical batch jobs and programs reference this dataset as a system library (via STEPLIB and DFSRESLB allocations) to bootstrap their database operations:

1. Database Loading and Synchronization (Job: LOADPADB)
  • Business Function: This job updates the active pre-authorization database with new transaction holds and account status updates.
  • Interaction: The job references the system library to execute the IMS Region Controller ( DFSRRC00 ). This controller initializes the environment and runs the application program ( PAUDBLOD ), allowing it to safely insert new root and child pre-authorization records into the live database.
2. Data Archiving and Reporting (Job: UNLDGSAM)
  • Business Function: This job extracts pending credit card authorization summaries and detailed transaction records, archiving them into sequential files to support downstream financial reporting and maintain database performance.
  • Interaction: The job utilizes the system library to run the extraction utility ( DBUNLDGS ). The library provides the specialized sequential access methods (GSAM) required to write the extracted data into flat files efficiently.
3. Database Unloading and Migration (Job: UNLDPADB)
  • Business Function: Similar to the archiving process, this job unloads the hierarchical pending authorization database into flat sequential files, which are critical for data migration, system integration, and offline reporting.
  • Interaction: The job relies on the system library to execute the database unload utility ( PAUDBUNL ), providing the underlying database communication protocols to scan the hierarchical structure and output the data into structured flat files.

OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB)

The dataset OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) is a core system configuration file that establishes the performance, memory allocation, and data-buffering rules for the CardDemo credit card application's database environment.

MAT analysis

Business Utility of the DFSVSMDB Configuration Dataset

Business-Level Description

The dataset OEMPP.IMS.V15R01MB.PROCLIB(DFSVSMDB) is a core system configuration file that establishes the performance, memory allocation, and data-buffering rules for the CardDemo credit card application's database environment. Specifically, it configures the virtual storage and buffer pools used to access the Pre-Authorization (PAUT) database.

In the credit card processing business, pre-authorizations are critical, time-sensitive operations where temporary holds are placed on cardholder accounts to verify funds before transactions are finalized. This dataset acts as an operational blueprint, instructing the database management system on how to efficiently manage memory and disk access when reading or writing these vital financial records.

Business Importance and Role

The primary role of this dataset is to guarantee system performance, data integrity, and operational efficiency. Its business importance is highlighted by the following key impacts:

  • SLA and Performance Maintenance: Credit card processing requires rapid execution. By optimizing how data is buffered in memory, this configuration minimizes slow physical disk reads, ensuring that batch updates and extractions complete within their designated maintenance windows.
  • Operational Stability: During high-volume batch runs, improper memory management can lead to system bottlenecks or database lockups. This dataset ensures that resources are allocated safely, preventing system crashes that could disrupt cardholder services.
  • Support for Concurrent Processing: Certain batch jobs run concurrently with online transaction processing. This configuration file ensures that batch updates do not monopolize database resources, allowing online customers to continue swipe-and-pay operations without experiencing delays.
  • Data Integrity during Financial Archiving: By providing stable database access parameters, the dataset ensures that critical financial audits, downstream reporting, and data warehousing extractions are executed against a stable and reliable database state.
Job and Program Interactions

This dataset is utilized as a shared, read-only input configuration across all major batch processes that interact with the Pre-Authorization database. It is mapped to the system under the standard database buffer parameter definition (DD name DFSVSAMP ).

Database Unload and Extraction Operations (Jobs: DBPAUTP0, UNLDPADB)

When the business needs to back up authorization data or extract it for downstream analytics, these jobs read the configuration dataset. Programs like PAUDBUNL and standard system utilities use these parameters to establish high-speed read paths, allowing them to quickly stream hierarchical database records into sequential flat files without degrading overall system performance.

Database Loading and Updating Operations (Job: LOADPADB)

When new pre-authorization transactions and account updates need to be loaded into the active database, the load utility program ( PAUDBLOD ) references this dataset. The configuration ensures that database inserts and updates are buffered efficiently, reducing the time required to commit transactions and release database locks.

Financial Archiving and Reporting (Job: UNLDGSAM)

For long-term compliance and auditing, the archiving program DBUNLDGS extracts pending transaction summaries and detailed history records. This program relies on the dataset to optimize sequential database scans, ensuring that massive volumes of historical financial data can be archived safely and efficiently without impacting daily business operations.

XXXXXXXX.PROD.LOADLIB

The dataset XXXXXXXX.PROD.LOADLIB serves as the central repository for compiled, executable production programs within the organization's mainframe environment.

MAT analysis

Business Overview of the Production Load Library (XXXXXXXX.PROD.LOADLIB)

Business-Level Description

The dataset XXXXXXXX.PROD.LOADLIB serves as the central repository for compiled, executable production programs within the organization's mainframe environment. In business terms, it is the "engine room" containing the finalized, approved software applications that run the company's daily operations.

Rather than holding raw data or source code, this dataset stores the actual machine-readable instructions required to execute critical business processes. For example, it houses the core logic responsible for managing customer authorizations, data cleanup, and compliance-related database maintenance.

Business Importance and Role

The XXXXXXXX.PROD.LOADLIB dataset is vital to the organization’s operational stability, compliance posture, and system performance:

  • Operational Continuity: It ensures that core business functions—such as processing transactions and managing customer records—run reliably using verified, production-grade software.
  • Regulatory Compliance and Data Governance: By hosting critical utility programs (such as those that purge expired authorization records), this library directly supports data retention policies. It ensures the business does not retain sensitive customer data longer than legally permitted, mitigating compliance risks.
  • System Efficiency: The programs stored in this library maintain database health. By automating the removal of obsolete data, they prevent database bloat, reduce storage costs, and ensure that active customer transactions are processed without delay.
  • Security and Control: As a production execution library, access to this dataset is strictly controlled. Only thoroughly tested and authorized software is promoted to this library, protecting the business from unauthorized system changes and operational disruptions.
How Jobs and Programs Interact with the Dataset

During scheduled batch processing cycles, the mainframe operating system accesses XXXXXXXX.PROD.LOADLIB to locate and run specific business applications.

  • Retrieval and Execution: When a business process is triggered (such as the nightly cleanup of expired authorizations in job CBPAUP0J ), the system queries this library to retrieve the compiled program (such as CBPAUP0C ).
  • Read-Only Access: During execution, the library is accessed in a read-only capacity. This ensures that the executable code remains secure and unaltered while it performs its designated business logic, such as scanning databases, evaluating record validity, and executing database updates.