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




On 05/04/2007, at 11:19 PM, Johan Vangilbergen wrote:

When I run this interactively, all goes well. However, if I run this in
batch, the procedure crashes on the "Clear Key2" statement, saying that
the pointer or location was not referenced.

What am I missing ?

First, have the courtesy to put a SUBJECT line in your appends.

Second, this code runs interactively simply by GOOD LUCK. There just happen to be two old pointers on the stack after the two you pass when calling this procedure. These old pointers are from some other previous call to a procedure or program that was passed four or more parameters by reference. In batch it just happens that those old parameters aren't present so you get the pointer reference error.

Although your procedure "appears" to work interactively it is actually CLEARing storage it has no right to address. That can cause other, much subtler, errors which can be difficult to resolve. Again the fact that this procedure runs interactively without causing problems is simply good luck.

The resulting learning experience should be:
IF A PARAMETER WASN'T PASSED THEN DON'T REFERENCE IT IN CODE.

Other's have pointed out the coding defects that contribute to this problem but no-one bothered to explain it. If my explanation is insufficient then search the archives. There are previous discussions on this very problem.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\
Fax: +61 3 9419 0175 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.