Latest COBOL features

A few of my favorite COBOL features are JSON GENERATE and JSON PARSE. If you want more information

JSON support is a nice feature if your COBOL systems need to communicate with RESTFUL services in the cloud (or in your own local environment) or if the COBOL program needs to process (or produce) JSON formatted data.

Historically this is not a feature that was available in most COBOL systems. For such systems it is possible to create a JSON parser using COBOL code so that COBOL programs can utilize JSON structures if necessary. This can help to enhance the capability of some of those old workhorse COBOL programs that some organizations rely upon.

I found the FUNCTION HEX-OF(alphanumeric-item) to be valuable last week. Saved a lot of lines of coding, as well as being easier to read.

There is also a BIT-OF function too, if you want to get the bit-string of the alpha.

This is new with Enterprise COBOL V6.3

Been coding COBOL for 40 plus years I’ve never heard of JSON. What is that?

Hi Richard –

JSON is a simple text-based data exchange format popular with Python and JavaScript programmers, and ported to tons of other languages as well.

though I’d skip the history section, it’s more confusing than enlightening.


I’m a huge fan of our environment (Veryant/isCOBOL) and its ability to create API-accessible programs. We can use certain compiler settings to generate RESTful COBOL endpoints and define the structure of the JSON object for the HTTP requests using syntax on a linkage section of the program. We’ve built an entire RESTful COBOL application with a ReactJS frontend because of this functionality.

Thanks for the new view. How do you invoke APIs in COBOL? Are you using cloud?
Curious to know.

Our runtime environment and version of COBOL, isCOBOL from Veryant, has built-in functionality that allows you to create a “bridge” program based on the linkage section. That bridge uses OOP to connect to HTTP requests sent via (in our case) Tomcat. The bridge then unpacks the expected JSON or XML object and properly loads the data into the corresponding linkage section group item. That data is then passed in to the main program. It’s super easy and has been game changing for us.

Thanks. That helps. :grinning:

Could you please share sample example how to use JSON to communicate to COBOL ?

Please have a look at IBM’s sample:

Noticed that this is a wildly confusing thread. Short answer is Javascript Object Notation. A viewer friendly representation of information very unlike XML. Biggest problem is the Networking components aren’t mentioned. Yes Tomcat, (Geronimo <=> Websphere, JBoss…et al ) and Apache HTTP work on z/OS. However you have to create “holes” (good luck with that ) which punch their way through your firewalls in order to get out over the open internet and talk turkey with the various API services that use REST and SOAP (XML). Use Node on z/OS or z/Linux if you can. Not sure if IBM is still plastering that Go Domino web server on their big Iron machines these days. It was a horrible beast. So it’s not as simple as do this and you’ll be fine.
BTW : most Cisco installations kill certain routing protocols on their networks as a security measure… don’t believe the hype about it’s necessarily straight forward. You may always be blocked from the internet.