On 2018-04-23 3:47 PM, Slanina, John wrote:
what happens if it like this
{
"AccountNumber":"31695801",
"Name":"JOHN"
Plus 20 other fields
}
The JSONPARSE program doesn't support JSON like that.
You could copy your JSONPARSE source to another source member, say
JSONPARSE2, and edit it so that it always reports the start of a data
structure for a '{' character and it always reports the end of a data
structure for a '}' character. Then, when you have a JSON document like
that, specify program JSONPARSE2 instead of JSONPARSE in %PARSER.
The places to change are:
1. Remove the IF and ENDIF (and the comment) here:
if parseCtrl.ctrlStk.top > 1;
// If top = 1, this is the initial curly brace to begin
// the JSON document. It does not match an RPG data structure
// So we only report the start of a structure if top > 1
QrnDiStartStruct(parseCtrl.handle);
endif;
2. Remove the IF and ENDIF (and the comment) here:
if parseCtrl.ctrlStk.top > 1;
// If top = 1, it matches the initial curly brace to begin
// the JSON document. It did not match an RPG data structure.
// So we only report the end of a structure if top > 1
QrnDiEndStruct(parseCtrl.handle);
endif;
As an Amazon Associate we earn from qualifying purchases.