Codebase analysis · CoreStory V3

AWS CardDemo

A mainframe credit card management application published by AWS as a reference for modernization work. It is written in COBOL and runs on CICS, VSAM, DB2, IMS and MQ.

Maintained by
Amazon Web Services
License
Apache-2.0
Commit analyzed
59cc6c2fd7ebd7ef7925cad552a01a4b8b6e4d5e
Rules extracted
2026-11-11
Extracted by CoreStory V3
761
verified business rules, each with a cited source quote
127
files that contain rules
9
capabilities
139
features
01 · Rules

Business rules, traced to source lines.

These 12 rules are a sample of the 761 CoreStory V3 extracted from AWS CardDemo. Each one links to the exact lines on GitHub at commit 59cc6c2. The statement is CoreStory V3’s wording; the code excerpt is the source it cites.

calculation
app/app-authorization-ims-db2-mq/cbl/CBPAUP0C.cbl

The authorization date is converted as 99999 minus PA-AUTH-DATE-9C, and the day difference is current Julian date (YYDDD) minus that date. A pending authorization detail qualifies for deletion when the day difference is greater than or equal to the expiry days; otherwise it does not qualify.

  • 99999 — constant subtracted from inverted authorization date to get the authorization date
COMPUTE WS-AUTH-DATE = 99999 - PA-AUTH-DATE-9C COMPUTE WS-DAY-DIFF = CURRENT-YYDDD - WS-AUTH-DATE IF WS-DAY-DIFF >= WS-EXPIRY-DAYS SET QUALIFIED-FOR-DELETE TO TRUE
calculation
app/cbl/CBACT04C.cbl

For each transaction-category balance record, monthly interest is computed as (TRAN-CAT-BAL * DIS-INT-RATE) / 1200 and stored in WS-MONTHLY-INT, a signed value with two decimal places. The 1200 divisor converts an annual rate percentage to a monthly rate. The interest is added to the account's running total interest.

  • 1200 — divisor applied to balance times interest rate to get monthly interest
= ( TRAN-CAT-BAL * DIS-INT-RATE) / 1200

Also cited: L467

limit
app/cbl/CBTRN02C.cbl

A transaction passes the credit limit check only if the account credit limit is greater than or equal to the projected balance (WS-TEMP-BAL); otherwise it fails validation with reason code 102 and description 'OVERLIMIT TRANSACTION'.

  • 102 — validation failure reason code for overlimit
  • OVERLIMIT TRANSACTION — failure reason description
IF ACCT-CREDIT-LIMIT >= WS-TEMP-BAL

Also cited: L410, L411

validation
app/cbl/CBTRN02C.cbl

A transaction passes only if the account expiration date is greater than or equal to the first 10 characters of the transaction original timestamp; otherwise it fails validation with reason code 103 and description 'TRANSACTION RECEIVED AFTER ACCT EXPIRATION'.

  • 10 characters — length of original timestamp prefix (date) compared to expiration date
  • 103 — validation failure reason code for expired account
  • TRANSACTION RECEIVED AFTER ACCT EXPIRATION — failure reason description
IF ACCT-EXPIRAION-DATE >= DALYTRAN-ORIG-TS (1:10)

Also cited: L417, L418

calculation
app/app-authorization-ims-db2-mq/cbl/COPAUA0C.cbl

When a pending authorization summary segment is found, available amount = PA-CREDIT-LIMIT minus PA-CREDIT-BALANCE; if the transaction amount is greater than the available amount, the authorization is declined with reason insufficient funds.

IF WS-TRANSACTION-AMT > WS-AVAILABLE-AMT

Also cited: L665, L666, L667

decision
app/app-authorization-ims-db2-mq/cbl/COPAUA0C.cbl

The response reason defaults to '0000'; for declined authorizations it is '3100' when the card, account or customer is not found, '4100' for insufficient funds, '4200' for card not active, '4300' for account closed, '5100' for card fraud, '5200' for merchant fraud, and '9000' otherwise.

  • 0000 — default reason (approved)
  • 3100 — reason: card/account/customer not found
  • 4100 — reason: insufficient funds
  • 4200 — reason: card not active
  • 4300 — reason: account closed
  • 5100 — reason: card fraud
  • 5200 — reason: merchant fraud
  • 9000 — reason: other
