Skip to content

Code conversion, pair by pair

VB6 to COBOL

The same routine, written by hand in VB6 and in COBOL. It is here so you can see what changes and what does not before anyone quotes you anything.

Before · VB6

Public Function Interest(ByVal Balance As Currency, _
                         ByVal Rate As Double) As Currency
    Interest = Round(Balance * Rate, 2)
End Function

What it becomes · COBOL

       IDENTIFICATION DIVISION.
       PROGRAM-ID. INTEREST.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-BALANCE     PIC S9(9)V99 COMP-3 VALUE 0.
       01  WS-RATE        PIC S9(1)V9(4) COMP-3 VALUE 0.0425.
       01  WS-INTEREST    PIC S9(9)V99 COMP-3.
       PROCEDURE DIVISION.
           COMPUTE WS-INTEREST ROUNDED = WS-BALANCE * WS-RATE
           DISPLAY 'INTEREST: ' WS-INTEREST
           STOP RUN.
One routine: a balance times a rate, rounded to the cent. Written by an engineer in both languages, so you can read what the target actually looks like.
Below is one routine in both languages. On a real system the same move runs across the whole tree at once — our platform reads every language in it in parallel, builds the dependency graph, and an engineer cuts the boundaries. A million lines is the normal size of that job, and it finishes inside thirty days.

What this looks like on your whole system

On your actual codebase the same move answers the questions a pair of files cannot: which files nothing calls any more, which batch job writes the record another one reads at 02:00, and whether the rewritten version still produces the numbers your auditors saw last month. The assessment comes back with all three, in three to five days.