× 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 changed the definitions...
Then I cut the JSON file (and the data structure) way down (basically matching my sample below).

I don't think the parser is getting that far.

Message ID . . . . . . : RNX0356 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 06/07/19 Time sent . . . . . . : 16:39:26

Message . . . . : The document for the DATA-INTO operation does not match
the RPG variable; reason code 4.
Cause . . . . . : While parsing a document for the DATA-INTO operation, the
parser found that the document does not correspond to RPG variable "orders"
and the options do not allow for this. The reason code is 4. The exact
subfield for which the error was detected is "orders(1).id". The options ar
"doc=file case=any allowextra=yes countprefix=count_". The document name is

4. The document is missing information to match subfields.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Friday, June 07, 2019 4:31 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Help Data-Into (YAJLINTO) RPG Variable error

I am no expert but your input data does not have quote marks. Doesn't that
make it numeric? And you have the field defined as char.

On Fri, Jun 7, 2019, 1:19 PM Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:

I would really rather use the YAJLINTO parse to handle this ChannelAdvisor
JSON document. But I can't seem to get to work.

Error is "Data-Into operation does not match RPG variable".

This is an excerpt of the JSON data:

{
"@odata.context": "https://api.channeladvisor.com/v1/$metadata#Orders";,
"value": [
{
"ID": 602044,
"ProfileID": 12019036,
"SiteID": 640,
"SiteName": "Amazon Seller Central - US",
"SiteAccountID": 2787,
"SiteOrderID": "114-7153639-6646652",
... <stuff here>...

},

{

"ID": 602123,

"ProfileID": 12019036,

"SiteID": 640,

"SiteName": "Amazon Seller Central - US",

"SiteAccountID": 2787,

"SiteOrderID": "111-4754461-5234604",
... <stuff here>...

}

],

"@odata.nextLink": "
https://api.channeladvisor.com/v1/Orders?access_token=REMOVED&$expand=Items%2CFulfillments&exported=false&$skip=20
"

}

Here is my latest attempt at getting the data structure right (you can see
some of my other attempts "commented'):

dcl-c OPTIONS const('doc=file case=any allowextra=yes allowmissing=yes
path=value');

// dcl-ds json qualified;
// dcl-ds value qualified;
// count_Orders
dcl-ds Orders qualified dim(20);
ID char(10);
ProfileID char(10);
SiteID char(15);
SiteName char(50);
SiteAccountID char(10);
SiteOrderID char(128);
...<more stuff>...
end-ds orders;

Any help would be appreciated.

Thx
--
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@xxxxxxxxxxxx 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.