Need help in using HWTJPARS in COBOL for parsing JSON data



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby Robert Sample » Tue Oct 18, 2016 7:06 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post