MOVE '0000'

Also cited: L704, L706, L708, L710, L712, L714, L716

validation
app/cbl/COBIL00C.cbl

If the account's current balance is less than or equal to zero (and an account ID was supplied), payment is rejected with the message 'You have nothing to pay...'.

  • 0 — balance threshold; balance must be greater than this to pay
  • You have nothing to pay... — error message
IF ACCT-CURR-BAL <= ZEROS AND ACTIDINI OF COBIL0AI NOT = SPACES AND LOW-VALUES

Also cited: L201

calculation
app/cbl/COBIL00C.cbl

The bill payment transaction amount equals the account's full current balance.

MOVE ACCT-CURR-BAL TO TRAN-AMT
validation
app/cbl/COACTUPC.cbl

A customer FICO score is valid only when it is between 300 and 850 inclusive; otherwise an input error is set with the message 'should be between 300 and 850'.

  • 300 — minimum valid FICO score
  • 850 — maximum valid FICO score
88 FICO-RANGE-IS-VALID VALUES 300 THROUGH 850.

Also cited: L2523

validation
app/cbl/COACTUPC.cbl

The first three digits of an SSN must not be 000, 666, or between 900 and 999; such values cause an input error.

  • 0 — invalid SSN part 1 value
  • 666 — invalid SSN part 1 value
  • 900 — start of invalid SSN part 1 range
  • 999 — end of invalid SSN part 1 range
88 INVALID-SSN-PART1 VALUES 0, 666, 900 THRU 999.

Also cited: L2457

validation
app/cbl/COTRN02C.cbl

Amount must be in the format -99999999.99: first character '-' or '+', characters 2-9 numeric (8 digits), character 10 a '.', and characters 11-12 numeric (2 digits); otherwise the error 'Amount should be in format -99999999.99' is raised.

  • - — permitted sign character
  • + — permitted sign character
  • . — required decimal point at position 10
  • 8 digits — integer digits in positions 2-9
  • 2 digits — decimal digits in positions 11-12
WHEN TRNAMTI OF COTRN2AI(1:1) NOT EQUAL '-' AND '+' WHEN TRNAMTI OF COTRN2AI(2:8) NOT NUMERIC WHEN TRNAMTI OF COTRN2AI(10:1) NOT = '.' WHEN TRNAMTI OF COTRN2AI(11:2) IS NOT NUMERIC
state transition
app/app-authorization-ims-db2-mq/cbl/COPAUS1C.cbl

On PF5, if the authorization is already fraud-confirmed it is set to fraud-removed and the action is 'R' (remove); otherwise it is set to fraud-confirmed and the action is 'F' (report).

  • F — report fraud action code
  • R — remove fraud action code
IF PA-FRAUD-CONFIRMED

Also cited: L99, L100

02 · Capabilities

What the application does

9 capabilities and 139 features, as described by an earlier CoreStory V3 ingest of the same commit. These are descriptions, not the cited rules above.

Account and Customer Servicing

Supports customer profile, account inquiry, account maintenance, account records, account-customer relationships, and related file access.

  • Account Balance Inquiry: Allows a user to enter an account identifier and view the associated current balance with confirmation and error-message feedback.
  • Account Details Inquiry: Provides a user-triggered inquiry capability for retrieving account details in the CardDemo extension.
  • Account File Access: Provides callable access to account records using shared operation controls and account file status/record structures.
  • Account Inquiry: Provides an interactive account lookup screen that accepts an account input, validates it, retrieves related card, account, and customer data, and returns the populated screen to the user.
  • Account Maintenance Screen: Provides a screen-based capability for viewing and updating account and customer profile details, including identifiers, personal information, address/contact data, dates, status, balances, limits, messages, and function-key navigation.
  • Account Record Display: Displays account records read from the account file for direct observation.
  • Account Record Maintenance: Updates account records as transactions are posted.
  • Account Request Processing: Processes account-related request messages and produces structured account responses for a requesting system.
  • Account and Customer Update: Provides an interactive workflow to search for account details, display current and proposed account/customer information, accept changes, and confirm whether the update succeeded or failed.
  • Cross-Reference File Access: Provides callable access to cross-reference records using shared operation controls and cross-reference file status/record structures.
  • Customer Account View: Provides a screen-oriented capability to look up and display customer account details, balances, limits, dates, status, contact information, and user messages.
  • Customer File Access: Provides callable access to customer records using shared operation controls and customer file status/record structures.
  • Customer File Record Iteration: Provides sequential access to customer file records by opening the customer file, fetching successive customer records, detecting end of file, and closing the file.
  • Customer Profile Management: Provides a customer profile capability covering identity, contact, address, account, and credit-related customer information.
  • XREF File Access: Provides sequential access to XREF file records, including opening the file, retrieving the next record, detecting end of file, and closing the file.

