How to Identify a file by create date

How to Identify a file by create date

Post by Jeff Co » Sat, 20 Jun 2009 02:18:40


I am certain that someone else has had to do this and am hoping one of
you can help.



I want to be able to identify a file on my system by partial file name
(beginning with "PZZZ") and having a create date of the current day. I
want to then take this filename and assign it a variable for use in a
tobyte command.



Thanks in advance for any help and suggestions

Jeff Cox
Senior Manager of Enterprise Systems
Office 678-533-2811
Cellular 770-335-3142

XXXX@XXXXX.COM <mailto: XXXX@XXXXX.COM >


* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *
 
 
 

How to Identify a file by create date

Post by donna hofm » Sat, 20 Jun 2009 02:26:58

f you have mpex, this is straight-forward.

If you don't...there are always other alternatives. It would be a fairly
simple thing to do a listfile,6 of your fileset to a file...then loop
through the file looking for your target date...with a match you
<do_something_profound> (and of course, you properly code for not finding a
match or finding multiple matches...).

Yet another choice would be 'listfx' from our friend Paul:

From the command's help:

Author: Paul H. Christidis XXXX@XXXXX.COM

Usage: listfx [FileSet] [Select_Expression]

Where:
FileSet = A :LISTFILE style fileset (If using the (fset,fset,..)
format then it MUST be included in quotes).

Select_Expression = An expression comprised of coded FINFO function
calls. A number of 'predefined' FINFO parameters, constants,
and options are available along with the capability of
specifying any of the additional FINFO parameters.

The 'predefined' items/constants/options are:
$fcode - The sting mnemonic for the file's file code.
$icode - The integer value for the file's file code.
$eof - The number of records in the file.
$recsize - File's record size in 'positive' bytes.
$credate - File's creation date.
$moddate - File's last modification date.
$accdate - File's last access date.
$sectors - Number of sectors allocated to file.
$finfo( - To invoke any other 'finfo' item.
$today - The current day in 'yyyymmdd' format.
$names - To list only the file name (listfile,6).
$ymd - List dates in 'yyyy/mmdd' format.
$pmcap - List ONLY run modules with PM capability.
Note: '$pmcap' requires READ access to qualifying
files, and will change the file's access date.
Examples:
:listfx @,$fcode = 'prog' OR $icode = 1030

:listfx @,($fcode = 'prog' OR $icode = 1030) AND $accdate<>$today

:listfx ./[B-W]@ $eof < 1000 AND ($credate > $today-(18*30))
:NOTE: Correct evaluation of "$today" expressions REQUIRE that they
contain NO spaces AND the command file "dtoffset" IS present AND col-
located with THIS command file. IN its absence the expression's result
MUST evaluate within the current month.

:listfx "(./[B-W]@,/SYS/PUB/@)" $eof<1000 AND $finfo("limit")>25000

:listfx "(./[B-W]@,/SYS/PUB/@)" $eof<100 AND $pmcap $names

- donna

---
Donna Hofmeister
Allegro Consultants, Inc.
408-252-2330



* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *