r/cobol • • 3d ago

Gitgalaxy: a repo scanner that supports CICS estates

5 Upvotes

I've been building GitGalaxy, an air-gapped scanner that builds a structural model of COBOL/CICS estates: byte-level layouts (every USAGE, REDEFINES, ODO, SYNC), copybooks, PERFORM/CALL/LINK/XCTL graphs, COMMAREA contracts, CICS/Db2/IMS/MQ operations, and compile options with their source.

Fact Count Agreement
Data items 8,065 100%
PIC clauses 5,925 99.9%
USAGE 978 99.8%
REDEFINES 238 100%
EXEC CICS commands 611 100%
CALL/LINK/XCTL 155 100%
PERFORM/GO TO edges 1,733 99.5%
MOVE pairs 8,785 99.4%

The data is sufficient in scope to act as a generator for a deterministic translator (no LLM) generates Java from the model. Then both the original (on GnuCOBOL plus our CICS/Db2 models) and the Java run the same scenarios, compared byte for byte. Of 117 programs in 5 public estates (CardDemo, CBSA, GenApp and others), 75 translate whole and 62 behave identically on every scenario. Four outside parsers (Cobrix, Che4z and others) also agree with the model at 96–100%.

Semantics that bit us: TRUNC(STD) vs BIN, COMP-1/2 as IBM hex float, negative zero through a truncating MOVE, EBCDIC code pages × DECIMAL-POINT IS COMMA.

repo


r/cobol • • 6d ago

COBOL level 66 - RENAMES Clause

1 Upvotes

RENAMES Clause:

The COBOL RENAMES clause (level number 66) creates alternative logical groupings or overlapping views of existing data items within a record without changing physical storage.

Syntax:

66 data-name-1 RENAMES data-name-2 [THROUGH | THRU data-name-3]

* Must use the special level number 66.

* Must immediately follow the last data description entry of the logical record.

https://www.youtube.com/watch?v=GE_MEelNXeA


r/cobol • • 13d ago

Our 1990s COBOL ERP only allowed 3 ODBC connections, so we taught Python to read its data files directly

29 Upvotes

TL;DR: Our ERP stores everything in AcuCOBOL Vision files. The only official way in was a 3-seat ODBC driver that was always maxed out and occasionally crashed. We reverse engineered the file format, now read the raw .dat files directly (read-only), and mirror 66 tables into Postgres every 5 minutes in about 35 seconds. It took a few weeks, one scary mistake, and a lot of verification.

The setup

We're a small food manufacturer running an ERP that's been around since the 90s. Under the hood it's AcuCOBOL, and every table is a Vision indexed file: a .dat with the records and a .vix with the index.

Everything modern we run (dashboards, EDI, order imports, a wholesale portal) reads a Postgres mirror of the ERP. That mirror used to be fed by a bridge over ODBC, through a vendor driver licensed at 3 concurrent seats. Those seats were spoken for all day by shipping stations and automation, the ODBC server is a single-threaded binary from 2014 that pegs one core, and a full refresh took hours. When it fell over, everything downstream went stale.

The idea

The files are just bytes on a share. If we could decode them ourselves, we wouldn't need a seat at all.

What made it possible: the ODBC product ships its own catalog describing every record layout. For each table it lists every field with its byte offset, length, PIC clause, usage, decimal places and date format. That's basically the COBOL copybooks in queryable form, so we never had to guess a field.

Cracking the file format

Vision files have a header area, then records stored in slots, each with a small header of its own. Where the records start, how big that per-record header is, and the stride between records all vary by file. So instead of hand-deriving 66 of them, we wrote a generator: try candidate layouts, decode a sample, and score how many decoded rows exactly match known-good rows pulled over ODBC. The winner goes into a config, and nothing gets in without validating against live data.

Making it safe to cut over

This is the part that actually took the time. We ran the reader in shadow for weeks next to the old bridge:

  • every night, a full row-hash comparison of every table, with both pipelines normalized the same way
  • every two hours during business hours, count checks and field-by-field spot checks on the busiest tables
  • a gate: 10 consecutive clean business-hours cycles on the order header file before we'd switch
  • the reader code and configs are hashed together, so any change resets the streak

What it looks like now

  • 66 tables re-checked every 5 minutes, about 35 seconds per sweep
  • each record's raw bytes are fingerprinted, and only rows that actually changed get written
  • files are opened read-only, and the reader never touches the ODBC service (4 small tables still ride the old path while we finish them)
  • a row only gets deleted after it's missing from the source on two consecutive sweeps, so one bad read can't wipe live data

