× 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.



I'm confused.

You know who called it - you did via DATA-INTO.

Looking at the code for YAJLINTO it appears to issue the message in question when the parse has been completed but there is still data in the buffer - at least that is what a cursory look at the code seems to indicate.

I asked before if you have validated the file - you haven't answered that question.

As to logs you just need to set the QIBM_RPG_DATA_INTO_TRACE environment variable to the value *STDOUT and you'll see a trace of the whole parse process. The YAJLINTO contribution to that data includes the position in the file where the error occurred.

This program creates the error you describe.

dcl-ds results;
item1 char(20);
item2 char(20);
end-ds;

data-into results
%Data( '{ "item1": "ABC", "item2": "XYZ" } extra stuff' : 'case=any')
%Parser( 'YAJL/YAJLINTO');


The parse completes correctly but the warning is logged - as expected.

Jon Paris

On Jun 23, 2021, at 1:21 PM, Javier Sanchez <javiersanchezbarquero@xxxxxxxxx> wrote:

Jon, Charles:

Well the thing is that I expected YAJLINTO to let me know who called it. I
will have to put up my own logs. I'm actually using another dev's work so
he's not using the (E) extender.

The issue here is that if that error is true then at the point where it's
happening, the rest of the call stack should be broken too but that is not
the case. So that's why I thought maybe it could parse successfully the
json but found more invalid data just after the last valid construct, and
is reporting it with no further harm. Then it becomes a warning. Maybe
Scott could give me his comments on the above.

Thanks folks!

message: 1
date: Tue, 22 Jun 2021 15:45:26 -0600
from: Javier Sanchez <javiersanchezbarquero@xxxxxxxxx>
subject: YAJL 1002 parse error: trailing garbage

Good day or evening:

I have been using DATA-INTO or DATA-GEN for some JSON messages. I am
getting in the submitted job's log the above message.

Is that 1002 really an error? Or is it a warning? I'm in a hurry on a
production box and have not much time to get what it is, as the flow of
calls to other programs show no other errors. And where is it generated:
on a DATA-INTO or a DATA-GEN or both?

Thanks in advance.


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.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.