× 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 wondered about that but didn't have time to play.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Mar 14, 2019, at 5:05 PM, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2019-03-14 1:02 PM, Stephen Coyle wrote:
I agree...I think the XML is missing <Order> and </Order> tags as well.
I just wanted to be sure there was no way to define the DS to handle this
type of structure before I go back to the supplier of the XML and tell them
they need to add tags to group each order.

As long as there are <Order>, <Brand>, and <Division> tags for every order, I think you just need to define those RPG subfields as arrays too. For each order, you'll just refer to the same element of each of the arrays.

And you'll need a count for all the arrays in the RPG data structure.
Then it looks like you can get rid of both allowextra and allowmissing.

Dcl-DS OrderInformation;
countOrder int(10);
OrderID varchar(50) dim(100);
countBrand int(10);
Brand varchar(50) dim(100);
countDivision int(10);
Division varchar(50) dim(100);
countInvoiceOrderIte int(10);
Dcl-DS InvoiceOrderItems dim(100);
countItem int(10);
Dcl-DS Item Dim(10);
ItemShipDate varchar(50) ;
Carrier varchar(50) ;
End-DS ;
End-DS ;
End-DS ;

Me, when I'm developing a new XML-INTO, I always start without allowextra or allowmissing. In my sample XML, I start with only what I'm interested in. That makes it a bit easier to see what's going wrong. Then, when I have it working, I add back allowextra, and very occasionally allowmissing, if I need them, and then I add some XML test files to test the "allows".

--
Barbara

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