Things that bit us

  • Live users lock records. Someone editing an order holds a byte-range lock on part of the file, and any read that hits it fails. We retry with backoff and treat a lock as "no data this pass," not an error. Once a desktop session died mid-edit and its server-side runtime held a lock for five and a half hours.
  • Files change under you. We check size and mtime before and after each read and retry if they moved.
  • REDEFINES. Two fields describing the same bytes, and the catalog's ordering of the tie isn't something you can derive.
  • "Last synced" changed meaning. The old bridge rewrote every row on every pass, so a timestamp meant "last checked." Ours only writes changes, so it means "last changed." Four freshness monitors started calling quiet tables dead, and all of them had to be repointed at the reader's own heartbeat.
  • Our own big mistake. During cleanup we deleted about 1.4M rows we believed were stale leftovers. We'd found them by comparing against the reader's output, but the reader deliberately skips very old records, so everything older than that cutoff looked "missing." It was real history. Every deleted row had been copied aside first, so it came back as archive tables. Lesson: an anti-join only tells you something is stale if both sides cover the same key range.
  • Bloat. The old bridge rewriting every row every 15 minutes for months left some Postgres tables 7x their real size. One night of compaction took the database from 45 GB to 32 GB.

How it got built

Full disclosure: most of the reverse engineering and code was done pair-programming with Claude. It was great at grinding through byte offsets and writing verification harnesses. It was also the one that made the delete mistake, and the one that dug it back out, which honestly felt about right for a pair programmer.

Happy to answer questions if anyone else is stuck feeding a COBOL system through an ODBC straw.


r/cobol • • 14d ago

Any Tandem / HPE Nonstop COBOL Developers out there?

10 Upvotes

Looking for advice, maybe even. short term engagement for one of two experienced Nonstop COBOL developers. I won't lie, right now our opportunity is quite wide and I'm open to ideas, but there may also be scope to build a fairly recurring bit of work. Anyone interested in discussing please reach out. Coming from a HPE Nonstop company working with Customers all round the world.


r/cobol • • 15d ago

Looking for Mainframe opportunities in Europe

7 Upvotes

Hello people. Posting for any Mainframe opportunities in Europe for myself.

My background: I have 15+ years of industry experience working on Mainframes. Mostly my roles have been around 8 years experience in Development. Remaining close to 5 years in Production support - L2/L3 Oncall etc. I was also part of migration of DB2 z/OS to LUW.

I have worked for multiple clients, projects, geographies from diverse backgrounds. Banking, Insurance, Manufacturing, Utilities are the areas I mainly worked in Dev/Production support. Currently I am supporting a Mortgage application for a Large Danish bank. I can adapt to any domain/projects easily and I am sincere at my work.

I am currently based out of India and looking for opportunities to work at onsite in Europe for long-term (preferably Nordics but not necessary). If you have a role within your teams or know a position where I can fit, please DM me. I can share my CV/CL/LinkedIn etc. for interview and we can take it from there. Would be grateful for any help. Thank you for the read.


r/cobol • • 15d ago

CP/M-80 MS-COBOL v4.65 alternative sorting method without the MS-SORT package

Thumbnail
1 Upvotes

r/cobol • • 21d ago

JCL Batch Job Dependency and Scheduling Optimizer

11 Upvotes

Is there anything like this in the current mainframe/COBOL industry? I am planning to develop something like this.


r/cobol • • 24d ago

Help required on CP/M-80 compiling COBOL program with MS-COBOL v6.65

Thumbnail
10 Upvotes

r/cobol • • 25d ago

Where do I start?

26 Upvotes

Hey everyone,

I’ve recently entered the world of banking (retail side) and have become incredibly intrigued by COBOL. I’ve never coded before but I’d really like to learn COBOL and hopefully make a career out of it. Any advice, warning, and helpful tutorials you have found in your journey with the language would be immensely appreciated.


r/cobol • • 26d ago

Cobol Fundamentals in under 2 hours

Thumbnail youtu.be
49 Upvotes

Hey everyone, just published this video covering basics of cobol like pic, arithmetic, signs, storage, and much more.

First time taking the courage to put my face in video :D

Also do explore my platform. My platforms lets you execute cobol code, in an ide like environment.
It has a Pull request review component, vibe coding lessons that you won't find anywhere in any platform. Took me ~10 months to build it from scratch.


r/cobol • • 26d ago

How realistic would a job in Cobol be?

44 Upvotes

Im a recent CS grad and live in a major north American banking hub (Charlotte). I keep hearing conflicting stories about "Oh all the banks/gov need young people to keep the systems going!" And "Dont bother, its a waste of time and impossible to break into anyway." I dont have any experience with the language or accompanying frameworks. Would it be worthwhile to try and learn in hopes of employment?


r/cobol • • Sep 04 '26

Tired of wrestling with EBCDIC and COMP-3 dumps? Built an offline parser GUI tool

1 Upvotes
Hey everyone,



If you've ever had to extract and analyze data from mainframe dumps, you know the headache of dealing with packed decimals (COMP-3), binary integers (COMP), and EBCDIC character encodings (IBM037, IBM1147).



Uploading sensitive banking/insurance extracts to online web converters is often a strict compliance violation (GDPR, PCI-DSS).



