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



This is now resolved with nested output array support [1].

[1]
https://www.ibm.com/developerworks/ibmi/library/i-integrated-web-services-server/


"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 12/30/2014
02:28:16 PM:

From: Richard Schoen <Richard.Schoen@xxxxxxxxxxxxxxx>
To: "midrange-l@xxxxxxxxxxxx" <midrange-l@xxxxxxxxxxxx>
Date: 12/30/2014 02:28 PM
Subject: RE: IWS needs web service to return only the array rows used
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>

Hey Michael,

I would be interested to see the code sample for your resolution.

I have seen similar limits with using IWS previously.

Regards,

Richard Schoen | Director of Document Management Technologies,
HelpSystems
T: + 1 952-486-6802
RJS Software Systems | A Division of HelpSystems
richard.schoen@xxxxxxxxxxxxxxx
www.rjssoftware.com

----------------------------------------------------------------------


On 12/30/2014 11:42 AM, Koester, Michael wrote:
Thanks Scott.
I must say that your solution appears to be well beyond my level
of expertise, but...
I have it on good authority that IWS does not currently support
what I am trying to do.

That said, I'm finding that instead of using a return value from
the function, I can define what would ideally considered inputs as
the data structures that get loaded in the function. Since those
aren't CONST parameters, IWS sees them as multiple outputs, which
allows me to set the count property of the arrays to the variables,
and I get the XML structure I need. There might be a better way to
get there, but until I find it, this will do.
-- Michael

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of
Scott Klement
Sent: Monday, December 29, 2014 4:49 PM
To: Midrange Systems Technical Discussion
Subject: Re: IWS needs web service to return only the array rows used

Michael,

I don't have an easy answer for this... I think you've hit upon one
of
the limits of the IWS.

Personally (when I need something complex like this) is to just use
Apache to call my RPG program instead of IWS. Then, I need to do
all
of the XML work myself -- which I don't find too difficult if I
already
know what the XML should look like (and I can use the IWS to tell me
that).

But, if you code the XML yourself, you can make it only return the
array
elements you need very easily.

Plus, running raw RPG code will outperform the IWS.

-SK



On 12/29/2014 9:06 AM, Koester, Michael wrote:
Running iOS 7.1 (TR8, I think).

I'll be using the Integrated Web Services wizard to generate a web
service that provides data to a business partner. I need to send
data in
the form of multiple arrays. I am able to do this by having the
service
program function return data structures shown in D-specs similar to
below
(simplified a bit here), but the actual number of array rows used
will
vary, up to the dim limits.

D GetEBPPdata3...
D PR Extproc('EBPPTEST3')
D likeDS(rtnDS) RTNPARM
D Account 7a const
D Phone 13a const
D EmailIn 64a const

D rtnDS ds qualified
D Account likeDS(Set1)
D PhonesCount 10i 0
D Phone likeDS(Set2) dim(32)
D PaymentsCount 10i 0
D Payment likeDS(Set3) dim(16)

* fields that pertain to Account
d Set1 ds qualified inz
d Success n inz
d MsgText 128a
d DateDue 10a
d NextAutoPayDate...
d 10a

* fields that pertain to each phone on account
d Set2 ds qualified inz
d PhoneNumber 10 0 inz
d AmtDue 8 2 inz
d BankRouting 9 0 inz
d BankAccount 16a

* fields that pertain to each prior payment
d Set3 ds qualified inz
d PhoneNumber 10 0 inz
d Amount 8 2 inz
d PaidDate 10a
d Status 16a

When I test the web service, the resulting XML is pretty close to
perfect, except that I need to find a way to restrict the output from
including all the "empty" array rows. For the "Set2" stuff, I get
XML for
all 32 rows, when only 2 rows are used:

...<PHONESCOUNT>2</PHONESCOUNT>
<PHONE>
<PHONENUMBER>5290001</PHONENUMBER>
<AMTDUE>25.11</AMTDUE>
<BANKROUTING>987654321</BANKROUTING>
<BANKACCOUNT>1234567890</BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>5290002</PHONENUMBER>
<AMTDUE>50.05</AMTDUE>
<BANKROUTING>456987123</BANKROUTING>
<BANKACCOUNT>98745612</BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>0</PHONENUMBER>
<AMTDUE>0.00</AMTDUE>
<BANKROUTING>0</BANKROUTING>
<BANKACCOUNT></BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>0</PHONENUMBER>
<AMTDUE>0.00</AMTDUE>
<BANKROUTING>0</BANKROUTING>
<BANKACCOUNT></BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>0</PHONENUMBER>
<AMTDUE>0.00</AMTDUE>
<BANKROUTING>0</BANKROUTING>
<BANKACCOUNT></BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>0</PHONENUMBER>
<AMTDUE>0.00</AMTDUE>
<BANKROUTING>0</BANKROUTING>
<BANKACCOUNT></BANKACCOUNT>
</PHONE>
<PHONE>
<PHONENUMBER>0</PHONENUMBER>
... [for all 32 rows. Same issue with the <Payment> array
for
16 rows.]

