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



Hi Greg,

The RPG data structure and the JSON data need to match.  Right now, they aren't even close (unless you're doing something like parsing only part of it?  You didn't provide the code that shows the data-into statement.)

Your RPG has a DS named 'Orders' that contains subfields 'ID', 'ProfileID', etc.  Your JSON is a DS that contains "@odata.context", and "value".    See what I mean?

-SK


On 6/7/2019 3:19 PM, Greg Wilburn 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

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.