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



Given that you are not using the file, and you have not specified a CCSID for the variable XML, the data is likely in the CCSID of your job rather than ucs2. By including ccsid=ucs2, XML-INTO should convert the data from you job CCSID to UCS-2, but that may not be what you want. Try removing ccsid=ucs2 from your options string. And if you remove allowmissing=yes, you should get notified if your xml document is missing elements (or the tag names do not match your data structure). You might get an error that tells you something.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----"Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
Date: 05/26/2016 09:56AM
Subject: RE: XML processing from a field


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 &#8220;unpack&#8221; 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&#8217;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&#8217;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&#8217;ve just tried to indicate the &#8220;shape&#8221;.

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.

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.