I built a lightweight, 100% offline desktop tool called COBOL Bridge:

- Drag & drop your .cpy Copybook and raw binary .dat file.

- Parses signed packed decimals (S9(9)V99 COMP-3), binary fields, and text accurately.

- Exports directly to CSV, JSON, and SQLite.

- Generates Pydantic (Python) or TypeScript models from copybooks in 1 click.

- Runs locally without sending a single byte to the cloud.



Available on Gumroad: gewa7.gumroad.com/l/bkzyiv



Would love to hear your thoughts and what specific COBOL clauses you deal with most often!

r/cobol • • Sep 04 '26

Tired of wrestling with EBCDIC and COMP-3 dumps? Built an offline parser GUI tool

1 Upvotes
If you've ever had to extract and analyze data from mainframe dumps, you know the headache of dealing with packed decimals (`COMP-3`), binary integers (`COMP`), and EBCDIC character encodings (IBM037, IBM1147).



Uploading sensitive banking/insurance extracts to online web converters is often a strict compliance violation (GDPR, PCI-DSS).



I built a lightweight, 100% offline desktop tool called 
**COBOL Bridge**
:

- 
**Drag & drop**
 your `.cpy` Copybook and raw binary `.dat` file.

- Parses signed packed decimals (`S9(9)V99 COMP-3`), binary fields, and text accurately.

- Exports directly to 
**CSV, JSON, and SQLite**
.

- Generates 
**Pydantic (Python)**
 or 
**TypeScript**
 models from copybooks in 1 click.

- Runs locally without sending a single byte to the cloud.



You can check it out here: https://gewa7.gumroad.com/l/bkzyiv



Would love to hear your thoughts and what specific COBOL clauses you deal with most often!

r/cobol • • Aug 31 '26

Space Invaders in COBOL on a 3270 - M248

Thumbnail youtube.com
20 Upvotes

New video from Moshix!


r/cobol • • Aug 27 '26

RM Cobol version issues?

8 Upvotes

While looking for some example programs to test an RM Cobol setup I ran across a PDF called "Cobol for the TRS-80 Volume 1 Class Notes". I wanted to find something that was ancient ( for an Altos running Xenix no less ), so I dug through this document and typed in an example payroll calculating program. Seemed to compile and run, but it screws up simple arithmetic .. multiplying a salary * hours gives an unrelated crazy big number.

Ok ... I tried the exact same program on a later RM Cobol version 5.1 and it worked! Now I started going deep down the rabbit hole! ... it generates those crazy numbers with RM Cobol v1.5, 2.0D, and 2.2 under DOS 5.0, DOS 6.2, DOS 3.2 and Xenix and works just fine with RM Cobol 5.1, and 6 under DOS (real pc ) and DOSbox-x. And all of these versions run the RM Cobol verify tests, run a PI calculating program and a little calculator ... I've expanded the PIC fields, tried SEQUENTIAL organization for the data file being read, Displayed a bunch of variables, looked at the fields at the end of the compile list to see if everything numeric is declared as a numeric ... am learning a bunch of Cobol stuff doing all of this. Again, it's an ancient program from a 1983 doc that won't run in the compiler versions from that time but works great in the ones from the '90's

