Convert JSON Data to COBOL classes

Note: The following applies to JVM COBOL only.

Paste JSON As Classes

Visual COBOL enables you to automatically convert JSON data and generate COBOL classes when you paste the data into a COBOL file in a JVM COBOL project.

  1. In Eclipse, open a COBOL file from a JVM COBOL project.
  2. Copy the JSON data from your JSON source file.
  3. Position the cursor where you want to insert the generated data.
  4. Click Edit > Paste JSON As Classes.

    This converts the JSON data to COBOL classes and adds it to the file in your project.

Paste JSON To New File

In Eclipse, you can view the copied JSON data and edit it in the Paste JSON To New Files window.

  1. Open a file from a JVM COBOL project that contains data converted from JSON.
  2. Click Edit > Paste JSON To New File.

    This opens the Paste JSON to New Files wizard and displays the copied JSON code that has been converted into COBOL classes.

  3. Edit the JSON code. If the changes you have made are not valid, you will receive a prompt to change the code. If the changes to the JSON are valid, click Preview.
  4. The list of files and their content is displayed. Uncheck any files you do not want to be affected by your changes, then click OK.