Previous Topic Next topic Print topic


Appendix A - JSON GENERATE Source Items

The following data declaration is specified as the source intended to be converted to JSON format.

01 JSON-SRC-GRP.
  03 SRC-STAT PIC X(4). 
  03 SRC-AREA PIC X(100).  
  03 VAL-AREA REDEFINES SRC-AREA.  
     05 FLAGS PIC X.
     05 PIC X(3).
     05 COUNTER USAGE COMP-5 PIC S9(9). 
     05 ASFNPTR REDEFINES COUNTER USAGE FUNCTION-POINTER.
     05 UNREFERENCED PIC X(92).
  03 INVAL-AREA1 REDEFINES SRC-AREA.
     05 FLAGS PIC X. 
     05 PIC X(3).
     05 PTR USAGE POINTER.
     05 ASNUM REDEFINES PTR USAGE COMP-5 PIC S9(9).
     05 PIC X(92).
  03 INVAL-AREA2 REDEFINES SRC-AREA.
     05 FN-CODE PIC X.
     05 UNREFERENCED PIC X(3).
     05 QTYONHAND USAGE BINARY PIC 9(5).
     05 DESC USAGE NATIONAL PIC N(40).
     05 UNREFERENCED PIC X(12).

In line with the syntax rules, the following data items, when specified as identifier-2, would be converted in a JSON GENERATE statement:

  • JSON-SRC-GRP, of which subordinate data items SRC-STAT and SRC-AREA would be converted to JSON format. VAL-AREA, INVAL-AREA1, and INVAL-AREA2 are ignored because they specify the REDEFINES clause.
  • VAL-AREA, of which subordinate data items FLAGS, COUNTER, and UNREFERENCED would be converted. The item whose data description entry specifies 05 PIC X(3) is ignored because it is an elementary FILLER data item. ASFNPTR is ignored because it specifies the REDEFINES clause.
  • Any of the elementary data items that are subordinate to JSON-SRC-GRP, except:
    • ASFNPTR or PTR (disallowed usage)
    • UNREFERENCED OF INVAL-AREA2 (non-unique names for data items that are otherwise eligible)
    • Any FILLER data items
The following data items cannot be specified as identifier-2:
  • INVAL-AREA1, because subordinate data item PTR specifies USAGE POINTER but does not specify the REDEFINES clause. (PTR would be ignored if it is defined with the REDEFINES clause.)
  • INVAL-AREA2, because subordinate elementary data items have the non-unique name UNREFERENCED.
Previous Topic Next topic Print topic