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.