Hello VC Forum,
in my current project we have to generate JSON from from a COBOL structure which looks like
01 jsonStructure. 05 array1Count pic 9. 05 array2Count pic 9. 05 array1 occurs 1 to 5 depending on array1Count. 05 array2 occurs 1 to 5 depending on array2count. 10 subarrayCount pic 9. 10 subarray occurs 1 to 5 depending on subarrayCount.Unfortunately VC compiler produce on the part "subarray" an error:
- without ODOSLIDE directive: COBCH0144S OCCURS DEPENDING subsidiary to OCCURS only allowed with ODOSLIDE
 - with ODOSLIDE directive: COBCH0245S DEPENDING ON item subarrayCount missing or illegal.
 
It is maybe possible, to use fix occurs structures, but then we get problems with the called service because of empty elements generated by JSON GENERATE.
Does someone have the same problem? Is there any possibility to use dynamic occurs structures with JSON GENERATE or to avoid the generation of empty elements by fix occurs?
Thanks
Andreas
#JSONGENERATE
#OCCURS