If my output was a single array, my understanding is that I might
have
an opportunity in the wizard to define the output structure count to
be a
run-time variable instead of the dim default. My output, as a
"structure
of structures" does not appear to allow me any chance at fixing the
counts.

Is there a way to specify PhonesCount and PaymentsCount someplace as
the
runtime values of array rows to return?

Many thanks.

Michael Koester
Programmer/Analyst




------------------------------

message: 2
date: Tue, 30 Dec 2014 13:11:01 -0600
from: CRPence <CRPbottle@xxxxxxxxx>
subject: Re: CPE3025 - No such path or directory. (re: QDFTOWN)

On 29-Dec-2014 15:24 -0600, Gary Thompson wrote:
<<SNIP>>
Public Read and Execute with all Directories owned by QDFTOWN
<<SNIP>>

The purpose of the User Profile (USRPRF) object named QDFTOWN is to
own objects for which there is no discernible owner; either in restore
or /reclaim/ of ownership. Any ownership by that user profile should be
deemed an error in need of correction; i.e. recovery from the error
should be effected using one of the Change [Object] Owner (CHGOBJOWN or
CHGOWN) commands against the object(s). The Change Owner should request
*YES for the option to Revoke Current Authority (RVKOLDAUT) to ensure
that the user QDFTOWN does not maintain any authorities to the object;
that user should AFaIK have authorities only to itself, such that
Display User Profile (DSPUSRPRF) for the Object Authority (*OBJAUT) Type
Of Information (TYPE) should list only the one object QDFTOWN of object
type *USRPRF.

--
Regards, Chuck


------------------------------

message: 3
date: Tue, 30 Dec 2014 19:15:33 +0000
from: Gary Thompson <gthompson@xxxxxxxxxxx>
subject: RE: Inserting a record into the middle of a
subfile--suggestions?

And, thank you to Alan for the lead to QSORT
I found Jon Paris' IT Jungle article "qsort: A Better SORTA" which
helped me understand the power of Alan's suggestion . . .

Happy New Year to 'the list' !

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of Alan Campin
Sent: Tuesday, December 30, 2014 9:45 AM
To: Midrange Systems Technical Discussion
Subject: Re: Inserting a record into the middle of a
subfile--suggestions?

If you are looking to dynamically sort data from a subfile, you can go
to
www.think400.dk/downloads.htm and look for a utility called XVSRTQ.

This API allows you to build keys and sort data dynamically. It uses
QSORT to do the actual sorting. Basically a wrapper around an array
that gets sorted. The good thing about the utility is that it knows
how to store data correctly for sorting. Everything is handled by
the API. Plus its free.
That best price of all.

On Tue, Dec 30, 2014 at 9:14 AM, Jeff Young <jyoung0950@xxxxxxxxx>
wrote:

Gary,
Thanks for mentioning the article by Paul Tuohy.
I now have another tool in my tool box.

Jeff Young
Sr. Programmer Analyst

On Mon, Dec 29, 2014 at 4:57 PM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:

I have a couple of applications that do something similar: copying a
subfile to an array, re-numbering and re-sorting and the performance
is good.

The sorting is flexible, based on an article by Paul Tuohy: "Those
Weird and Wonderful Arrays" and uses a pointer to switch between the
appropriate data structure depending on what the user is doing.

If you are below a couple hundred records I expect you'll get good
results.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of Hoteltravelfundotcom
Sent: Monday, December 29, 2014 2:43 PM
To: Midrange Systems Technical Discussion
Subject: Re: Inserting a record into the middle of a
subfile--suggestions?

copying to variable size array. why not also have the user have an
edit mode screen' of the row to be updated?

On Mon, Dec 29, 2014 at 4:39 PM, x y <xy6581@xxxxxxxxx> wrote:

I need to insert records into the middle of a subfile. The user
can enter a keyword that's attached to a long description and I
need to get that description into the body of the subfile.

I could add records to the end and then resequence when writing to
the database but that won't be satisfactory from a user experience
perspective--the user needs to see the full text in order as part
of the entry process. My subfile record length (including hidden
fields) is about
400 bytes and I should have less that 50 records most of the time.
I have four 132-character subfile records on the screen and
already have used the fold/unfold option.

Copying the subfile to a variable-size array, inserting the
records where needed, and then reloading the subfile is an option.

Another option is to have A/B subfile control/detail set up
records copy from the "A" subfile (+ inserts) into the "B" subfile
and then display the "B" control record. SQL temporary tables and
memory-resident tables are possibilities also.

Where's a linked list when we really need it?

I'll be grateful for any suggestions and wish you all a Happy New
Year.

thx...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at http://
archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
take a moment to review the archives at
http://archive.midrange.com/midrange-l
.



------------------------------

message: 4
date: Tue, 30 Dec 2014 12:21:28 -0700
from: Alan Campin <alan0307d@xxxxxxxxx>
subject: Re: Inserting a record into the middle of a
subfile--suggestions?

The good thing about XVSRTQ is that you do not need to know anything
about
QSORT or anything else. Just make the calls to build your key and sort
and
it is all taken care of for you. For example, it stores numbers as two's
complement to sort negative numbers correctly.

On Tue, Dec 30, 2014 at 12:15 PM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:

And, thank you to Alan for the lead to QSORT
I found Jon Paris' IT Jungle article "qsort: A Better SORTA" which
helped
me understand the power of Alan's suggestion . . .

Happy New Year to 'the list' !

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Alan Campin
Sent: Tuesday, December 30, 2014 9:45 AM
To: Midrange Systems Technical Discussion
Subject: Re: Inserting a record into the middle of a
subfile--suggestions?

If you are looking to dynamically sort data from a subfile, you can go
to
www.think400.dk/downloads.htm and look for a utility called XVSRTQ.

This API allows you to build keys and sort data dynamically. It uses
QSORT
to do the actual sorting. Basically a wrapper around an array that
gets
sorted. The good thing about the utility is that it knows how to store
data
correctly for sorting. Everything is handled by the API. Plus its
free.
That best price of all.

On Tue, Dec 30, 2014 at 9:14 AM, Jeff Young <jyoung0950@xxxxxxxxx>
wrote:

Gary,
Thanks for mentioning the article by Paul Tuohy.
I now have another tool in my tool box.

Jeff Young
Sr. Programmer Analyst

On Mon, Dec 29, 2014 at 4:57 PM, Gary Thompson
<gthompson@xxxxxxxxxxx>
wrote:

I have a couple of applications that do something similar: copying
a
subfile to an array, re-numbering and re-sorting and the
performance
is good.

The sorting is flexible, based on an article by Paul Tuohy: "Those
Weird and Wonderful Arrays" and uses a pointer to switch between
the
appropriate data structure depending on what the user is doing.

If you are below a couple hundred records I expect you'll get good
results.

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On
Behalf
Of Hoteltravelfundotcom
Sent: Monday, December 29, 2014 2:43 PM
To: Midrange Systems Technical Discussion
Subject: Re: Inserting a record into the middle of a
subfile--suggestions?

copying to variable size array. why not also have the user have an
edit mode screen' of the row to be updated?

On Mon, Dec 29, 2014 at 4:39 PM, x y <xy6581@xxxxxxxxx> wrote:

I need to insert records into the middle of a subfile. The user
can enter a keyword that's attached to a long description and I
need to get that description into the body of the subfile.

I could add records to the end and then resequence when writing
to
the database but that won't be satisfactory from a user
experience
perspective--the user needs to see the full text in order as
part
of the entry process. My subfile record length (including
hidden
fields) is about
400 bytes and I should have less that 50 records most of the
time.
I have four 132-character subfile records on the screen and
already have used the fold/unfold option.

Copying the subfile to a variable-size array, inserting the
records where needed, and then reloading the subfile is an
option.

Another option is to have A/B subfile control/detail set up
records copy from the "A" subfile (+ inserts) into the "B"
subfile
and then display the "B" control record. SQL temporary tables
and
memory-resident tables are possibilities also.

Where's a linked list when we really need it?

I'll be grateful for any suggestions and wish you all a Happy
New
Year.

thx...
--

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.