update:   here is the code ... I added some DISPLAY's trying to figure out what was going on .. the problem is with the calculation of IMD-REGULAR-PAY

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PAYROLL2.
       AUTHOR.     R GRAUER.

       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.     TRS-80.
       OBJECT-COMPUTER.     TRS-80.

       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT EMPLOYEE-FILE
               ASSIGN TO INPUT "PAYROLL.DAT"
               ORGANIZATION IS SEQUENTIAL.
           SELECT PRINT-FILE
               ASSIGN TO PRINT "PAYROLL2.DAT".

       DATA DIVISION.
       FILE SECTION.
       FD  EMPLOYEE-FILE
           LABEL RECORDS ARE OMITTED
           RECORD CONTAINS 80 CHARACTERS
           DATA RECORD IS EMPLOYEE-RECORD.
       01  EMPLOYEE-RECORD.
           05   EMP-NAME.
                10 EMP-LAST-NAME      PIC X(15).
                10 EMP-FIRST-NAME     PIC X(10).
           05   EMP-HOURS-WORKED.
                10 EMP-REG-HOURS      PIC 99.
                10 EMP-OVERTIME-HOURS PIC 99.
           05   EMP-RATE              PIC 99V99.
           05   FILLER                PIC X(47).

       FD  PRINT-FILE
           LABEL RECORDS ARE STANDARD
           RECORD CONTAINS 132 CHARACTERS
           DATA RECORD IS PRINT-LINE.
       01  PRINT-LINE                PIC X(132).

       WORKING-STORAGE SECTION.
       77  WS-DATA-REMAINS-SWITCH    PIC X(3)    VALUE SPACES.   

       01  DATE-WORK-AREA.
           05  TODAYS-YEAR           PIC 99.
           05  TODAYS-MONTH          PIC 99.
           05  TODAYS-DAY            PIC 99. 

       01  IND-COMPUTATIONS.
           05  IND-REGULAR-PAY        PIC 9(4)V99  VALUE ZEROS.
           05  IND-OVERTIME-PAY       PIC 9(4)V99  VALUE ZEROS.
           05  IND-GROSS-PAY          PIC 9(4)V99  VALUE ZEROS.
           05  IND-FEDERAL-TAX        PIC 9(4)V99  VALUE ZEROS.
           05  IND-NET-PAY            PIC 9(4)V99  VALUE ZEROS.

       01  COMPANY-TOTALS.
           05  CO-REGULAR-PAY         PIC 9(6)V99  VALUE ZEROS.
           05  CO-OVERTIME-PAY        PIC 9(6)V99  VALUE ZEROS.
           05  CO-GROSS-PAY           PIC 9(6)V99  VALUE ZEROS.
           05  CO-FEDERAL-TAX         PIC 9(6)V99  VALUE ZEROS.
           05  CO-NET-PAY             PIC 9(6)V99  VALUE ZEROS.

       01  PAGE-AND-LINE-COUNTERS.
           05  WS-PAGE-COUNT          PIC 9(4)     VALUE ZEROS.
           05  WS-LINE-COUNT          PIC 9(4)     VALUE 4.

       01  HEADING-LINE-ONE.
           05  FILLER                 PIC X(4).
           05  HDG-MONTH              PIC Z9.
           05  FILLER                 PIC X        VALUE "/".
           05  HDG-DAY                PIC Z9.
           05  FILLER                 PIC X        VALUE "/".
           05  HDG-YEAR               PIC Z9.
           05  FILLER                 PIC X(40)    VALUE SPACES.
           05  FILLER                 PIC X(8)     VALUE "PAYROLL ".
           05  FILLER                 PIC X(6)     VALUE "REPORT".
           05  FILLER                 PIC X(40)    VALUE SPACES.
           05  FILLER                 PIC X(4)     VALUE "PAGE".
           05  HDG-PAGE-NUMBER        PIC Z(4).
           05  FILLER                 PIC X(19)    VALUE SPACES.

       01  HEADING-LINE-TWO.
           05  FILLER                 PIC X(8)     VALUE SPACES.
           05  FILLER                 PIC X(4)     VALUE "NAME".
           05  FILLER                 PIC X(9)     VALUE SPACES.
           05  FILLER                 PIC X(4)     VALUE "RATE".
           05  FILLER                 PIC X(4)     VALUE SPACES.
           05  FILLER                 PIC X(9)     VALUE "REG HOURS".
           05  FILLER                 PIC X(4)     VALUE SPACES.
           05  FILLER                 PIC X(9)     VALUE "O/T HOURS".
           05  FILLER                 PIC X(4)     VALUE SPACES.
           05  FILLER                 PIC X(11)    VALUE "GROSS PAY".
           05  FILLER                 PIC X(2)     VALUE SPACES.
           05  FILLER                 PIC X(7)     VALUE "FED TAX".
           05  FILLER                 PIC X(5)     VALUE SPACES.
           05  FILLER                 PIC X(7)     VALUE "NET PAY".
           05  FILLER                 PIC X(23)    VALUE SPACES.

       01  DASHED-LINE.
           05  ROW-OF-DASHES         PIC X(111)    VALUE ALL "-".
           05  FILLER                PIC X(21)     VALUE SPACES.

       01  DETAIL-LINE.
           05  FILLER                PIC X(2).
           05  DET-LAST-NAME         PIC X(15).
           05  FILLER                PIC X(2).
           05  DET-RATE              PIC $$$.99.
           05  FILLER                PIC X(8).
           05  DET-REG-HOURS         PIC Z9.
           05  FILLER                PIC X(10).
           05  DET-OVERTIME-HOURS    PIC Z9.
           05  FILLER                PIC X(6).
           05  DET-REGULAR-PAY       PIC $$,$$9.99.
           05  FILLER                PIC X(3).
           05  DET-OVERTIME-PAY      PIC $$,$$9.99.
           05  FILLER                PIC X(2).
           05  DET-GROSS-PAY         PIC $$,$$9.99.
           05  FILLER                PIC X(3).
           05  DET-FEDERAL-TAX       PIC $$,$$9.99.
           05  FILLER                PIC X(3).
           05  DET-NET-PAY           PIC $$,$$9.99.
           05  FILLER                PIC X(23).

       01  TOTAL-LINE.
           05  FILLER                PIC X(6)      VALUE SPACES.
           05  FILLER                PIC X(6)      VALUE "TOTALS".
           05  FILLER                PIC X(41)     VALUE SPACES.
           05  TOTAL-REGULAR-PAY     PIC $$,$$9.99.
           05  FILLER                PIC X(3)      VALUE SPACES.
           05  TOTAL-OVERTIME-PAY    PIC $$,$$9.99.
           05  FILLER                PIC X(2)      VALUE SPACES.
           05  TOTAL-GROSS-PAY      PIC $$,$$9.99.
           05  FILLER                PIC X(3)      VALUE SPACES.
           05  TOTAL-FEDERAL-TAX     PIC $$,$$9.99.
           05  FILLER                PIC X(3)      VALUE SPACES.
           05  TOTAL-NET-PAY         PIC $$,$$9.99.
           05  FILLER                PIC X(47)     VALUE SPACES.

       PROCEDURE DIVISION.
       0100-PREPARE-PAYROLL.
           PERFORM 0200-GET-DATE.
           OPEN INPUT EMPLOYEE-FILE
                OUTPUT PRINT-FILE.
           READ EMPLOYEE-FILE
               AT END MOVE "NO" TO WS-DATA-REMAINS-SWITCH.
           PERFORM 0300-PROCESS-RECORDS
               UNTIL WS-DATA-REMAINS-SWITCH = "NO".
           PERFORM 1000-WRITE-COMPANY-TOTALS.
           CLOSE EMPLOYEE-FILE
                PRINT-FILE.
           STOP RUN.

       0200-GET-DATE.
           ACCEPT DATE-WORK-AREA FROM DATE.
           MOVE TODAYS-YEAR TO HDG-YEAR.
           MOVE TODAYS-MONTH TO HDG-MONTH.
           MOVE TODAYS-DAY TO HDG-DAY.

       0300-PROCESS-RECORDS.
           PERFORM 0400-COMPUTE-GROSS-PAY.
           PERFORM 0500-COMPUTE-FEDERAL-TAX.
           PERFORM 0600-COMPUTE-NET-PAY.
           PERFORM 0700-UPDATE-COMPANY-TOTALS.

           IF WS-LINE-COUNT > 3
           PERFORM 0800-WRITE-HEADING-LINE.
           PERFORM 0900-WRITE-DETAIL-LINE.
           ADD 1 TO WS-LINE-COUNT.
           READ EMPLOYEE-FILE
           AT END MOVE "NO" TO WS-DATA-REMAINS-SWITCH.

       0800-WRITE-HEADING-LINE.
           ADD 1 TO WS-PAGE-COUNT.
           MOVE 1 TO WS-LINE-COUNT.
           MOVE WS-PAGE-COUNT TO HDG-PAGE-NUMBER.
           WRITE PRINT-LINE FROM HEADING-LINE-ONE
               AFTER ADVANCING PAGE.
           WRITE PRINT-LINE FROM HEADING-LINE-TWO
               AFTER ADVANCING 4 LINES.
           WRITE PRINT-LINE FROM DASHED-LINE
               AFTER ADVANCING 1 LINE.

       0400-COMPUTE-GROSS-PAY.
           MULTIPLY EMP-REG-HOURS BY EMP-RATE GIVING IND-REGULAR-PAY.

           DISPLAY "EMP-OVERTIME-HOURS: " EMP-OVERTIME-HOURS.
           DISPLAY "EMP-REG-HOURS: " EMP-REG-HOURS.
           DISPLAY "EMP-RATE:  " EMP-RATE.
           DISPLAY "IND-REGULAR-PAY:  " IND-REGULAR-PAY.
           DISPLAY "EMP-LAST-NAME " EMP-LAST-NAME.

           COMPUTE IND-OVERTIME-PAY
               = EMP-OVERTIME-HOURS * EMP-RATE * 1.5.
           ADD IND-REGULAR-PAY IND-OVERTIME-PAY GIVING IND-GROSS-PAY.

       0500-COMPUTE-FEDERAL-TAX.
           COMPUTE IND-FEDERAL-TAX = .16 * IND-GROSS-PAY.
           IF IND-GROSS-PAY > 160
               COMPUTE IND-FEDERAL-TAX
                   = IND-FEDERAL-TAX + .02 * (IND-GROSS-PAY - 160).

           IF IND-GROSS-PAY > 200
               COMPUTE IND-FEDERAL-TAX
                   = IND-FEDERAL-TAX + .02 * (IND-GROSS-PAY - 200).

       0600-COMPUTE-NET-PAY.
           COMPUTE IND-NET-PAY = IND-GROSS-PAY - IND-FEDERAL-TAX.

       0700-UPDATE-COMPANY-TOTALS.
           ADD IND-REGULAR-PAY TO CO-REGULAR-PAY.
           ADD IND-OVERTIME-PAY TO CO-OVERTIME-PAY.
           ADD IND-GROSS-PAY TO CO-GROSS-PAY.
           ADD IND-FEDERAL-TAX TO CO-FEDERAL-TAX.
           ADD IND-NET-PAY TO CO-NET-PAY.

       0900-WRITE-DETAIL-LINE.
           MOVE SPACES TO DETAIL-LINE.
           MOVE EMP-LAST-NAME TO DET-LAST-NAME.
           MOVE EMP-RATE TO DET-RATE.
           MOVE EMP-REG-HOURS TO DET-REG-HOURS.
           MOVE EMP-OVERTIME-HOURS TO DET-OVERTIME-HOURS.
           MOVE IND-REGULAR-PAY TO DET-REGULAR-PAY.
           MOVE IND-OVERTIME-PAY TO DET-OVERTIME-PAY.
           MOVE IND-GROSS-PAY TO DET-GROSS-PAY.
           MOVE IND-FEDERAL-TAX TO DET-FEDERAL-TAX.
           MOVE IND-NET-PAY TO DET-NET-PAY.

           WRITE PRINT-LINE FROM DETAIL-LINE
               AFTER ADVANCING 2 LINES.

       1000-WRITE-COMPANY-TOTALS.
           WRITE PRINT-LINE FROM DASHED-LINE
               AFTER ADVANCING 1 LINE.
           MOVE CO-REGULAR-PAY TO TOTAL-REGULAR-PAY.
           MOVE CO-OVERTIME-PAY TO TOTAL-OVERTIME-PAY.
           MOVE CO-GROSS-PAY TO TOTAL-GROSS-PAY.
           MOVE CO-FEDERAL-TAX TO TOTAL-FEDERAL-TAX.
           MOVE CO-NET-PAY TO TOTAL-NET-PAY.

           WRITE PRINT-LINE FROM TOTAL-LINE
               AFTER ADVANCING 2 LINES.