Batch Data Exchange and Record Operations

Supports batch execution, database record operations, import and export flows, generated output files, unload/load processing, and error reporting.

  • Account Array File Generation: Generates array-formatted account records containing account balance data for downstream use.
  • Account Data Export: Exports account records into the shared export output while tracking account export status and counts.
  • Account Output File Generation: Generates fixed account output records from input account file records.
  • Account-Customer Cross-Reference Export: Exports cross-reference records into the shared export output while tracking cross-reference export status and counts.
  • Batch Database Record Maintenance: Processes input records to apply database maintenance actions including record insertion, update, and deletion.
  • Batch Export Import: Processes exported input records as a batch import and tracks imported customer, account, card, transaction, and cross-reference record counts and statuses.
  • Batch Job Execution: The application supports running batch jobs as an operational capability.
  • Card Account Data Export: Exports structured customer, account, card, cross-reference, and transaction records with export metadata for downstream consumption.
  • Card Data Export: Exports card records into the shared export output while tracking card export status and counts.
  • Customer Data Export: Exports customer records into the shared export output while tracking customer export status and counts.
  • Database Record Operations: Provides function-code driven capabilities for retrieving, inserting, deleting, and replacing records.
  • Import Error Reporting: Produces error output for import processing, including error record details and counts for written or unknown-record errors.
  • Pending Authorization Database Load: Loads pending authorization summary and detail records from input files into the authorization database and tracks records written.
  • Pending Authorization Export: Extracts pending authorization summary and detail records from the authorization database into output records for downstream consumption.
  • Pending Authorization Unload: Exports pending authorization summary and detail data from the authorization database into output records with observable read and write counts.
  • Transaction Data Export: Exports transaction records into the shared export output while tracking transaction export status and counts.
  • Variable Account Record Generation: Generates variable account record outputs using separate account record layouts.

Card and Credit Card Servicing

Provides card and credit-card lookup, listing, filtering, updating, navigation, detail display, and user messaging.

  • Card Detail Lookup: Allows a user to enter account and card search keys, retrieve matching card data, and show the card details on the update screen.
  • Card Detail Update: Allows a user to change card details, confirm the changes, and write the updated card record.
  • Card Details Inquiry: Provides a screen-oriented capability to view or enter card and account details including card name, status, and expiration information with user messages.
  • Card File Reading: Provides sequential access to card file records by opening the card file, reading records until end of file, and closing the file.
  • Card List Display: Displays a card list screen with account, card number, and card status rows plus user messages.
  • Card List Filtering: Allows the card list to be filtered by account and card criteria before records are shown.
  • Card List Pagination: Supports moving through card list pages by reading records forward or backward and tracking first, last, and next-page state.
  • Card Row Action Selection: Lets a user select card list rows and request view, update, or detail actions for the selected card.
  • Card Transaction Detail Display: Provides a screen-oriented capability to enter card/account context and view transaction details including amount, dates, category, type, source, and merchant information.
  • Credit Card Identifier Entry: Allows credit card workflows to capture account, card, and customer identifiers for user-facing credit card operations.
  • Credit Card List Inquiry: Provides a paginated screen for viewing and selecting credit cards with associated account numbers, statuses, card types, and user messages.
  • Credit Card Management: The application provides user-facing credit card management capabilities through documented user functions and online screens.
  • Credit Card Screen Navigation: Supports user navigation across credit card screens through attention keys and next screen/program targets.
  • Credit Card Search and Display: Allows a user to enter account and/or card search criteria, retrieve matching card data, and display card details on the CICS card list screen.
  • Credit Card Update: Allows a user or calling system to view and submit updates to credit card details such as account, card identifier, cardholder name, status, and expiration date.
  • Credit Card User Messaging: Provides return and error messages for credit card user interactions.

