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



I was more asking about the presence of on-exit, not necessarily what
happens there.

I am aware of how local files work. The procedure (had I included source)
is a simple iterator that executes a callback procedure, top-to-bottom and
quit, so yes I want to open the file, read all the matching records, and
close it every time. The procedure works perfectly until I add the on-exit
opcode, then the procedure no longer works.

I have been trying to produce a pared-down (read: non-proprietary) version
but I cannot get one that fails. It's something else I have done that has
corrupted the RPG run-time storage (I've done it before, VERY difficult to
nail down).






On Fri, Apr 5, 2019 at 12:38 PM Mark Murphy <jmarkmurphy@xxxxxxxxx> wrote:

If you define the file in a procedure, and do not include the static
keyword, then the file open information is kept in the automatic storage of
the procedure, and if the file is open when the procedure ends, it is
automatically closed. The only time you need to add a close for a file is
if you are keeping the file open and in static storage area. But then you
probably would not want to close the file after each invocation of the
procedure.


On Mon, Apr 1, 2019 at 12:32 PM Stuart Rowe <rowestu@xxxxxxxxx> wrote:

Yeah I know I'm trying to pare it down, just wanted to get the question
out
there in case it sounded familiar.


On Mon, Apr 1, 2019 at 10:58 AM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

Would probably help to see the whole procedure...

Charles


On Mon, Apr 1, 2019 at 9:22 AM Stuart Rowe <rowestu@xxxxxxxxx> wrote:

I have a small procedure that contains a local database file (dcl-f),
input
only. It opens the file, setll and reade a subset of records by key,
calls
a procedure for each record read, closes the file. Fabulous thing
that
procedure-local file.

I thought I'd be slick you know, and use some newer (to me) compiler
features. I added this to the procedure:

on-exit;
if %open( inputfile );
close inputfile;
endif;

Now, the procedure no longer functions. The file gets opened, but as
soon
as I setll, whammo I get MCH3601 returned from the setll operation.

I comment out the on-exit business, works slick as buttered glass
again.

I checked that the correct file in the correct library has been
opened
and
it has the correct key and record format. NOTHING in the joblog but
the
MCH3601 and that's not all that informative.

Anyone heard of any internal conflicts between "procedure-local"
files
and
the on-exit processing? Seems weird that I could have affected the
ODP
(or
it's internal tables) this way. I am on os version 7.2.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com


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.