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



Lorraine, just as a fyi, wa is scoped locally (to the procedure) as
opposed to globablly (to the service program). Sorry I don't have
anything otherwise helpful to pitch in here.

Kurt Anderson
Application Developer
Highsmith

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Lorraine.Ford@xxxxxxxxxxx
Sent: Wednesday, July 30, 2008 1:59 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: CEE0810 Error on Reallocate Statement

Sorry, I guess I didn't understand your question exactly...

WA is defined in the D specs for the individual procedure that's
executing the allocate/reallocate, like this:

d Procedure...
d pr
d Parm1 1a
d Parm2 3a

/if not defined(copy)
d bb ds occurs(283)

d wa s 10i 0
d b2 s 10i 0
d Array s 32a dim(32767)
d based(arrayPtr)
d arrayPtr s *

I'm not clear on what you mean by the scope of the arrayPtr, so I say
it's just defined as a standard pointer, with the '*', and the array is
the limit of 32767 elements, based on the array pointer.

Thanks,
Lorraine

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Terrence Enger
Sent: Wednesday, July 30, 2008 2:22 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: CEE0810 Error on Reallocate Statement

On Wed, 2008-07-30 at 12:59 -0400, Lorraine.Ford@xxxxxxxxxxx wrote:
WA is 10I o

But, where is it defined?


Scope of arrayPtr is just the standard.

I am sorry to be slow, but where is that?


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Terrence Enger
Sent: Wednesday, July 30, 2008 11:20 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: CEE0810 Error on Reallocate Statement

What are the scopes of `arrayPtr` and `wa`?

On Wed, 2008-07-30 at 10:22 -0400, Lorraine.Ford@xxxxxxxxxxx wrote:

One of our developers is running into a hard halt error, CEE0810, on
a
reallocate statement. This is in a service program, which another
program is using CALLP to access. She has her pointer and array
defined
as follows:



d array s 32a dim(32767)

d based(arrayPtr)

d arrayPtr s *



Does her initial allocation:



// allocate storage, if necessary



if wa = *zero;

wa = 100;

arrayPtr = %alloc(wa * 32);

endif;



And then reads records from a file using SQL. It's that data she's
going to store in the array. So, if it's determined she needs to
store
more than 100 elements, the program attempts to reallocate:



if b2 > wa;

wa += 100;

arrayPtr = %realloc(arrayPtr:wa * 32);

endif;



The reallocate fails with CEE0810:



The starting address for reallocation is not valid.


Function check. CEE0810 unmonitored by PGMNAME at statement
0000000855,

instruction X'0000'



No one has any idea what the problem is, research has turned up
nothing.
Could the problem be something like since this is a service program,
and
it's on the 5th call to the service program that the reallocate
logic
is
executed, somehow the program has lost the location of the original
allocation so it doesn't know where to go to reallocate? There's no

other logic in the program that's manipulating the value of the
pointer
other than the allocate and reallocate statements above.




Thanks for any ideas,

Lorraine


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




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