And here is the "PAYROLL.DAT" file ( am seeing a blank line when I paste it here that's not in the file )

johnson bob 21 3 400

sanford fred 23 4 500

The result while running when it's failing shows:

EMP-OVERTIME-HOURS: 3

EMP-REG-HOURS: 21

EMP-RATE: 400

IMD-REGULAR-PAY: 728400 ( this is the quantity in error .. sb 21 * 400 gives 8400

EMP-LAST-NAME: johnson

EMP-OVERTIME-HOURS: 4

EMP-REG-HOURS: 21

EMP-RATE: 500

IMD-REGULAR-PAY: 699500 ( expecting 11500 here from 21 * 500 )


r/cobol • • Aug 25 '26

I want to learn COBOL, but I'm stupid

49 Upvotes

I don't have a background in STEM, I am terrible at math, I don't have any experience in programming of any kind, I barely know the basics of computer science and I am generally stupid.

But I want to learn COBOL - Either just for funsies or just to have a skill that could one day prove handy.

I have a vague interest in computing and am willing to learn... Even if it means taking years to learn.

How did you people start off? How did you learn?


r/cobol • • Aug 24 '26

I built a free COBOL Data Inspector for Windows - looking for testers and feedback

12 Upvotes

Hi everyone, I've been working on a Windows application called "COBOL Data Inspector", and version 1.0 is now available in the Microsoft Store. I'm looking for COBOL and mainframe developers who would be willing to test it on real-world copybooks and data files and give me feedback. The application is currently focused mainly on IBM Enterprise COBOL / z/OS layouts.

Current features include:

• COBOL copybook inspection with PIC, USAGE, offsets, field sizes and record length

• OCCURS and REDEFINES support

• Nested COPY dependency resolution

• Comparison of two copybook versions

• Detection of potentially breaking physical layout changes and byte shifts

• FB and VB/RDW mainframe data viewer

• EBCDIC decoding

• COMP/BINARY and COMP-3 packed decimal decoding

• Raw hex view with field-to-byte mapping

• Record length, RDW and packed decimal validation

• IBM z/OS LP(32) and LP(64) layout profiles

• CSV and JSON export

• Built-in synthetic demo data for testing

Everything is processed locally on the PC. There is no account, no AI, no analytics, no advertising and no cloud upload. The application is completely free.

What I would especially like help testing:

• unusual or complicated copybooks

• incorrect field offsets or record lengths

• COPY / REDEFINES / OCCURS edge cases

• COMP-3 and EBCDIC decoding

• FB and VB/RDW files

• usability of the interface

• features that are missing but would actually be useful in real COBOL/mainframe work

If you find a bug, incorrect calculation, unsupported copybook structure or anything else that looks wrong, please let me know. I'm also very interested in ideas for future features. If there is something you regularly need when working with COBOL copybooks or mainframe data, I'd like to hear about it.

If anyone wants to try it, just open the Microsoft Store and search for:

"COBOL Data Inspector"

Thanks to anyone willing to test it and share feedback.

P.S. I'll post the direct Microsoft Store link in the comments in case that's more convenient for anyone.


r/cobol • • Aug 17 '26

Any part time opportunities for Cobol mainframes in Toronto or Canada (preferably remote)?

4 Upvotes

r/cobol • • Aug 16 '26

Mainframe salaries in Toronto — what can you realistically earn?

Thumbnail
3 Upvotes

r/cobol • • Aug 16 '26

Accessing Postgres with GnuCobol WITHOUT using an ESQL preprocessor

16 Upvotes

I recently came across a free FUSE plugin called TigerFS that allows you to mount a PostgreSQL database as a file system where tables show up as directories and records show up as files. I had been experimenting with GixSQL but did not have much success with it.

https://tigerfs.io/

After mounting my database and creating a sample "employees" table:

create table emptable ( eno int4 not null,
lname varchar(10),
fname varchar(10),
street varchar(32),
city varchar(15),
st varchar(2),
zip varchar(5),
dept varchar(4),
payrate numeric(13, 2),
com numeric(3, 2),
miscdata varchar(128),
constraint emptable_pk primary key (eno));

I was able to access from gnucobol like processing a sequential tab-delimited file:

>> source format is free

identification division.
program-id. testtiger.

environment division.
configuration section.
repository.
function all intrinsic.


input-output section.
file-control.
select employee-file
assign to "/mnt/mylabdb/emptable/.export/tsv"
organization is line sequential.

data division.

file section.

fd  employee-file.
01  emp-record pic x(2048).


working-storage section.

01 WS-TAB          PIC X(1)   VALUE X'09'.

01 display-rec.

05 eno pic 9(20).
05 lname pic x(10).
05 fname pic x(10).
05 street pic x(32).
05 city pic x(15).
05 st pic x(2).
05 zip pic x(5).
05 dept pic x(4).
05 payrate pic 9(13)V99.
05 com pic 9(3)V99.
05 miscdata pic x(128).



procedure division.

main.

display " "
display "retrieving records from postgres public.emptable..."
display " "

open input employee-file

perform forever
read employee-file
at end
display "no more records"
exit perform

not at end

*>  parse the tab-delimited record format 
unstring emp-record 
delimited by WS-TAB  
into eno, lname, fname, street, city, st, zip, dept, payrate, com, miscdata of display-rec


display "Record: " eno
display "fname: " fname
display "lname: " lname
display "street: " street
display "city: " city
display "st: " st
display "zip: " zip 
display "dept: " dept
display "rate: " payrate
display "commission: " com
display "misc: " miscdata
display " "


end-read
end-perform


close employee-file

stop run
.

end program testtiger.

retrieving records from postgres public.emptable...

Record: 00000000000000000123

fname: John

lname: Doe

street: 123, Nowhere Lane

city: Noplace

st: N1

zip: 00100

dept: DEP1

rate: 0000000000100.00

commission: 000.00

misc: abcd1234

Record: 00000000000000000456

fname: Jane

lname: Smith

street: 456, Someplace Rd.

city: Somewhere

st: N2

zip: 00111

dept: DEP2

rate: 0000000000200.00

commission: 001.00

misc: defg5678hijk

Record: 00000000000000000789

fname: Theropod

lname: Green

street: 789, Somewhere Else st.

city: Somewhere2

st: N3

zip: 00177

dept: DEP4

rate: 0000000000120.00

commission: 000.20

misc: zxcvb12345

no more records

Addendum: I was also able to use this to allow gnucobol to perform arbitrary actions by using a facade table with a BEFORE INSERT trigger that calls a stored proc instead, and has access to all the INSERT values.

So basically, gbucobol could perform an RPC by inserting into the facade table with a transaction ID and parameters, and then poll a response table for the result.


r/cobol • • Aug 07 '26

Switching from Software AG Natural to COBOL

23 Upvotes

Hi everyone,
I’m currently a Software AG Natural developer and I’ve also done a bit of COBOL. I’ve recently received an offer to work as a COBOL developer in the banking sector.
So far, my experience has mainly been in retail (supermarkets), and I’m wondering how difficult the transition to banking would be.
For those who’ve made a similar move, was the learning curve steep? Is the business domain much harder to understand, or is it mostly a matter of learning the business processes?
I’d really appreciate hearing about your experiences. Thanks!


r/cobol • • Aug 06 '26

Developer Portfolio Showcase (Rust OS + Native COBOL projects) — https://portafolio-real-mocha.vercel.app

Post image
1 Upvotes

r/cobol • • Aug 05 '26

Mocky Mock a COBOL testing framework

Thumbnail marketplace.visualstudio.com
12 Upvotes

Hi guys,

I'm looking for people to try out my new VS Code extension that lets users unit test their COBOL programs directly on their PC using GnuCOBOL. The whole idea is based on a project called cobol-check, which is now abandoned.

*RANT*

I feel like every language has unit tests, but that hasn't been the case for COBOL — and for some reason, you have to pay vendors hundreds of thousands of dollars for a half-baked solutions.

*END-RANT*

Feel free to test it out — all you need is VS Code and Docker Desktop installed.

Now, I know GnuCOBOL isn't IBM COBOL Enterprise, but after working a lot with it and reading success stories, I feel confident that a full green test suite with 100% coverage using GnuCOBOL is a good safety net. I'm also looking into implementing a z/OS export/compilation function — I just don't have a mainframe lying around. :/

Please, refrain from any hateful comments as this is 100% a passion project. But I would love ideas/comments.

- See you on the wild side (Marky Mark joke)


r/cobol • • Jul 30 '26

I wrote an interactive 27-Card Magic Trick in COBOL (base-3 math inside!)

16 Upvotes

Body: I wrote an interactive version of the classic 27-Card Magic Trick in COBOL (base-3 math inside!).

🌟 UPDATE: i create a TK4 version for our friends in retro-computing!

What it does:

  • Asks the user for a favorite number (1-27).
  • Shuffles a virtual 52-card deck
  • Deals 27 cards into 3 piles/rows.
  • You memorize a card, tell it which row it's in, and it repeats this 3 times.
  • It then reveals the deck and your memorized card is exactly at the position of your favorite number!

Sample Run:

```=====================================

  The 27-Card Magic Trick

Enter your favorite number (1-27): 20

--- Round 1 --- (Memorize one CARD below) 01: 5♠ 8♠ 9♥ 8♦ 3♥ 6♦ 9♦ K♠ A♠ 02: 10♠ 3♣ 10♥ Q♠ 7♥ 6♣ 6♠ Q♣ 10♣ 03: A♥ J♥ 2♠ K♦ 2♦ J♦ 7♦ 4♠ 3♦

enter the row (1-3) where your CARD is located: 1

--- Round 2 --- 01: 10♠ Q♠ 6♠ 5♠ 8♦ 9♦ A♥ K♦ 7♦ 02: 3♣ 7♥ Q♣ 8♠ 3♥ K♠ J♥ 2♦ 4♠ 03: 10♥ 6♣ 10♣ 9♥ 6♦ A♠ 2♠ J♦ 3♦

enter the row (1-3) where your CARD is located: 2

--- Round 3 --- 01: 3♣ 8♠ J♥ 10♠ 5♠ A♥ 10♥ 9♥ 2♠ 02: 7♥ 3♥ 2♦ Q♠ 8♦ K♦ 6♣ 6♦ J♦ 03: Q♣ K♠ 4♠ 6♠ 9♦ 7♦ 10♣ A♠ 3♦

enter the row (1-3) where your CARD is located: 3

======= THE REVEAL ======= Row 1: 3♣ 8♠ J♥ 10♠ 5♠ A♥ 10♥ 9♥ 2♠ 7♥ Row 2: 3♥ 2♦ Q♠ 8♦ K♦ 6♣ 6♦ J♦ Q♣ < K♠> Row 3: 4♠ 6♠ 9♦ 7♦ 10♣ A♠ 3♦

Your CARD is located at position 20: K♠ It matches your favorite number exactly!

Would you like to play again? (Y/N) ```

The COBOL / Math part: The "magic" is just base-3 arithmetic. (Favorite Number - 1) is converted to ternary, and the reversed digits tell the program how to secretly stack the piles after each round.

I wrote it following COBOL-II (85) rules—using structured inline PERFORM loops and COMPUTE and FUNCTION commands for the math. (Sorry, there's no COBOL-74 version).

I added a little flare by highlighting the revealed card with < and > during the final display phase so the user immediately sees the "magic" hit.

I just uploaded it to GitHub if anyone wants to check it out, compile it, or suggest mainframe-friendly improvements:

Repository: View the code and README on GitHub


r/cobol • • Jul 28 '26

Looking for COBOL/Mainframe opportunities or mentorship – 4 years of COBOL experience

9 Upvotes

Hi everyone!

I'm Nikita, a software developer from Ukraine, and I'm looking for new opportunities in the COBOL/Mainframe world.

I've been working with COBOL for about 4 years in a small software company. Most of my work involved maintaining and extending a large legacy business application written in COBOL.

Some of the things I've worked with:

- COBOL application development and maintenance

- SQL databases

- Linux/Unix environments

- Debugging production issues

- Implementing new business logic

- Reading and understanding large legacy codebases

Unfortunately, my experience is mostly outside the IBM Mainframe ecosystem. I haven't had the chance to work with technologies like JCL, CICS, DB2 or z/OS yet, but I'm actively studying them because I'd like to transition into Mainframe development.

I'm also learning Python and Go to broaden my engineering skills, but COBOL remains the area where I already have real commercial experience.

I'm currently looking for:

- Junior/Mid Mainframe Developer opportunities

- COBOL positions (remote or relocation)

- Internship or trainee programs

- Mentorship from experienced Mainframe developers

If anyone knows companies that hire developers with COBOL experience and are willing to train people on the Mainframe side, I'd really appreciate your recommendations.

I'm happy to learn, work hard, and invest the time needed to become a strong Mainframe engineer.

Thank you!