Back to Blog and Resources

Worked Example

Finding the Business Logic That Matters: One Rule, Six Places

A single late-fee rule in a receivables application touches a copybook, a program, a JCL step, a DB2 column, a CICS transaction, and a regulatory report. Following it shows which details matter.

By Code Comprehend3 min read

The Question

A receivables team is asked a simple question before a modernization decision: how does the system charge a late-payment fee? The answer is not in one place. This illustrative trace follows the rule through a typical mainframe application to show where business logic hides and how to tell which details matter.

The Trace

  1. Copybook CUSTBAL

    Field LATE-FEE-PCT is defined as PIC 9V99. No comment explains where the value comes from or who may change it. Nine programs include this copybook.

  2. Program ARPOST01, paragraph 3200-APPLY-LATE-FEE

    The fee applies when days past due exceed a grace period. The grace period is a WORKING-STORAGE constant of 10. A later IF statement skips the fee entirely when CUST-TYPE equals G, which the team eventually confirms means government accounts.

  3. JCL job ARNIGHT, step POSTFEES

    ARPOST01 runs only when the preceding aging step ends with return code 0. When aging ends with return code 4, the fee step is bypassed and the job still completes successfully. Nothing reports that fees were not posted.

  4. DB2 table AR_ACCOUNT, column FEE_WAIVED_IND

    A waiver indicator suppresses the fee for an account. It is set by a CICS transaction, not by any batch program, so the waiver path exists only through an online screen used by the collections group.

  5. CICS transaction ARWV

    The waiver screen allows any operator with the collections role to set the indicator. There is no expiry, so a waiver granted once remains in effect until someone clears it manually.

  6. Downstream: GL extract and regulatory report

    The nightly GL extract reads posted fee amounts. A quarterly regulatory report counts waived fees by account type. Both depend on the behavior above without referencing it.

What the Trace Reveals

One rule turned out to be at least four: a ten-day grace period, a government exemption, a silent skip when aging returns a warning, and an indefinite manual waiver. Only the first appears in the documentation the team had.

Each is a business decision with consequences for revenue, customers, or regulators. None is visible from the program name or the field definition alone.

Every statement in this trace points to a program, paragraph, job step, column, or transaction. That is what makes it reviewable by an architect and challengeable by a subject matter expert.

Deciding What Matters

Not every technical detail deserves this attention. The test is consequence. A rule matters when it changes money, customer treatment, regulatory reporting, or what a downstream system receives. Field formats, unreferenced paragraphs, and cosmetic screen logic rarely meet that bar.

The silent skip on return code 4 matters. The exact PIC clause on LATE-FEE-PCT does not, unless the target platform handles decimals differently.

Evidence First, Then the Expert

With the trace in hand, the conversation with the collections lead takes twenty minutes instead of an afternoon. She confirms the government exemption is current policy, explains that the return code 4 skip caused a known incident two years ago, and flags that indefinite waivers are already an audit finding.

That is the pattern: automation and analysis assemble the evidence, and the expert supplies the meaning and the history. Neither alone would have produced a complete answer.

The application, names, and figures in this example are illustrative and do not describe any specific customer system.

Bring a real application question

Work with us to evaluate how Comprehend can support a defined mainframe application or application family.

Explore the Comprehend Design Partner Program