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



Not sure why you are using a handler. You have 16Mb of space to play with ... is the file really that big? Using %Handler when you don't need to just adds to the complexity.

Doing the Dim on the proto is fine - but you would normally have the keyword Template added to the definition of the aps DS so as not to waste space.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 25, 2018, at 3:49 PM, Soucy, Michael <MSoucy@xxxxxxxxxxx> wrote:

Thank you for your reply. I made an error when coping my code. I left out the fact that the prototype for the handler contained the DIM statement. Do I need the DIM in both places?

My handler prototype:

dcl-pr apsHandler int(10);
ok ind;
apsdata likeds(aps) dim(10) const;
numRecs uns(10) value;
end-pr ;

I changed the path and the name of the first field in my data structure to "UniqueID", and bingo it worked.

Many thanks. This is going to be a major time saver when I finish my program.

Mike

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Wednesday, July 25, 2018 4:40 PM
To: Rpg400 Rpg400-L
Subject: Re: XML-INTO help

Well this Detail_UniqueID should just be UniqueID and the DS name should be Detail not eps for preference.

Detail is the name of the element UniqueID is the first attribute of Detail - <Detail UniqueID is not a name with a space in it.

Also you say this is an array but there is no Dim specified.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 25, 2018, at 2:43 PM, Soucy, Michael <MSoucy@xxxxxxxxxxx> wrote:

I'm trying to write a RPG program to process an XML document that we download daily from a website. Here is the structure of the document. Some of the values have been omitted because it contains sensitive information.

<Report>
<table1>
<Detail_Collection>
<Detail UniqueID="" KEPROCaseID="" SubmitDate="2018-03-19T00:00:00" FirstName="" LastName="" ContractMemberID="" SSN="" RequestType1="Continued Stay Review" ServiceTypeName="Section 97 Private Non-Med Institution (PNMI)" Code1="H0019HU" PxCodeDescription1="Treatment Foster Care Level D" ServiceStartDate="2018-03-14T00:00:00" ServiceEndDate="2018-06-24T00:00:00" NoOfDays1="103" ApprovedUnits="180" NewStatus="Approved - Authorized" AuthorizationNum="" SubmittingProviderName="COMMUNITY HEALTH AND COUNSELING SERVICES" SubmittingProviderNPI="" ServicingProviderName="COMMUNITY HEALTH AND COUNSELING SERVICES" ServicingProviderNPI1="" Staff="" />
</Detail_Collection> </table1>
</Report>

The path option in my RPG program is "Report/table1/Detail_Collection". Is that correct? I created a data structure array to contain all the contents of each row for the handler procedure I wrote. I'm wondering if this is wrong, as the format of the XML file is not what I'm used to working with. This is my data structure definition.

dcl-ds aps qualified;
Detail_UniqueID char(9);
KEPROCaseID char(9);
SubmitDate char(19);
FirstName char(20);
LastName char(20);
ContractMemberID char(22);
SSN char(9);
RequestType1 char(34);
ServiceTypeName char(60);
Code1 char(12);
PxCodeDescription1 char(75);
ServiceStartDate char(19);
ServiceEndDate char(19);
NoOfDays1 char(3);
ApprovedUnits char(4);
NewStatus char(40);
AuthorizationNum char(25);
SubmittingProviderName char(50);
SubmittingProviderNPI char(10);
ServicingProviderName char(50);
ServicingProviderNPI1 char(10);
Staff char(30);
Note char(5000);
end-ds;

When I run my program in debug mode I does not return any values and only reads one row. Any help would be greatly appreciated.


Michael Soucy
Sr. Programmer / Analyst
Community Health and Counseling Services
(207) 922-4837

****** CONFIDENTIALITY NOTICE ******

The documents accompanying this email contain confidential information that may be legally privileged and protected by federal and state law. This information is intended for use only by the entity or individual to whom it is addressed. The authorized recipient is obligated to maintain the information in a safe, secure, and confidential manner. The authorized recipient is prohibited from using this information for purposes other than intended, prohibited from disclosing this information to any other party unless required to do so by law or regulation, and is required to destroy the information after its stated need has been fulfilled.

If you are in possession of this protected health information, and are not the intended recipient, you are hereby notified that any improper disclosure, copying, or distribution of the contents of this information is strictly prohibited. Please notify the owner of this information immediately and arrange for its return or destruction. Thank You.
--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD

--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD
--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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.