Page 2 of 2

Re: Need help in using HWTJPARS in COBOL for parsing JSON da

PostPosted: Tue Oct 18, 2016 7:06 pm
by Robert Sample
The link you originally posted has this in the HWTJPARS section:
101
HWTJ_PARSERHANDLE_INV
Meaning: Program error. The parserHandle parameter specified on the service call is not a valid parser handle (one that was returned by the HWTJINIT service).

Action: Check for a probable coding error.
So the manual you quoted told you that you need to call HWTJINIT before calling HWTJPARS -- it is not clear if you are not reading the manual you quoted, or if you did not understand what you read.

You should carefully read each HWTJ**** entry in the manual you quoted -- since you're not using REXX you won't need HWTCONST or HWTJESCT, but you may be calling many of the others. At a minimum, the sequence is HWTJINIT, HWTJPARS, HWTJTERM. You may also need HWTJGSJST, HWTJSERI, and the others -- for example, HWTJCREN may be required to create your JSON entry; I have not looked at it to see what conditions it is used for.

But the bottom line is that you need to start coding and testing. When you code and start testing, you'll want to pay very close attention to the return codes for each call to ensure you understand what you are being told by the return code. You may need to develop some code to allow you to pass the JSON data correctly, or you may be able to use whatever process is generating the data to get your test data while testing.