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



Sorry Chuck, I wasn't trying to coopt your solution. I just didn't get what you were saying.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----CRPence <crpbottle@xxxxxxxxx> wrote: -----
To: rpg400-l@xxxxxxxxxxxx
From: CRPence <crpbottle@xxxxxxxxx>
Date: 12/14/2015 12:22PM
Subject: Re: Need ideas to reduce open/close in RPG program


On 14-Dec-2015 10:33 -0600, Mark Murphy/STAR BASE Consulting Inc. wrote:
Try shared opens. Someone started down this path, but didn't quite
get to the end of it. You need a program at the beginning of the
process that reads through and opens each file in your control file
with SHARE(*YES). Leave them all open. Now call your current program,
and the only change you need to make is to set your override to use
SHARE(*YES). It will pick up the already opened file, and though it
is closed by the program, the open data path will stay open for the
previous program that is holding all the files open. The ODP's won't
close until all the opens with SHARE(*YES) are closed. That won't
happen until the job ends.

You could probably even do the initial opens within your RPG program,
but you will still have to execute the CL commands OVRDBF SHARE(*YES)
and OPNDBF for each file named in your control file. That will get
you open data paths without having to link them to your RPG file
declaration leaving you free to open and close that as many times as
you want.


Exactly what my prototyped example does, and since mine was CLP,
doing the OPNDBF _within_ the program was the obvious choice; and
although my program had to do one additional shared opn\clo, something
the OP would not need to do in the RPG program [though may need to add
code to establish desired position], and I still saw an 18% improvement
in overall clock-time with an external call to effect that
open\position\close, so I expect the OP could see that or better as
improvement.

...

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.