IBM Support

msgCPF7024 RC2/msgCPF7018 RC2 - Determining the Open Commit Definition

Troubleshooting


Problem

When attempting to delete a journal receiver, message CPF7024 RC2 is seen because a commit definition is still open and journal entries from that transaction are contained in the receiver that is trying to be deleted. You may also see a CPF7018 RC2 on a CHGJRN SEQOPT(*RESET) - again because we have an open commit definition and we cannot reset journal sequence numbers with an open commit definition.

Resolving The Problem

When attempting to delete a journal receiver, message CPF7024 RC2 is seen because a commit definition is still open and journal entries from that transaction are contained in the receiver that is trying to be deleted.

You may also see a CPF7018 RC2 on a CHGJRN SEQOPT(*RESET).  When there is  an open commit definition the system cannot reset journal sequence numbers.

This is a normal message because a commit cycle can spread over multiple journal receivers.

If you believe this is a problem where a commit cycle has been abnormally left open, use one of the following to determine what job has left the commit cycle open.
Option A: SQL
Run the following SQL with replacing the Journal_Library / Journal_Name / Journal_Receiver1 / Journal_Receiver2 / Journal_Receiver_Library with the correct journal information.
WITH FirstRcvr (Journal_Receiver_Library, Journal_Receiver_Name, ATTACH_TIMESTAMP, DETACH_TIMESTAMP, Journal_Library, Journal_Name)
     AS (
         SELECT Journal_Receiver_Library,
                Journal_Receiver_Name,
                ATTACH_TIMESTAMP,
                IFNULL(DETACH_TIMESTAMP, TIMESTAMP_FORMAT('9999-12-31''YYYY-MM-DD')),
                Journal_Library,
                Journal_Name
             FROM QSYS2.JOURNAL_RECEIVER_INFO A
             WHERE Journal_Library =upper('Journal_Library')
                   AND Journal_Name = upper('Journal_Name')
                   AND (Previous_Journal_Receiver IS NULL
                       OR Previous_Journal_Receiver NOT IN (SELECT Journal_Receiver_Name
                               FROM QSYS2.JOURNAL_RECEIVER_INFO
                      WHERE Journal_Library = A.Journal_Library                             AND Journal_Name = A.Journal_Name))
     ),
     Lock_Space (Lock_Space_Id, Job_Name, User_Name, Logical_Unit_Of_Work_Id, Logical_Unit_Of_Work_State, State_Timestamp,
             Local_Changes_Pending, Remote_Changes_Pending) AS (
         SELECT Lock_Space_Id,
                Job_Name,
                User_Name,
                Logical_Unit_Of_Work_Id,
                Logical_Unit_Of_Work_State,
                State_Timestamp,
                Local_Changes_Pending,
                Remote_Changes_Pending
             FROM Qsys2.Db_Transaction_Info
             WHERE State_Timestamp IS NOT NULL
     )
    SELECT DISTINCT 'WRKCMTDFN JOB(*ALL) LUWID(''' CONCAT REPLACE(A.Logical_Unit_Of_Work_Id, ''''''''''CONCAT ''')' WRKCMTDFN,
                    A.Job_Name,
                    A.Lock_Space_Id,
                    A.User_Name,
                    A.Logical_Unit_Of_Work_State,
                    A.State_Timestamp,
                    A.Local_Changes_Pending,
                    A.Remote_Changes_Pending
        FROM FirstRcvr rcv,
             Lock_Space A
             INNER JOIN         table          (QSYS2.DISPLAY_JOURNAL(             JOURNAL_LIBRARY => RCV.JOURNAL_LIBRARY,             JOURNAL_NAME => RCV.JOURNAL_NAME,             STARTING_RECEIVER_NAME => RCV.JOURNAL_RECEIVER_NAME,             STARTING_RECEIVER_LIBRARY => RCV.JOURNAL_RECEIVER_LIBRARY,             ENDING_RECEIVER_NAME => RCV.JOURNAL_RECEIVER_NAME,             ENDING_RECEIVER_LIBRARY => RCV.JOURNAL_RECEIVER_LIBRARY,             JOURNAL_CODES => 'C',             JOURNAL_ENTRY_TYPES => 'SC,BC,SB')          ) AS X
                 ON A.Job_Name = (X.Job_Number CONCAT '/' CONCAT TRIM(X.Job_User) CONCAT '/' CONCAT TRIM(X.Job_Name))
        WHERE a.state_timestamp < rcv.DETACH_TIMESTAMP
              OR A.Local_Changes_Pending = 'YES'
              OR A.Remote_Changes_Pending = 'YES';
