|
Yep SHARE(*YES) defined on logicals on CTRFiles.
I'll descibe CPF5125 one again
PGM1 - has CTRFILE1 - defined for UPDATE and as USROPN.
PGM1 has CTRFILE1 closed at the point it updates file with
associted trigger.
Trigger opens CTRFILE for input - leaves open and returns to
PGM1.
PGM1 then tries to open CTRFILE1 and fails with CPF5125.
Opening and closing CTRfile1 in trigger will resolve the issue in this
instance as PGM1 then tries to open CTRfile itself and should be
successful. But will this work in calling pgms that the CTRFile is not
USROPN, i.e if closing in trigger will this also close file to calling
pgm. I don't think it does but I'm having a moment of doubt.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: 16 December 2008 19:33
To: RPG programming on the IBM i / System i
Subject: Re: Trigger program - open / close file question
I don't understand why the trigger program having the file opened for
input would affect another program opening the file for update....
Looking at the CPF5125 message....
Is the file defined as SHARE(*YES) or is there an OVRDBF in effect?
If so, then either
1) get rid of the SHARE(*YES)
2) have the trigger open the file for update even thought it doesn't
plan to update it. Make sure when the trigger does a READ or CHAIN you
include the
(n) op-extender so that the record isn't locked.
Charles
On Tue, Dec 16, 2008 at 1:52 PM, Brown, Stephen GRNRC <
Stephen.Brown@xxxxxxxxx> wrote:
We have recently made some extensive changes to a Trigger program.
Part of these changes meant adding a series of system control files
for input only purposes. These control file are used throughout our
system for various things like holding next numbers, environment codes
etc so sometimes they are defined for input and sometimes for update.
Anyway, we are having a problem because the control files in the
trigger pgm are currently being left open as the trigger is just
issuing a return. This is causing an issue in that in some programs
these control files are being open / closed within the calling program
and some are not. e.g Pgm 1 open / closes ctrlfile1 ( ctrlfile1can't
defined for Update). Closes CtrlFile1 - invokes trigger - trigger
opens ctrfile1 leaves open
- return to pgm1 - pgm1 tries to open ctrlfile1 again for update -
fails with CPF5125.
Now I don't want to have to review all usages of the control files in
conjunction with where the file hat has the trigger program associates
with it so best option would be to have a fit all solution made within
the trigger. ( I hope)
I need to make sure that if the trigger program is called that it
doesn't "upset" the calling programs i/o of the control files. I
thought the best way to do this would be to user define the control
files in the trigger and ensure they are closed prior to the return to
the calling program. I'm now questioning myself as I'm unsure that byplease
closing the file in the trigger will close it in the calling program
and therefore still give me an error ?
I then thought of checking the status of the control files in the
trigger using %OPEN but I'm not sure if this only applies to the
status of the file in the trigger program or in the call stack. If it
does it within the call stack fine if it doesn't then what does my
close in the trigger close it in the calling pgm ?
Can anyone offer some words of wisdom.
Thanks
----------------------------------------------------------------------
--------
CONFIDENTIALITY NOTICE: If you have received this email in error,
immediately notify the sender by e-mail at the address shown. Thisemail
transmission may contain confidential information. This informationis
intended only for the use of the individual(s) or entity to whom it isfiles if
intended even if addressed incorrectly. Please delete it from your
you are not the intended recipient. Thank you for your compliance.list
Copyright 2008 CIGNA
======================================================================
========
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
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 IBM i / System i (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.
------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown. This email transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright 2008 CIGNA
==============================================================================
--
This is the RPG programming on the IBM i / System i (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 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.