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



Jon, Thanks for the example program.

I have modified it so that I can use my data, and am getting a report.
There is nothing obvious in there pointing to a problem.
I do get some **No Data ** but that seems to be only on *XML_END_ATTR and on the *XML_START_DOCUMENT/*XML_END_DOCUMENT.

Everything else looks like it is populated correctly.

Mike

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, May 26, 2016 11:01 AM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML processing from a field

Start by taking off the “allowmissing=yes” - it was needed in V5R4 but is dangerous and not needed on V6 and later because there are better options. That will almost certainly cause an error but the message may give you a hint as to what it thinks is wrong.

Perhaps the XML you are parsing does not begin with <GPCODEDVALUEDOMAIN2>? - if so you will need to use a path option to force the parser to start at the spot you want.

On this web page http://www.partner400.com/Examples/XMLSAXTST.HTM you’ll find a SAX utility program that will print exactly what is in the XML stream - just change it for your file name.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On May 26, 2016, at 9:56 AM, Smith, Mike <Mike_Smith@xxxxxxxxxxxxxxxx> wrote:

Currently, I'm not getting an error message, but I'm also not getting any data populated either.
I will have to look at XML-SAX to see how to use it. This is my first foray into XML.

The XML is contained within a field in an ESRI table on SQL Server. What I'm currently doing is reading a record from Sql Server and then trying to process the xml.
I currently have the program only processing the xml-into on a particular record, because there sql fields don't always contain xml that starts with GPCODEDVALUEDOMAIN2, so I just want to see if I can get this one record to process.


D*ESRIDS ds
D XML s 32767A varying

D GPCODEDVALUEDOMAIN2...
D ds dim(10) qualified
D domainname 50A
D fieldtype 50A
D mergepolicy 50A
D splitpolicy 50A
D description 50A
D owner 10A
D codedvalues LikeDS(val_T)

D val_T ds Template qualified
d codedvalue LikeDS(cod_T) Dim(5)

D cod_T ds Template
D name 50A
D code 50A

options = 'case=any allowmissing=yes CCSID=ucs2';

XML-INTO GPCODEDVALUEDOMAIN2 %XML( xml: options);

When I look at the field xml in debug it looks good.

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon
Paris
Sent: Thursday, May 26, 2016 9:22 AM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML processing from a field

What is the current error message Mike? If you look at detailed messages does it give you the location in the file for the error? If not and the file looks good to you you might try just a simple XML-SAX to see exactly where in the XML stream it is getting upset. It appears that XML-INTO goes though the entire file before actually staring to “unpack” it. XML-SAX on the other had will just feed you each element in turn and will signal an XML error at the point where it occurs.

When you look at the file via WRKLNK is the data correct? What is the file’s CCSID and how was it created?

If you open the file from (say) RDi does everything look good?


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On May 26, 2016, at 8:32 AM, Smith, Mike <Mike_Smith@xxxxxxxxxxxxxxxx> wrote:

Thanks Jon,
I did work that out and hoped it was correct. It looks like it’s a pretty close match to what you have.

If I can figure out the CCSID Issue

I've tried best, job and ucs2 on the ccsid option with no luck.

When I debug I do see the '<' as the first character.

Any suggestions?

Mike

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jon Paris
Sent: Wednesday, May 25, 2016 10:28 PM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML processing from a field

Looking at your XML extract - your DSs should look something like this - Note I have not pencilled in any lengths as I have no clue how big the fields you have should be. I’ve just tried to indicate the “shape”.

dcl-ds GPCodedValueDomain2;
DomainName;
FieldType;
MergePolicy;
SplitPolicy;
Description;
DBO;
CodedValues LikeDS(CodedValues_T);
end-ds;

dcl-ds CodedValues_T Template;
CodedValue LikeDS(CodedValue_T) Dim(nn); end-ds;

dcl-ds CodedValue_T Template;
Name;
Code;
end-ds;
Jon Paris

www.partner400.com
www.SystemiDeveloper.com

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
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.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
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.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

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.