You end a journal by running the ENDJRN command, which stops new entries from being recorded. You remove the journal object itself using the RMVJRN command, which deletes the definition from the system library.
The main condition is that you must stop all active journaling before you can safely remove the journal object. If you attempt to delete the journal while programs are still writing to it, the system will return an error because the journal is in use.
End Active Journaling
Before removing any definitions, you must ensure no objects are currently attached to the journal. This step is critical for data integrity. When you end a journal, the system closes the journal receiver files. It does not delete the receiver files themselves; they remain on disk as historical records until you manually delete them later.
To end the journal, you need the name of the journal and the library where it resides. The standard command structure is:
- Open a 5250 session or Command Line Interface.
- Type the command:
ENDJRN OBJ(LibraryName/JournalName). - Press Enter.
If the journal is attached to multiple objects, the system ends the attachment for all of them simultaneously. You do not need to detach each object individually first. However, if specific objects are still actively recording changes at the exact moment you run this command, the system might wait briefly for those transactions to commit. In most cases, the command completes immediately.
Verify the Status
After running the end command, you should verify that the journal is no longer active. You can check the status by using the WRKOBJLCK (Work with Object Locks) command or by reviewing the job log. If the journal shows as “ended” or “inactive,” you are ready for the next step.
Remove the Journal Definition
Ending the journal leaves the journal object defined in the system. To completely remove it, you must use the remove command. This action deletes the journal object from the specified library. Once removed, the system no longer recognizes the journal name in that library.
The command to remove the journal is:
RMVJRN OBJ(LibraryName/JournalName)
This command requires that the journal is already ended. If you try to remove a journal that is still active, the system will reject the request. Ensure you have completed the ending step successfully before proceeding.
Handle Receiver Files
A common point of confusion involves the journal receiver files. Ending or removing the journal does not delete the physical receiver files stored on your disk. These files contain the audit trail and change history. If you leave them, they continue to consume storage space.
To reclaim disk space, you must delete the receiver files separately. You can do this using the DLTJRNE (Delete Journal Entry) or DLTF (Delete File) commands, depending on how the receivers are stored. Typically, they are stored as physical files in a library dedicated to journal receivers.
Check the library list for files named after the journal. Delete these files only if you are certain you do not need the historical data for compliance or recovery purposes.
Common Misconceptions
Many users believe that removing the journal automatically clears the transaction log. This is incorrect. The journal and the system transaction log are separate components. Removing the journal removes the custom audit trail, but it does not affect the system’s ability to recover data from the primary transaction log.
Another misconception is that you can remove the journal while a program is running. If a batch job is currently writing to the journal, the RMVJRN command will fail with a message indicating the object is in use. You must stop the relevant jobs or subsystems before attempting removal.
Worked Example
Consider a scenario where you have a journal named JRNPROD in the library PRODDATA. You want to decommission this journal because the application has moved to a new tracking method.
First, you end the journal:
ENDJRN OBJ(PRODDATA/JRNPROD)
The system responds that the journal has been ended. Next, you remove the definition:
RMVJRN OBJ(PRODDATA/JRNPROD)
The system confirms the object has been removed. Finally, you check the library PRODDATA for any files starting with JRN. You find a file named JRN001. You delete this file using:
DLTF FILE(PRODDATA/JRN001)
This sequence ensures a clean removal of both the logical journal and its physical storage.
What to Do Next
After removing the journal, you may need to update application documentation or configuration files that referenced the old journal name. Check any startup scripts or job descriptions that might have included parameters for journaling. Remove those references to prevent errors when jobs start in the future.
If you plan to create a new journal with a different name or configuration, you can now define it without conflict. Ensure the new journal points to the correct libraries and objects. Verify the setup by making a test change to a monitored object and confirming the entry appears in the new journal.
Recovery Considerations
Once the journal is removed, you lose the ability to replay specific changes recorded in that journal. If you need to restore data to a point in time based on that journal, you must rely on backups taken before the journal was removed. Plan your backup strategy accordingly. Keep copies of the receiver files in offline storage if long-term retention is required for legal or audit reasons.
Permissions Required
You need specific authorities to perform these actions. Typically, you require *CHANGE authority on the journal object to end it, and *ALLOBJ or *SECADM authority to remove it. If you receive an authorization error, contact your system administrator to grant the necessary rights. Do not attempt to bypass security controls.
Journaling for Large Batches and Kids
This section addresses a misunderstanding. The query “ibm i how to end and remove journal” is technical. There is no context involving children or large batches in the sense of family activities. However, if you are managing large batch jobs that generate significant journal traffic, ending the journal during a maintenance window is best practice. Stop the batch jobs, end the journal, then remove it. This prevents partial writes and ensures consistency.
Related Technical Questions
How do I view the contents of a journal? Use the DSPJRN command to display journal entries. This allows you to review changes before deleting receivers.
Can I rename a journal? No, you cannot rename a journal directly. You must end and remove it, then create a new one with the desired name.
What happens if I power off the system? The journal remains in an ended state. You do not need to re-run the end command upon restart, but you must still remove the definition if you wish to delete it.
Related
- Junk Journaling for Beginners: Start Your First Journal
- Start a Journaling Challenge: 7-Day Plan
- How to Practice Gratitude as a Family: Simple Daily Steps
General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more
Spotted an error? Tell us and we will correct it (corrections policy).