This SQL is also provided by QMGTOOLS:
Either in QMGTOOLS/QMGDBSQL(OPENCMT) which you can open within ACS Run SQL Scripts as Source Physical File:
image-20250710103634-3
Alternatively a source for a program is provided in QMGTOOLS/QMGDBSQL(OPENCMTPGM)
This can be compiled with:
CRTBNDCL PGM(<YourLib>/OPENCMTPGM) SRCFILE(QMGTOOLS/QMGDBSQL) DBGVIEW(*ALL)
And called by passing the journal info:
CALL <YourLib>/OPENCMTPGM PARM(<JournalName> <JournalLibrary>) 
Option B: Shorter SQL
Run the following SQL with replacing the Journal_Library / Journal_Name with the correct journal information, all upper case.  This SQL shows ALL open commits to the journal, not just the ones for the oldest journal receiver.
SELECT DTI.*, JRN.* 
FROM (SELECT * FROM QSYS2.DB_TRANSACTION_INFO WHERE LOCAL_CHANGES_PENDING = 'YES') AS DTI,
TABLE(QSYS2.DB_TRANSACTION_JOURNAL_INFO(DTI.LOCK_SPACE_ID)) AS JRN
WHERE JRN.JOURNAL_LIBRARY = upper('Journal_Library') AND JRN.JOURNAL_NAME = upper('Journal_Name')
 
Option C: DSPJRN with SQL
1.
On the OS/400 command line, type the following:

DSPJRN JRN(JRNLIB/JRNNAME)
    RCVRNG(RCVLIB/RCVNAME RCVLIB/RCVNAME)
    JRNCDE((C *ALLSLT))
    ENTTYP(SC RB CM EC)
    OUTPUT(*OUTFILE)
    OUTFILFMT(*TYPE5)
    OUTFILE(QGPL/JRNDATA)

Press the Enter key.

This creates an output file of all the commit journal entries for a range of receivers.

The starting journal receiver should be the receiver you are trying to delete.

It is recommended that the ending journal receiver is the *CURRENT receiver although, depending on how many receivers there are total, this could create a very large output file.

If there are many receivers and you believe the output file will be too large, select an ending receiver that is far enough past the starting journal receiver in the receiver chain to ensure that the SC entry types will find their RB, EC, or CM matches.

Depending on the receiver sizes, this can be 5 or 500.

The outfile name used in this example and following steps is QGPL/JRNDATA.
- If a different name is used then you must change the name used below.
2.
Note that this SQL statement has two common table expressions.   You need to copy/paste the entire SQL statement.   
with boundary as (
SELECT JOSEQN, JONBR, JOUSER, JOJOB, JOENTT, JOTSTP, JOCCID
FROM jrndata
WHERE JOCODE = 'C'
and JOENTT = 'SC' or JOENTT = 'EC' or
JOENTT = 'CM' or JOENTT ='RB'),

lastop as (
select max(joseqn) joseqn, jonbr, jouser, jojob, joccid
from boundary
group by jonbr, jouser, jojob, joccid)

select boundary.*
from boundary inner join lastop
on boundary.joseqn=lastop.joseqn and joentt='SC'
Screen print showing the entire SQL statement:
640271_complete_SQL_statement
3. This will produce a row for each job that has an open commit.
The job will need to be ended or allow to complete before the JRNRCV can be deleted.

SEQUENCE    JOB      USER        JOB         TYPE  DATE       TIME     Commit
NUMBER      NUMBER   NAME        NAME                                  Cycle ID
      23   405,958   USER123    QPADEV0038   SC   020212  112,354     23
 

Option D: WRKJRNA
1. Issue WRKJRNA JRN(JRNLIB/JRNNAME)
2. Press F19 and select Option 6 - commit definitions.
3. Use Option 12 to work with the job, and compare the start date and time to the attached date of the journal receiver that can not be deleted.

Option E: WRKCMTDFN JOB(*ALL) OUTPUT(*PRINT)
1.

2.


3.
WRKJRNA JRN(JRNLIB/JRNNAME)

Press F15 to work with journal receiver directory and put an 8 next to the attached journal receiver and look at what the Last sequence number is.

Issue WRKCMTDFN JOB(*ALL) OUTPUT(*PRINT)
4. Display the spool file and search on the journal name in upper case.
5. For every job found - look at the "Commit Cycle Identifier"

(might want to just search on 'Commit Cycle' as this name wraps)

This is the sequence number of when this commit transaction started or made its first change that has not been committed yet.
Often this will be blank or 0.
If you find one that has a large number and is much lower than the current sequence number found in step 1, then this is the job with the old commit cycle.

 

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CRZAA2","label":"IBM i Db2-\u003ECommit \/ Rollback"},{"code":"a8m0z0000000CGIAA2","label":"IBM i Db2-\u003EJournal"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

N1016835

Document Information

Modified date:
23 September 2025

UID

nas8N1016835