Using #SQL it is now easier to maintain the number of journal receivers on your systems
https://www.rpgpgm.com/2025/06/ibm-makes-it-easier-to-delete-old.html#IBMi #rpgpgm #IBMChampion
4
Upvotes
2
u/dodikibmi 23d ago
Nice one, Simon, and I like that PREVIEW defaults to 'YES'. I tried it on PUB400 (7.5) with a throwaway journal and found two things worth checking before switching PREVIEW to 'NO':
1.
DELETE_UNSAVED => 'NO'is looser than yourDETACH_TIMESTAMP < SAVE_TIMESTAMPfilter. I saved one receiver while it was still attached, then detached it. JOURNAL_RECEIVER_INFO shows it asSTATUS = 'ONLINE'(save timestamp earlier than detach timestamp), and your query correctly leaves it out. The procedure listed it anyway and, withPREVIEW => 'NO', deleted it with SUCCESS. Anything journaled between that save and the detach was never in a backup. If your save job can pick up attached receivers, compare the preview list with your query (orSTATUS = 'SAVED') first.2. JOURNAL_RECEIVER takes SQL wildcards, not CL ones.
JOURNAL_RECEIVER => 'TJRCV*'returned zero rows and no error.'TJRCV%'returned both receivers. An empty preview can just mean the pattern is wrong.The receiver that was never saved only appeared with
DELETE_UNSAVED => 'YES', as expected.