Menus, Navigation, and Screen Flow

Provides administrative and main menu interaction, option selection, screen display, previous-screen returns, sign-on returns, wait behavior, and completion screens.

  • Admin Menu Options: Provides the administrative menu options data used to present or drive choices in the admin menu.
  • Administrative Functions: The application provides administrative capabilities accessible through documented admin functions and an admin menu.
  • Administrative Menu: Provides an administrative menu screen that displays titles, date/time, messages, and selectable menu options for user navigation.
  • Administrative Menu Display: Presents the administrative menu with populated header information and available menu options.
  • Administrative Menu Selection: Receives and processes a user's administrative menu option selection submitted from the menu screen.
  • Configurable Wait: Provides a wait capability driven by a supplied parameter value and wait-time data.
  • Main Menu Options: Provides the structured set of main menu options, including option number, name, program target, and user type availability.
  • Menu Option Selection: Receives and processes a user's menu option selection to determine the requested transaction or program.
  • Menu Screen Display: Presents a menu screen with header information and available menu option text.
  • Previous Screen Navigation: Allows the transaction view flow to return to the prior screen using the shared communication area.
  • Return to Previous Screen: Provides navigation from the transaction list back to the prior screen.
  • Return to Signon: Allows the session to leave the menu and return to the signon screen.
  • Thank You Screen Display: Displays a thank-you screen with screen title content for the user.

Payments, Authorizations, and Fraud Control

Handles bill payments, authorization processing, pending authorization review, fraud status management, authorization cleanup, and request-response tracking.

  • Authorization Batch Processing: Supports batch-oriented processing of credit card authorization data.
  • Authorization Fraud Marking: Allows users to mark or remove a selected pending authorization as fraud and update its fraud status.
  • Authorization Management: Provides user-facing authorization review and management through summary, detail, and fraud-marking views.
  • Bill Payment Processing: Processes a submitted bill payment by using account information, payment confirmation, transaction amount/date, account update, and transaction recording.
  • Bill Payment Screen Interaction: Presents and receives the bill payment screen, including header context, screen clearing, and returning to the previous screen.
  • Credit Card Authorization: Provides a screen-oriented capability to enter credit card, merchant, and transaction authorization details and display authorization responses or errors.
  • Credit Card Authorization Processing: Processes credit card authorization requests and produces authorization responses for consuming systems.
  • Expired Pending Authorization Cleanup: Removes expired pending authorization summary and detail records and tracks the number of deleted records.
  • Expired Pending Authorization Purge: Identifies pending authorization records by authorization date and expiry settings, reads summary and detail records, and tracks deleted expired records.
  • Fraud Status Management: Records and exposes fraud confirmation or removal status for authorization activity.
  • Fraud Status Update: Updates fraud status for an account authorization, including reporting or removing fraud and returning update outcome status.
  • MQ Request/Reply Processing: Processes messages from configured MQ input queues and sends response or error messages to the appropriate reply, response, or error queues.
  • Payment Authorization Processing: Processes and exposes payment authorization outcomes and related authorization details for transactions.
  • Payment Authorization Request: Supports submitting or representing a card payment authorization request with card, merchant, transaction, and message details.
  • Payment Authorization Response Tracking: The system captures payment authorization outcome details for a card transaction, including approval amount, authorization identifiers, response status, reason, card number, and transaction ID.
  • Pending Authorization Cleanup: Removes pending authorization summary and detail records and tracks the number of records read and deleted.
  • Pending Authorization Detail Selection: Lets users select a pending authorization from the list to proceed to its detail view.
  • Pending Authorization List Display: Displays account context and a paged list of pending authorizations for review.
  • Pending Authorization Pagination: Allows users to move through pages of pending authorizations and reposition the authorization list.
  • Pending Authorization Review: Allows users to view pending authorization information on the authorization view screen.
  • Pending Authorization Screen Navigation: Supports navigation away from the pending authorization screen back to a previous or menu screen.
  • Pending Card Authorization Processing: Processes pending card authorization requests from a message-driven interface and returns authorization responses indicating approval or decline.
  • Pending Transaction Authorization Review: Provides a user-facing screen for reviewing customer account transaction authorization items, selecting entries, and observing approval or decline status and totals.
  • Rejected Transaction Output: Produces reject records for transactions that fail processing so they can be reviewed or handled downstream.
  • Transaction Authorization Matching: Tracks whether authorizations are matched to transactions, pending, or expired pending a match.

