I recently wrote a web service that uses data-into with Scott's parser to map a bunch of JSON variables from the request into data structure subfields. It works great, except I don't know how to extract and report specifics when the parsing fails. The scenario I'm mainly trying to cover is numeric overflow. Let's say the request contains a 2-digit number intended for a 1-digit subfield. The only message in the job log is this:
Message . . . . : The document for the DATA-INTO operation does not match the RPG variable; reason code 8.
...
8. The document contains data that cannot be successfully assigned to the RPG variable. The RPG status code associated with the failure is 103.
I'd at least like to be able to report which JSON variable had an invalid value. Does the parser put that information somewhere I can retrieve it?
Message . . . . : The document for the DATA-INTO operation does not match the RPG variable; reason code 8.
...
8. The document contains data that cannot be successfully assigned to the RPG variable. The RPG status code associated with the failure is 103.
I'd at least like to be able to report which JSON variable had an invalid value. Does the parser put that information somewhere I can retrieve it?
Comment