Reading JSON Problem(s)
Posted: Wed Aug 04, 2021 1:56 pm
I am completely new to YAJL. I am needing some help on reading a JSON document. I have written out to the IFS with no issues but reading is giving me problems. Here is the simple .json I am attempting to read:
===============
===============
Here are my RPG data structures which I think may be part of the problem:
===============
===============
I can get the "batchClaimResponse" array started ok using this:
response = yajl_object_find(docNode: 'batchClaimResponse');
and then looping using dow yajl_array_loop( response: i: node);
I get the "businessPartnerCode" ok but it is the section after that ("claimInfo") where I run into trouble. I do not know how to grab all those elements: "claimNumber", "trackingNumber", repairingOutlet", etc. I thought maybe the yajl_object_loop() but was not sure how to define the parameters to that procedure.
Any help would be appreciated and I can provide any more information you need.
Sorry about the code. I do not have RDI....
Thanks in advance!
===============
Code: Select all
{
"status": "Success",
"message": "Record Retrieved Successfully",
"interfaceName": "I-207 - Batch Claim Submittal Response",
"batchClaimResponse": [
{
"businessPartnerCode": "0322400000",
"claimInfo": {
"claimNumber": "M4895710",
"trackingNumber": "M023434499",
"repairingOutlet": "0322400006",
"repairOrder#": "227533",
"serialNumber": "6610509335",
"submittalIndicator": "I",
"dateTimeProcessed": "2020-02-05T12:00:00.000",
"claimStatusCode": "30",
"claimStatusDescription": "Pending Approval",
"dispositionCode": "",
"dispositionCodeDescription": "",
"rmaStatusCode": "",
"rmaStatusDescription": "",
"approvedDollarAmount": "",
"identifier": "12345",
"claimProcessMsgInfo": [
{
"lineNumber": "1",
"processCode": "1371",
"processCategoryDescription": "CLAIM",
"processMessage": "AT: Travel requires manual review."
},
{
"lineNumber": "2",
"processCode": "1403",
"processCategoryDescription": "NET ITEMS",
"processMessage": "AT: Net Item exceeds auto-approval limit in table"
}
]
}
}
]
}
Here are my RPG data structures which I think may be part of the problem:
===============
Code: Select all
d response_t ds qualified
d template
d partnrcode 10a
d claiminfo likeds(claiminfo_t)
d process likeds(process_t) dim(999)
d claiminfo_t ds qualified
d template
d claim# 20a
d track# 10a
d outlet 10a
d ro 6a
d serial# 20a
d sind 1a
d datetime 23a
d stscode 4a
d stsdesc 20a
d dispcode 10a
d dispdesc 20a
d rmacode 3a
d rmadesc 80a
d appvdolr 20a
d identifier 20a
d process_t ds qualified
d template
d lineno 5a
d prccode 4a
d catgdesc 20a
d prcmesg 80a
d result ds qualified
d success 1n
d errmsg 500a
d response likeds(response_t) dim(150)
I can get the "batchClaimResponse" array started ok using this:
response = yajl_object_find(docNode: 'batchClaimResponse');
and then looping using dow yajl_array_loop( response: i: node);
I get the "businessPartnerCode" ok but it is the section after that ("claimInfo") where I run into trouble. I do not know how to grab all those elements: "claimNumber", "trackingNumber", repairingOutlet", etc. I thought maybe the yajl_object_loop() but was not sure how to define the parameters to that procedure.
Any help would be appreciated and I can provide any more information you need.
Sorry about the code. I do not have RDI....
Thanks in advance!