Reporting, Date, and System Utilities

Generates account statements and transaction reports while supporting report parameters, system date inquiry, date conversion, and date validation.

  • Account Statement Generation: Generates customer account statement output with account details, balances, transaction entries, and HTML/statement file records.
  • Date Format Conversion: Provides structured inputs and outputs for converting date values between supported formats such as compact YYYYMMDD and dashed YYYY-MM-DD representations, including status/error reporting.
  • Date Validation: Validates edited date input and exposes validation status, severity, and message information for consumers.
  • Report Parameter Entry: Provides a user-facing screen for selecting report timing or a custom date range, confirming the request, and displaying feedback.
  • System Date Inquiry: Provides a user-triggered inquiry capability for retrieving the system date in the CardDemo extension.
  • Transaction Detail Report: Provides a transaction detail report with account, transaction, category, type, source, date header, and page/grand/account total information.
  • Transaction Report Generation: Generates a transaction report from transaction, card cross-reference, transaction type, transaction category, and date parameter records with report totals.
  • Transaction Report Request: Allows a user to enter transaction report criteria on a CICS screen and submit a batch report job using those parameters.

Transaction Processing and History

Supports transaction capture, addition, posting, recording, inquiry, browsing, selection, list display, and transaction history workflows.

  • Daily Transaction Posting: Processes daily transaction input by looking up related cross-reference and account records, validating transactions, and posting accepted transactions.
  • Daily Transaction Processing: Processes a daily transaction input file by reading transaction records, resolving related card/account data, and producing transaction-file records for downstream use.
  • Daily Transaction Recording: Captures daily card transaction details, including transaction identifiers, amount, card, merchant, category/type, source, and timestamps for downstream use.
  • Transaction Add Screen Navigation: Supports displaying, clearing, initializing, and returning from the transaction add screen as part of the user interaction flow.
  • Transaction Addition: Provides a screen-driven capability to enter, validate, and create a new transaction record linked to card and account data.
  • Transaction Browsing: Reads transaction records and maintains page boundaries and next-page state for browsing transaction results.
  • Transaction Data Capture: Captures structured transaction details, including identifiers, card information, amount, merchant data, source, type/category, and timestamps for downstream processing or observation.
  • Transaction File Access: Provides callable access to transaction records using shared operation controls and transaction file status/record structures.
  • Transaction File Recording: Writes posted transaction records to the transaction file for downstream use or transaction history.
  • Transaction History Browsing: Supports browsing transaction records with page state, transaction selection state, and transaction-file browse operations.
  • Transaction Inquiry: Allows a user to enter a transaction identifier and view transaction, card, merchant, date, amount, type, category, source, description, and status/error information on an inquiry screen.
  • Transaction List Browsing and Selection: Provides a screen-oriented capability for users to view a paginated list of transactions with IDs, dates, descriptions, amounts, selectable rows, and status/error context.
  • Transaction List Display: Displays a transaction list screen populated with header information and transaction records from the transaction file.
  • Transaction List Pagination: Allows users to page forward and backward through transaction list results while maintaining page position and boundary state.
  • Transaction Recording: Captures and represents transaction details including identifiers, card and amount information, merchant details, categorization, source, and timestamps.
  • Transaction Selection: Processes user entry on the transaction view screen to capture a selected transaction.
  • Transaction View Screen: Displays and receives a transaction viewing screen with initialized fields and populated header information.

Transaction Type and Balance Configuration

