I have tried to convert a copybook into JSON Format in Cobol but was unable to do as the Z/OS version 4.1 does not support JSON generator.
Then I tried to run a JCL which a selcopy utility. This worked fine and I was able to get the JSON format. But due to my copybook using redefine clause I am unable to get the required format. Can anyone help me with any idea how Json file format can be achieved ? My file has 3or 4 rows for a particular request and hence redefine clause is very essential and due to this I am facing problem while conversion using Selcopy utility.
Joined: 06 Jun 2008 Posts: 8500 Location: Dubuque, Iowa, USA
The Enterprise COBOL Language Reference manual for version 6.2 states that JSON GENERATE does not support REDEFINES. The CICS Transaction Server 5.2 Configuring manual indicates that the DFHLS2JS utility does not support REDEFINES. So even if you were using a version of COBOL that supported JSON GENERATE, you would not be able to use the REDEFINES.
You need to think of another way to get what you want rather than just focusing on what cannot work. Perhaps a hand-coded REDEFINES would accomplish your goal? If not, you may just have to accept that it is not possible to do what you want and move on to more feasible objectives.