× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaaaarrrrgggghhhh

Why is is that when you look at something for a really long time you can
see an error - so you ask for help THEN you spot something

In PGM-B

docnode = yajl_buf_load_tree(%addr(jsonData) : len : errMsg);

Should be

docnode = yajl_buf_load_tree(%addr(jsonData : *data) : len : errMsg);


I think this will solve the problem!!

Don Brown





From: "Don Brown" <DBrown@xxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Date: 29/12/2018 06:17 PM
Subject: YAJLR4 - parse error: premature EOF
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I am confused and I am sure it is something dumb I am doing.

I am putting together some test programs where program A will build a json

string and pass to program B to process the json.

I am getting the error: parse error: premature EOF

Here is the process;

PGM-A
d jsonString_t s 16370a varying
d template
d pJsonString s like(jsonString_t)

d logEvent PR ExtPgm('RMS100R')
d pSiteID 3A
d pdate 8A
d ptime 6A
d pJsonString like(jsonString_t)

yajl_genOpen(*ON) ;
yajl_beginObj();
yajl_addChar('event' :'testEvent');
yajl_addChar('errmsg' :'' );
yajl_endObj();
%len(pjsonString) = JSON_BUF_SIZE;
rc = yajl_copyBuf( CCSID
: %addr(pjsonString : *data)
: JSON_BUF_SIZE
: len );
yajl_saveBuf('/home/rms.txt' : errMsg); // Save to IFS as well
yajl_genClose();
%len(pjsonstring) = len;
logEvent(pSiteId:pDate:pTime:pjsonstring); // calls PGM-B

PGM-B
d jsonData_t s 16370a varying
d template
d JSON_BUF_SIZE c %len(jsonData_t)
len = %len(jsondata);
docnode = yajl_buf_load_tree(%addr(jsonData) : len : errMsg); // This

fails with the parse error
stmf = '/home/rms.txt' ;
docnode = yajl_stmf_load_tree(stmf : errmsg); // This succeeds


Can anyone suggest why the yajl_buf_load_tree fails and the
yajl_stmf_load_tree succeeds ?

Thank you to any responder.

Don Brown


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.