How to Parse JSON Messages in COBOL

JSON messages embed a set of data in "objects" and "properties" contained in a single string. This can be a challenge for programs written in languages such as COBOL that store information in specific fields. To work with JSON messages, sophisticated parsing and string manipulation routines are required while maintaining context for the data contained in message nodes. 

Consider the following trivial example for an JSON message:



The string processing logic to parse the above JSON objects and properties into COBOL fields is already advanced, but it will quickly grow in complexity for larger messages as you account for context, optional data and repeating structures.

So what are your options?
  1. You can hand write the code to validate, parse, and create JSON messages.
  2. You can preprocess the JSON with a generic parser.
  3. JSON Thunder, the industry-leading solution for modernizing COBOL legacy applications.

JSON Thunder is designed specifically to address the challenges of working with JSON in COBOL applications.   Using a model-driven development approach and JSON Thunder’s visual designer, the power is in the coder’s hands to create a mapping of COBOL program fields to JSON properties. This mapping – called a Handler Design – is then used to generate all of the COBOL source code needed to parse or create JSON. The code is generated as a callable program module that can be used in new or existing COBOL applications. There are no runtimes required! And, there is no rewriting, which minimizes the time investment and the risk of error.

JSON Thunder’s benefits include:* Faster time to market - modernize applications to parse and generate JSON using COBOL in hours, not days, weeks or even months.

For more information about how you can work smarter to modernize your legacy applications for JSON, please contact us at