Try this
-- category: Custom
-- description: SYS - Find and remove Journal Receivers older than 2.9
SELECT Objlongname , Objlongschema , Restore_Timestamp , ( X.Restore_Timestamp +3 days ) as RestorePlus3, Current_Timestamp as Current_Timestamp, ObjText
-- , cmdexc('DLTJRNRCV JRNRCV(' concat trim(ObjlongSchema) concat '/' concat trim(Objlongname) concat ')')
, varchar('DLTJRNRCV JRNRCV(' concat trim(ObjlongSchema) concat '/' concat trim(Objlongname) concat ')', 1024) as CleanUpCommand
FROM TABLE (QSYS2.OBJECT_STATISTICS('[jrnlib] ','JRNRCV') ) AS X
where ( X.Restore_Timestamp +3 days ) < Current_timestamp
;
I commented out the command line that will actually remove the receives. You can create a CMDEXC function or if you are on a new enough system IBM added one named QCMDEXC.
You can also, load another table with the receivers you remove as this query deletes the receivers and produces results.
-Matt
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jack Woehr via MIDRANGE-L
Sent: Tuesday, August 17, 2021 1:04 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Jack Woehr <jwoehr@xxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Journal Receiver automating aged deletion
Working on automating deleting detached journal receivers *n* months after they are detached.
I can get a list of the receivers into a pf using DSPOBJD but it doesn't indicate detach date/time.
I can get the detached time with DSPJRNRCVA but it's a noisy spooled file, not a pf.
Then there's the Retrieve Journal Receiver Information
(QjoRtvJrnReceiverInformation) API.
It looks to me like I've missed something simple here.
TIA for suggestions.
--
Jack Woehr, IBM Champion 2021
<
https://urldefense.com/v3/__https://www.youracclaim.com/badges/528d23d6-087f-4698-8d17-d59688106ac4/public_url__;!!O6xM9Yim9Yk!rs7Gt7gPyQdGHLBc_UovUYqnBW55LWiiH4G-fDeFHsWI7hg7LZZCoYqiC0YBrihM9o5h$ > Absolute Performance, Inc.
12303 Airport Way, Suite 100
Broomfield, CO 80021
NON-DISCLOSURE NOTICE: This communication including any and all attachments is for the intended recipient(s) only and may contain confidential and privileged information. If you are not the intended recipient of this communication, any disclosure, copying further distribution or use of this communication is prohibited. If you received this communication in error, please contact the sender and delete/destroy all copies of this communication immediately.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.com/v3/__https://lists.midrange.com/mailman/listinfo/midrange-l__;!!O6xM9Yim9Yk!rs7Gt7gPyQdGHLBc_UovUYqnBW55LWiiH4G-fDeFHsWI7hg7LZZCoYqiC0YBrrYsucab$
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.com/v3/__https://archive.midrange.com/midrange-l__;!!O6xM9Yim9Yk!rs7Gt7gPyQdGHLBc_UovUYqnBW55LWiiH4G-fDeFHsWI7hg7LZZCoYqiC0YBrvCmHfNe$ .
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.com/v3/__https://amazon.midrange.com__;!!O6xM9Yim9Yk!rs7Gt7gPyQdGHLBc_UovUYqnBW55LWiiH4G-fDeFHsWI7hg7LZZCoYqiC0YBrkxR_7IA$
As an Amazon Associate we earn from qualifying purchases.