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



1) You haven't given us much of the json which makes it difficvult to guess

2) You say the problem arises at uusr but that doesn't appear in the DS at all. Is that the purpose of allowextra?

3) Are the elements at which it errors in the inner structure? If so, since you have no count for the array (i.e. no countprefix is specified) and no allowmissing option so I would expect an error if there were less that 50 elements in the inner array.

Beyond that guess we need to know more.


Jon P.

On May 30, 2023, at 11:13 AM, Sean Courtney <scourtney@xxxxxxxxxxx> wrote:

Hello all,



I am having a strange encounter with YAJL ….



The naming on my DS matches the JSON exactly and parsing seems to work
partially ….



I have 1 header and multiple lines ….



The header is processed and some of the lines but then in the middle it just
stops with an error : The document for the DATA-INTO operation does not
match the RPG variable



I am using QIBM_RPG_DATA_INTO_TRACE_PARSER to view what is being processed
and I can locate where the parser stops …but I have no idea why …



[code]

dcl-s jsonData Varchar(100) Inz('/tmp/test.json');



dcl-ds data dim(50) Qualified;

akt_id char(36);

adr_id char(36);

per_id char(36);

usr_id char(36);

prj_id char(36);

url_id char(36);

.

.

.

dcl-ds mocrm_positionen Dim(50);

pos_id char(36);

akt_id char(36);

art_id char(20);

art_pl char(6);

art_ean1 char(13);

.

.

end-ds data;

end-ds mocrm_positionen;



eval options = 'doc=file case=convert allowextra=yes';



DATA-INTO data %Data(%trim(jsonData):

%trim(options))

%Parser('YAJL/YAJLINTO');



[code]



The parser stops at udt for no apparent reason …



The values when it stops are ..



"uusr": "e6754fd0-251d-425d-9aa5-452519577999",

"udt": "2023-05-26 11:03:16",



Any help would be greatly appreciated…



Mit freundlichen Grüßen / Kind regards / Bien à vous,



Seán



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



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.