|
Note: haven't had a chance to test below yet.
can you declare two F specs that refer to that same file TESTH. One under
commitment control the other doesn't.
If TCommitLock <> '0'
use the file that is under commitment control
otherwise
use the file that is not under commitment control
endif
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Mark Adkins
Sent: Thursday, September 30, 2004 11:47 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Commitment control and open data paths with triggers
There are a lot of existing programs that do not use commitment control to
access the file. It is actually more simple than using QCMDEXC.
The trigger buffer has a commit lock parameter.
D TrgBuffer ds
D TFileName 10 Bytes(1-10)
D TLibraryName 10 (11-20)
D TmemberName 10 (21-30)
D TEvent 1 (31)1=Ins 2=Dlt3=Upd
D TTime 1 (32)1=After 2=Before
D TCommitLock 1 (33)1=Chg 2=CS 3=All
User control the opening of the file and use the commit(value) keyword.
FTESTH O E DISK USROPN COMMIT(COMMITLOCK)
F RENAME(TESTH:TESTHR)
F BLOCK(*NO)
Set the commit value based on the trigger buffer.
C IF TCOMMITLOCK <> '0'
C IF %OPEN(TESTH) AND COMMITLOCK = *OFF
C CLOSE TESTH
C ENDIF
C EVAL COMMITLOCK = *ON
C ELSE
C IF %OPEN(TESTH) AND COMMITLOCK = *ON
C CLOSE TESTH
C ENDIF
C EVAL COMMITLOCK = *OFF
C ENDIF
The closing of TESTH is what I had to add to facilitate switching between
the commitment levels.
Regards,
Mark
> ----- Message from "Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxx> on Thu,
> 30 Sep 2004 10:33:47 -0500 -----
> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
> Subject: RE: Commitment control and open data paths with triggers
>
> I'm not understand why you want to condition the commitment control
> for TESTH file in the trigger program. Wouldn't it be easier to
> just always have it under commitment control. In the *inzsr, do
> callp(e) to QCMDEXC to start the commitment control and then open the
file.
--
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.
This mailing list archive is Copyright 1997-2025 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.