Manages transaction type definitions, transaction type browsing and selection, online and batch transaction type administration, and category balance maintenance.

  • Batch Transaction Type Management: Provides a batch capability for managing transaction types in the CardDemo DB2-backed extension.
  • Online Transaction Type Management: Provides an online capability for managing transaction types in the CardDemo DB2-backed extension.
  • Transaction Category Balance Generation: Produces transaction-category balance records by combining account, transaction, card/customer cross-reference, and disclosure group data for a dated batch run.
  • Transaction Category Balance Maintenance: Maintains transaction category balance records by creating or updating category balance entries during transaction posting.
  • Transaction Type Create: Supports prompting for new transaction type data and creating a new transaction type record.
  • Transaction Type Delete: Supports delete confirmation for a transaction type record and reports successful or failed deletion.
  • Transaction Type Filtering: Allows the transaction type list to be filtered by type code and description criteria.
  • Transaction Type List Browsing: Displays a paged transaction type list and supports forward and backward navigation through records.
  • Transaction Type Maintenance Screen: Presents and refreshes the CICS transaction type maintenance map, including initial, original, updated, and informational screen content.
  • Transaction Type Record Deletion: Lets users request deletion of selected transaction type records and reports deletion completion status.
  • Transaction Type Record Update: Lets users submit changes to selected transaction type records and reports update completion status.
  • Transaction Type Screen: Provides an interactive screen for entering or viewing a transaction type code and description, with user messages and function-key controls.
  • Transaction Type Search: Allows a user to enter search keys and observe whether transaction type data is found or missing.
  • Transaction Type Selection: Provides a screen-oriented capability for viewing transaction names/descriptions and selecting from multiple transaction type options.
  • Transaction Type Update: Allows a user to change existing transaction type details and receive confirmation or failure feedback for the update.

User Access and Security Administration

Covers sign-on, login, user account creation and maintenance, user list navigation, user detail display, and security administration.

  • User Account Deletion: Enables a user deletion workflow that displays and receives the deletion screen, processes the enter key selection, reads user security data, deletes user information and security file data, and returns to the previous screen.
  • User Account Details Entry: Provides an input/output screen for entering or displaying a user's credentials, name, user type, and error feedback.
  • User Addition: Provides a user-add screen flow that receives add-user input, processes submission, and writes the resulting user security record.
  • User Details Display: Provides a user-facing screen for entering a user ID and observing associated user details such as first name, last name, user type, and error feedback.
  • User List Display: Displays a user list screen populated with user security records and header information.
  • User List Display and Selection: Provides a screen-oriented capability to view a paginated list of users with names and user types, enter a user ID, and select listed users.
  • User List Pagination: Allows users to navigate backward and forward through pages of the user list.
  • User Login: Provides a user-facing sign-on screen where a user enters credentials and receives authentication feedback.
  • User Security Maintenance: Enables loading, editing, and saving user security information through a user update workflow.
  • User Selection: Lets a user choose a user record from the list and return that selected user through the shared screen state.
  • User Sign-On: Provides a sign-on screen for entering user credentials and displaying sign-on feedback or errors.
  • User Signon: The application includes a user signon capability for accessing the mainframe application.
  • User Update Screen Navigation: Supports presenting the user update screen with header context and navigating between pages or back to the prior screen.
03 · Size

What was analyzed

  • COBOL · 106 files · 32,477 lines
  • BMS · 21 files · 5,322 lines
  • Text · 10 files · 4,582 lines
  • JCL · 61 files · 2,138 lines
  • Markdown · 6 files · 842 lines
  • DB2 control cards and declarations · 10 files · 408 lines
  • Bourne Shell · 9 files · 297 lines
  • XML · 1 file · 93 lines
  • Assembly · 2 files · 75 lines
  • SQL · 6 files · 53 lines
  • awk · 1 file · 4 lines

Whole repository: 329 files. cloc 2.06 counts 46,291 lines of code in 233 of them (57,355 lines with comments and blanks).

04 · Source

Where this came from

Business rules extracted by CoreStory V3 from the public repository at commit 59cc6c2 on 2026-11-11. Capability descriptions from an earlier CoreStory V3 ingest of the same commit (2026-09-01).

Code excerpts are from the upstream repository and remain under its Apache-2.0 license. CoreStory is not affiliated with or endorsed by Amazon Web Services.

Want this for your own codebase?

Talk to us about mapping the business rules in your repositories.

Talk to an expert