I am really surprised that it is slower to do all of it at once rather than in pieces - can't think of a logical reason why that would be. You'd think a single parse would always have to be faster than multiples.

You can still use the count option to avoid allowmissing even if processing it in pieces.

If you have a test XML file you can send me I'd love to see it - might be the next article!

Jon Paris


On Aug 28, 2018, at 1:19 PM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:

I consulted the article but I missed the part about filling the array (the developer's flaw, I scanned the text and read the code). The samples in your article are much simpler than what I've got.

I agree about allowmissing. I'd rather not use it.

Your PS sound like what the production code is doing. It loads Products (and each of the structures at that level) directly. I thought that was a bad idea, but it's 50% faster than my test code loading the top-level structure all at once.

I'll probably just leave the production code as-is. I guess this is why we do benchtests. Thanks again for all you help. :)

-----Original Message-----
From: Jon Paris [mailto:jon.paris@xxxxxxxxxxxxxx]
Sent: Tuesday, August 28, 2018 10:46 AM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML-INTO & path

As the article I referenced would have told you, without count fields items will be considered "missing" if the array is not filled. So, for example, if Products is defined with Dim(99) then f the XML contained less than 99 elements then the others would be "missing". The addition of the count allows RPG to tell you how many there actually are and so they are not considered to be missing.

Using allowmissing=yes is REALY REALY dangerous. Fro example - the file could basically be "empty" and RPG would not signal an error. By using count fields with all arrays and with any optional items you can always be sure that it will error out if the file is bad.

P.S. Your current DS can probably lose the outer DS (gOutputDs) and just start with Products but you may need a path. If you load directly into Products array then the count for this level will be in the PSDS.

If you would like to email me your completed D specs I'll show you how to adjust them.

Jon Paris


This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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: http://amzn.to/2dEadiD

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 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.