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



Sean

this workaround should work:

string = u'4040404040404040404040404040';
string = %xlate(u'4040':u'0020':string:1);
if string = %ucs2(' ');

I still use %ucs2 because I compile to V5R2 ;-)

On Tue, Feb 14, 2012 at 4:41 PM, <J.Beckeringh@xxxxxxxxxxxxxxxxxxxxxxxxxx>wrote:

Sean,

Just created a similar program on 7.1 (took an existing program and
changed subfields to UCS-2). Result: prior to XML-INTO all fields are
(just as in your program) initialized to x'0020'; after XML-INTO missing
fields still contain x'0020'. Seems like a bug that has been solved in
7.1; maybe you need a PTF.

Joep Beckeringh


rpg400-l-bounces@xxxxxxxxxxxx wrote on 14-02-2012 12:24:28:

McGovern, Sean

IBM i 6.1.
I have a XML document on the IFS. CCSID is 1208.
A cut-down version of the file may be...

<?xml version="1.0" encoding="UTF-8"?> <PURCHASEORDER> <HEADER>
<HEADERNOTES> </HEADERNOTES> </HEADER> </PURCHASEORDER>

...this structure is defined as follows...

<PURCHASEORDER> <HEADER> <HEADERNOTES> <POHDRNOTE></POHDRNOTE> </
HEADERNOTES> </HEADER> </PURCHASEORDER>

In the RPGLE, this is defined as follows: -
D PO DS Qualified Inz
D Dim( POIdxMax )
D Header...
D LikeDS( Header_t )
D Header_t...
D DS Qualified
D Based( Template )
D HeaderNotes...
D LikeDS( HeaderNotes_t )
D HeaderNotes_t...
D DS Qualified
D Based( Template )
D POHdrNote...
D 50c Inz
D Dim( POHdrNteIdxMax )
read as follows...

options = 'doc=file + path=Update/member/PurchaseOrder
+ case=any + allowextra=yes
+ allowmissing=yes';
xml-into PO %xml( xmlfile : options );

When the POHdrNote data is not present in the XML, I expect the PO
(x).Header.HeaderNotes.POHdrNote(x) data field to contain blanks.
However, when I look at the hex values of the field in debug, the
hex value is all 40s (I would expect hex values of all 20s for unicode
?).
When I test in the program whether the data is *Blank, the test
gives me the wrong result.
Why am I getting hex value of 40s rather than 20s when the data tags
are missing from the XML ?
Thanks.

--
This is the RPG programming on the IBM i / System i (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 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.