James,
There is obviously overhead, but I think the first question to ask is "How often is this going to fire?" and the next question is "How many transactions are we talking about?"
I do open's and close's all of the time, especially in interactive programs, because we store historical data in different libraries for each year. "Oh, you want 2006 data. Wait a sec and I'll get that for you." Can't even notice it. If, however, I tried to open/close files in a batch job for every transaction I'm pretty sure that the batch job would take measurably longer.
So I think the answer is to analyze the process, as Charles suggested. Then determine if the overhead, while there, is significant, or if another method might be better.
Jerry C. Adams
IBM System i Programmer/Analyst
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of James Lampert
Sent: Monday, September 08, 2008 7:47 PM
To: RPG programming on the AS400 / iSeries
Subject: Question about opening and closing files
How much overhead would you say is involved in making files *USROPN, and
keeping them open only while actually performing I/O on them, as opposed
to doing things the usual way?
We're thinking of doing this in a trigger program, in order to cut back
on the number of file locks.
--
James H. H. Lampert
Touchtone Corporation
--
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.