|
First thing to try would be to put an INZ on your data structure
definition. That will initialize the numeric to zero. What options are
you using? I use the following, and I don't ever expect a numeric. I
convert the character to numeric in a later operation when required,
although that doesn't mean what you're trying isn't possible:
+ 'allowmissing=yes '
+ 'allowextra=yes '
+ 'case=any');
From: "Hockchai Lim" <lim.hock-chai@xxxxxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx,
Date: 03/05/2013 03:54 PM
Subject: XML-INTO - %XML option to treat null element as 0
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
Is there a %XML option that I can use to make XML-INTO treats null element
that maps to a numeric field as 0?
For example:
The XML has:
<ESI_DATA_ENTRY>
<Data_Type/>
<Data_LEN/>
<DATA/>
</ESI_DATA_ENTRY>
My DS has:
D ESI_DATA_ENTRY
D ds
D data_type 24
D data_len 2S 0
D data 128
The XML-INTO error out when it encountered <Data_LEN/>. I think it is
because it is expecting a numeric value but it contains nothing.
--
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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.