× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



My statement wasn't clear. Creation date is stored. It's available various ways via IBM i commands and the sql services that IBM has been providing. It is not however required by the POSIX standard, so not all file systems store it, or in the case of the QSYS.LIB objects accessed via a posix interface, QSH, QP2TERM, SSH into a shell on the box etc, report it. There are parms on some of the commands to use the create/birth date, but when you access objects in the QSYS.LIB file system, they are all null. So when I actually sat down to write the proof of concept, I realized that I couldn't access create date, and was walking back my statement about doing in QSH/PASE. In reality, I would have written a cl. I have old programs that I just clone and modify, and it usually takes less than 5 minutes to get a list of files, check to make sure I'm not over or under reaching, and then run it to delete. But he didn't want a CL, the SQL was fairly simple (doubly so when you brought in the scalar function). I thought the QSH version was going to be simple, but realized I was getting bad results and needed to revise my original statement.

Display Object Description - Full
Library 1 of 1
Object . . . . . . . : ASABASE Attribute . . . . . : PF
Library . . . . . : KEVIN Owner . . . . . . . : KEVIN
Library ASP device . : *SYSBAS Library ASP group . : *SYSBAS
Type . . . . . . . . : *FILE Primary group . . . : *NONE
User-defined information:
Attribute . . . . . . . . . . . . . :
Text . . . . . . . . . . . . . . . . :
Creation information:
Creation date/time . . . . . . . . . : 11/27/09 15:02:48
Created by user . . . . . . . . . . : KEVIN
System created on . . . . . . . . . : MDS
Object domain . . . . . . . . . . . : *SYSTEM
Change/Usage information:
Change date/time . . . . . . . . . . : 04/20/19 13:22:12
Usage data collected . . . . . . . . : YES
Last used date . . . . . . . . . . . : 06/04/19
Days used count . . . . . . . . . . : 1

And via stat from qshell

stat /qsys.lib/kevin.lib/asabase.file
File: '/qsys.lib/kevin.lib/asabase.file'
Size: 16384 Blocks: 32 IO Block: 4096 directory
Device: 8000804100000001h/9223513053516005377d Inode: 1922315 Links: 2
Access: (0707/drwx---rwx) Uid: ( 114/ kevin) Gid: ( 0/ UNKNOWN)
Access: 2019-04-20 00:00:00.000000000 -0500
Modify: 2019-04-20 13:22:12.000000000 -0500
Change: 2019-04-20 13:22:12.000000000 -0500
Birth: -
$


On Tue, 2021-09-28 at 16:16 +0000, Rob Berendt wrote:
So, what you are saying is that if I do a WRKOBJ ERPLXF and do a 8=Display description the line
Creation date/time . . . . . . . . . :
Is an optical illusion and I'm not seeing that? But I can only see the line on the next screen
Change date/time . . . . . . . . . . :

And that when I do
SELECT OBJNAME, OBJCREATED, CHANGE_TIMESTAMP
FROM TABLE (QSYS2.OBJECT_STATISTICS('ROB', '*FILE') ) as a;
That OBJCREATED timestamp is a figment of my imagination?

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 7310 Innovation Blvd, Suite 104
Ft. Wayne, IN 46818
Ship to: 7310 Innovation Blvd, Dock 9C
Ft. Wayne, IN 46818
http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx>> On Behalf Of Kevin Bucknum
Sent: Tuesday, September 28, 2021 12:09 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx<mailto:midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Using sql to delete files in a lib?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


So - the "normal" ibm library system (qsys.lib) doesn't provide create date. Could do it based on modified date. As Jack said, I'd probably write a small shell script in bash. You could one line it with pipes, but I prefer the readability of small scripts. I did create a little one liner, but it failed on a weird permission error that I haven't seen before. I'll play around with it and see if I can't create an example for the archives when it slows down this afternoon.





[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp]
Kevin Bucknum

Senior Programmer Analyst

MEDDATA / MEDTRON

120 Innwood Drive
Covington LA 70433
Local: 985-893-2550<tel:985-893-2550>
Toll Free: 877-893-2550<tel:877-893-2550>
https://www.medtronsoftware.com


CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.