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




Just a suggestion here, but is it possible to pass the information via XML?
Maybe even make the RPG program a web service that can consume a simple XML
request and output XML?  It would be simple for Java to process the web
service and parse the result XML.  This would also make it a loosely coupled
connection which would allow other process to use the RPG web service
instead of just Java, _and_ you could have the same thing on a different
back end written in something other than RPG if they need ever arose.

Suggestion two would be to use something like a User Space.  I have built a
set of API's that allow you to make use of a User Space similar to how you
would use a Vector in Java.  You can put different types of "objects" into
the user space and you can put any amount of "objects" into the user space
(up to 16MB).  This is what I use for temporarily storing XML data when I am
parsing XML with RPG.  Take a look at the example below:

http://mowyourlawn.com/files/UsrSpc/USRSPC(example).txt

Go here to get all the source:
http://mowyourlawn.com/files/UsrSpc/


Sorry, but I don't have any tutorials for this one yet.  It is a pretty easy
set of API's to use so you shouldn't have any trouble with it.

I would be great if they would blow the end off of the 65535 limitation.
Doesn't take too long to fill that up when you have  an array.

Aaron Bartell



-----Original Message-----
From: Dave Murvin [mailto:davem@xxxxxxxx]
Sent: Monday, August 25, 2003 9:38 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Arrays of Structures as a parameter in V5R1


Hi,

Looking for suggestions for ways to program arrays of structures (which 
also have arrays) as an input parameter.  Program will be called from an 
external Java program using pcml.  Unfortunately we are on V5R1 and the 
project deadlines may not allow an upgrade to V5R2 before implementation.

Within the RPGLE program the input structure looks something like this:

SKU                     15,A
num1                    5,0
SKU Size 1              15,A
Qty for Size 1          7,0
Date for Size 1 8,0
.
.
.
SKU Size 36             15,A
Qty for Size 36 7,0
Date for Size 36        8,0

This whole structure will be repeated up to 30 times in one call to the 
program.

There is also a return code at the end of all of this.

Partial list of the proposed pcml call looks something like this:

<struct name='availreply' >
         <data name="size" type="char" length="XX"/>
         <data name="availabilityQty" type="<packed or zoned>" length="XX"/>
         <data name'"date" type="<[acked or zoned>" length="8"/>
</struct>

<struct name='stylerequest' usage='inputoutput'>
         <data name="styleNumber" type="char" length="XX" usage='input"/>
         <data name="reply" type="struct" struct="availreply" 
usage="output" conunt="36"/>
</struct>

<program name="pgm1" path="/QSYS.LIB/.../pgm1.pgm">
         <data name="request" type="struct" struct="Stylerequest" 
count="30" usage="inputoutput"/>
         <data name="returnCode" type="char" length="XX" usage="output"/>
</program>

The call will be requesting from one to 30 SKUs at a time.

So far, I am not seeing any way to do this other than one huge input parm 
with all the fields listed individually.  Perhaps a list of 30 structures, 
or would that be 30 parameters?

Thanks for the help.


Dave Murvin
DRM Enterprises, Inc.


_______________________________________________
This is the RPG programming on the AS400 / 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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.