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



Thanks jon, i wil give it a try..i have code, but wasnt working.

D testds ds dim(10) qualified
d FamilyTreeMemberRoleText...
D 50
d DNBCodeValue...
D 50

options = 'path= OrganizationDetail/FamilyTreeMemberRole +
case=any allowextra=yes allowmissing=yes';

xml-into testds %XML(xml:options);


On 3/3/2016 10:26 PM, Jon Paris wrote:
Looks pretty straightforward. Something like this.


dcl-ds OrganizationDetail qualified;
FamilyTreeMemberRole LikeDS(FamilyTreeMemberRole_T) Dim(4); <— See note
StandaloneOrganizationIndicator char(nn);
ControlOwnershipDate char(nn);
ControlOwnershipTypeText LikeDS(ControlOwnershipTypeText_T);
end-ds;

dcl-ds FamilyTreeMemberRole_T qualified;
FamilyTreeMemberRoleText LikeDS FamilyTreeMemberRoleText_T;
end-ds;

dcl-ds FamilyTreeMemberRoleText_T;
DNBCodeValue char(nn);
data char(nn);
end-ds;

dcl-ds ControlOwnershipTypeText_T;
DNBCodeValue char(nn);
data char(nn); <— This is where "Privately owned” goes
end-ds;


XML-INTO will need options datsubf=data if using the names shown in my example.

If there are not always exactly 4 elements of FamilyTreeMemberRole then add count_ FamilyTreeMemberRole with a definition of (say) int(5) to the OrganizationDetail DS and add countprefix=count_ to the options.

Replace nn values with whatever lengths you need.


Note this has NOT been tested but it should be close enough for you to work it out.

P.S. It would have been nice to see you make an effort at coding the DS and _then_ come here for advice on any issues. But then I’ve spent way too much time stuck in traffic jams today so maybe I’m just being crabby.

On Mar 3, 2016, at 9:39 PM, tim <iseriesstuff@xxxxxxxxx> wrote:

Im working on xml files for the first time. I have the following xml snippet and need help with the syntax to read the info into our db.

Any help would be apprecited.

<OrganizationDetail>
<FamilyTreeMemberRole>
<FamilyTreeMemberRoleText DNBCodeValue="12775">Global Ultimate</FamilyTreeMemberRoleText>
</FamilyTreeMemberRole>
<FamilyTreeMemberRole>
<FamilyTreeMemberRoleText DNBCodeValue="12774">Domestic Ultimate</FamilyTreeMemberRoleText>
</FamilyTreeMemberRole>
<FamilyTreeMemberRole>
<FamilyTreeMemberRoleText DNBCodeValue="12773">Parent</FamilyTreeMemberRoleText>
</FamilyTreeMemberRole>
<FamilyTreeMemberRole>
<FamilyTreeMemberRoleText DNBCodeValue="12771">Headquarters</FamilyTreeMemberRoleText>
</FamilyTreeMemberRole>
<StandaloneOrganizationIndicator>false</StandaloneOrganizationIndicator>
<ControlOwnershipDate>1985</ControlOwnershipDate>
<ControlOwnershipTypeText DNBCodeValue="9058">Privately owned</ControlOwnershipTypeText>
</OrganizationDetail>
--
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.
Jon Paris

www.partner400.com
www.SystemiDeveloper.com



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.