Update, October 2026: going back to this program, I found it was wrong in several ways. Its “historical medians” were one made-up number per gage for the whole year, so the percentages below (the Merced at 206%, Big Creek at 38%) don’t mean what they say; after sorting it compared each river with another river’s median; and its trend could never read falling. Big Creek is near Groveland, not Hetch Hetchy, and isn’t the only gage without a dam above it. Version 3 builds real normals from 30 years of USGS data, in COBOL. The write-up is here.
On April 1, 2026, at 6:35 p.m. EDT, four humans left Earth's orbit for the first time since Apollo 17 in 1972. Artemis II carried Reid Wiseman, Victor Glover, Christina Koch and Jeremy Hansen on a 322-foot rocket, headed for a 10-day slingshot around the Moon.
At roughly the same hour, a COBOL program on my laptop fetched live streamflow data from eight Sierra Nevada rivers, computed percent-of-normal against historical medians, sorted stations by mean discharge, rolled up watershed basin totals, and printed a 132-column formatted report.
Both terminated normally.
A language from 1959 and a moonshot from 2026, on the same evening. I liked that.
Why COBOL
I learned COBOL in college in the late 1980s and hadn't touched it since. I wanted to know if it still worked, if I could still think in it, and if a language built for batch processing on refrigerator-sized mainframes had any business talking to a live government REST API in 2026.
Yes on all counts, it turns out.
COBOL is still running in some wild places. The Federal Reserve processes daily transactions on systems that trace their lineage to the 1970s. Some state unemployment systems still run on IBM mainframes installed before I was born. During COVID, New Jersey posted emergency job listings for COBOL programmers because their unemployment system was overwhelmed and they couldn't find enough people who knew the language. An estimated $3 trillion in daily financial transactions run through COBOL code right now.
Languages don't die so much as stop being taught. COBOL is very good at one thing: reading records, doing math on them and printing formatted reports. A watershed data center does the same.
What It Does
The project is called sierra-flow-cobol. Every morning at 7:00 AM Pacific, GitHub Actions wakes up and runs a three-step pipeline: a Python fetcher pulls 30 days of discharge data from eight USGS gages across the Sierra Nevada, a COBOL program processes that data into a 132-column formatted report, and both the CSV and the report get committed back to the repo. A plain HTML dashboard reads the CSV client-side and draws everything live: sparklines, percent-of-normal badges, the basin roll-up and trend arrows. There's no framework, build step or API. One CSV file feeds both the report and the page.
The Eight Gages
Three watersheds and eight sensors. A storm moves through them in order, hitting the headwaters first, then the canyon reaches, then the valley floor, and you can watch the pulse travel downstream over days.
The most interesting station is the one with the lowest flow: Big Creek near Hetch Hetchy, 3 CFS. Every other gage in the network sits downstream of a major reservoir, which smooths out the natural flood pulse. Big Creek has no dam and no regulation above it, so it answers directly to whatever the Sierra is doing. When it spikes, a storm just hit. When it drops below normal, the snowpack is struggling, and the COBOL flags it. It's the canary in the watershed.
As of April 1, the Merced is running at 206% of normal. The Stanislaus is at 40%. Big Creek is at 38%. The Sierra is uneven this spring, wet in the south and dry in the north, and you can read that in eight numbers.
Not Hello World
The program runs to about 850 lines and uses features that would be at home in a production government data center:
- Dual input files:
streamflow.csvandbaselines.csv, read at the same time with separate FILE-CONTROL assignments - Native SORT verb. Stations are ranked by mean discharge with COBOL's built-in sort, no workaround.
- Baseline cache pattern: historical medians load before station data registers and get applied after processing, so file order doesn't matter
- Percent-of-normal, as
COMPUTE ST-PCT-NORMAL = (ST-MEAN / ST-MEDIAN) * 100 - Day-over-day trend accumulation over 30 readings of delta β β² RISING / βΌ FALLING / β STABLE
- Watershed basin roll-up. EVALUATE assigns each gage to Tuolumne / Merced / Stanislaus and accumulates basin totals.
- A four-section, 132-column report in the classic mainframe style
Debugging taught me plenty. COBOL is fixed-format: column positions matter, a trailing character in column 73 is a fatal error, and the compiler tells you exactly which line broke and why. After three decades away, the muscle memory came back faster than I expected. The language is wordy on purpose and reads almost like English. That was Grace Hopper's idea, to make code readable enough that a business analyst could follow it, not only a programmer.
Zero Dependencies, End to End
The Python fetcher uses nothing but the standard library. The COBOL program has no external libraries. The dashboard is plain HTML, CSS and vanilla JavaScript, with no npm, no pip installs and no cloud bills. The whole stack runs on free infrastructure.
The USGS Water Services API is free, requires no key, and has 135 years of public hydrological data behind it. The GitHub Actions free tier handles the daily CI run in about four minutes. The dashboard is a static file served from GitHub Pages. Total monthly cost: $0.00.
The Artemis Detail
I didn't plan the timing. I was deep in a debugging session when someone mentioned the launch. By the time I had the COBOL running cleanly against live USGS data, the crew was already outbound.
It felt fitting. The Apollo program ran on FORTRAN and assembly, on computers with less processing power than a modern wristwatch. COBOL was designed for that era's engineering culture, which was precise, documented and obsessive about getting things right. Grace Hopper and Margaret Hamilton were contemporaries; the language and the Moon program grew up together.
Sixty-seven years later, a COBOL program is fetching live telemetry from rivers in the Sierra Nevada, running in a cloud CI/CD pipeline and feeding a web dashboard, on the same day four humans left low Earth orbit for the first time since 1972.
SIERRA-FLOW V2.0: NORMAL TERMINATION. RETURN CODE: 0.
The live dashboard is here, and the source is on GitHub. It updates every morning at 7AM Pacific. Right now the Merced is running high and Big Creek is low.
Go deeper
Grace Hopper, The ‘Queen Of Code,’ Would Have Hated That Title — All Things Considered (NPR), 7 March 2015, about 3 min. Gillian Jacobs on her short film about Hopper, the Mark I and COBOL — and how funny Hopper was.
Decades-old unemployment systems can’t handle record demand — PBS NewsHour Weekend, 19 April 2020, about 5 min video. Christopher Booker on the spring the COBOL Cowboys got called back to work.
Sammet, J.E. (2000). The real creators of Cobol. IEEE Software 17(2), 30–32. A CODASYL committee member gently sets the record straight on who actually designed the language.
Grace Hopper and the Invention of the Information Age — Kurt W. Beyer, MIT Press, 2009; a warm, careful biography of the woman behind the idea of readable code.
Built to Last — Mar Hicks, Logic Issue 11, August 2020; why the 2020 unemployment meltdown wasn’t really COBOL’s fault.
Federal Agencies Need to Address Aging Legacy Systems — GAO-16-468, May 2016; the federal inventory of COBOL still holding up Social Security and the VA.
Stewart, I.T., Cayan, D.R. & Dettinger, M.D. (2005). Changes toward earlier streamflow timing across western North America. Journal of Climate 18(8), 1136–1155.
User Guide to EGRET and dataRetrieval — Hirsch & De Cicco, USGS Techniques and Methods 4-A10, 2015; the free guide to pulling and charting the same gage records.
USGS Water Services — the keyless REST API the fetcher called that April morning, retiring in early 2027. · USGS Water Data for the Nation — 135 years of gage records and their new home.
GnuCOBOL — the free compiler that still speaks 1959. · GitHub Actions — the free nightly batch window. · Artemis II launch — NASA’s photo of the other thing that ran cleanly that evening.
SIERRA-FLOW — the live dashboard. · bdgroves/sierra-flow-cobol — the code.
