Hi all,
Could I parse a JSon without document root?
This is my RPGLE:
Many thanks.
Could I parse a JSon without document root?
This is my RPGLE:
Code:
Ctl-Opt DftActGrp(*No) ActGrp('QILE') BndDir( 'AL400MNUV2') DatFmt(*Iso) TimFmt(*Iso) Alwnull(*UsrCtl) DftName(TESTJSON) Text('ETMS - Invio richiesta di Margine') Option(*SrcStmt:*NoDebugIo :*NoUnRef) Debug; dcl-s jsondata varchar(10000) inz('+ { "ClientRequestId" : 12345 , "client": "43535", "requesttype": "O" , "orders": [ + { "instrument": "8L1890", "quantity": 10, "price": 296 , "side": "C" } , + { "instrument": "8L1910", "quantity": 5, "price": 100 , "side":"B" } + ] }'); dcl-ds ClientRequestId Qualified ; ClientRequestId Int(10) ; client Char(5) ; requesttype Char(1) ; count_orders int(5) ; Dcl-ds orders Dim(99) ; instrument varChar(6) ; quantity packed(10 :0) ; price packed(15 :5) ; side Char(1) ; End-Ds orders; End-Ds ClientRequestId; dcl-ds *N psds; count Int(20) Pos(372); end-ds; DATA-INTO ClientRequestId %Data(jsonData: 'case=any doc=string countprefix=count_ allowmissing=yes' ) %Parser('JSONPARSE'); *InLR = *On;
Many thanks.
Comment