Error on yajl_copyBufStr

Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
Post Reply
imaxeman69
Posts: 23
Joined: Thu Mar 17, 2022 2:29 pm

Error on yajl_copyBufStr

Post by imaxeman69 »

I'm getting the following error after executing this code:
output = yajl_copyBufStr();
Automatic storage overflow.
Function check. MCH4429 unmonitored by OWSSRVPGM at statement 0000000638,
instruction X'0000'.

The output is defined as varchar(2000000);

I am getting valid JSON because I'm doing a YAJL_saveBuf and the IFS file is valid.
Scott Klement
Site Admin
Posts: 635
Joined: Sun Jul 04, 2021 5:12 am

Re: Error on yajl_copyBufStr

Post by Scott Klement »

RPG has a limit of 16 mb total of automatic storage.

I want to emphasize, that's a TOTAL for all variables in automatic storage. So every variable in automatic storage must add up to < 16 MB of storage, or you will get an overflow.

You could potentially move some of the storage into heap storage or use teraspace.
imaxeman69
Posts: 23
Joined: Thu Mar 17, 2022 2:29 pm

Re: Error on yajl_copyBufStr

Post by imaxeman69 »

So I just decided to do a yajl_saveBuf. The system will be single threaded so there is no chance on other processes stomping on this. If I need to, I can always use a temp file.

Does yajl_saveBuf hold a lock on the IFS file? Here is the layout:
Program A calls a sub-procedure in a service program to build the JSON. That sub-procedure does the yajl_saveBuf();
Flow returns to program A, which is trying to do this:
http_req('POST':
url:
'/mwalter/result.json':
*omit:
'/mwalter/buffer.json':
*omit:
'application/json');

My partner is telling me that there is no Body. No JSON. Which is causing an error. I've tried http_stmf() as well. No joy there either. Could there be some sort of lock on the /mwalter/buffer.json file? I can look at the file and see the JSON.

We're working on trying to get Fiddler to intercept the request, but that's another bridge to jump off of.

THank you.
Scott Klement
Site Admin
Posts: 635
Joined: Sun Jul 04, 2021 5:12 am

Re: Error on yajl_copyBufStr

Post by Scott Klement »

imaxeman69 wrote: Thu May 05, 2022 5:23 pm Does yajl_saveBuf hold a lock on the IFS file?
No, there's no lock placed on it. It has a reference to it while yajl_saveBuf is active, but releases the reference at the end. But, I don't think that's what you mean by "lock" -- I suspect you're thinking of it like a PF rather than a STMF. That type of lock doesn't really exist on a STMF.
imaxeman69 wrote: Thu May 05, 2022 5:23 pm Here is the layout:
Program A calls a sub-procedure in a service program to build the JSON. That sub-procedure does the yajl_saveBuf();
Flow returns to program A, which is trying to do this:
http_req('POST':
url:
'/mwalter/result.json':
*omit:
'/mwalter/buffer.json':
*omit:
'application/json');
You are ignoring any errors, here. Not sure if that's intentional or not?
imaxeman69 wrote: Thu May 05, 2022 5:23 pm My partner is telling me that there is no Body. No JSON. Which is causing an error. I've tried http_stmf() as well. No joy there either. Could there be some sort of lock on the /mwalter/buffer.json file? I can look at the file and see the JSON.
A lock doesn't make sense, here. Create a debug/trace file to see what's happening during the HTTP communications.

Code: Select all

http_debug(*on: '/tmp/imaxeman69-trace.txt');
Look at the data, see if it's sending the buffer.json file contents. See what it's sending you back.
imaxeman69
Posts: 23
Joined: Thu Mar 17, 2022 2:29 pm

Re: Error on yajl_copyBufStr

Post by imaxeman69 »

Thanks Scott.
Post Reply