I'm told that you eventually make your way to the "GCC IR", but it seems like you are largely on your own with how to get there.
I did not invest a lot of time here, so I could be wildly off base, but thought I'd at least try to give a very-slightly-hands-on perspective.
https://www.gnu.org/software/gnucobol/
$ rpm -q gnucobol
gnucobol-3.2-1.el9.x86_64
$ rpm -qi gnucobol | tail -2
COBOL compiler, which translates COBOL
programs to C code and compiles them using GCC.
It will output intermediate C; one interesting thing is that the MOVE directive is mostly turned into memcpy().I have been able to get the Oracle Pro*COBOL preprocessor to fully compile and run a demo database connection that connects to the "scott/tiger" schema and runs simple queries. Oracle packages both Pro*C and Pro*COBOL here (look for " Additional files for Pro*C and Pro*COBOL"):
https://www.oracle.com/database/technologies/instant-client....
It built with the two commands:
procob MODE=ANSI INAME=procobdemo.pco ONAME=procobdemo.cob
cobc -x -fixed procobdemo.cob /instantclient_21_12/cobsqlintf.o /instantclient_21_12/libclntsh.so
There is a similar "embedded SQL" implementation for PostgreSQL.https://github.com/opensourcecobol/Open-COBOL-ESQL
There are a few other free COBOL compilers.
http://mainframeking.blogspot.com/2012/01/free-cobol-compile...