The Delete IFS3 command allows deletion of one or more IFS objects in
a directory and all its subdirectories based on selection criteria
such as size, last changed date, and others. You must be authorized
to the TAACVTIFS authorization list and must have *OBJEXIST rights to
the object to be deleted. An ACTION parameter exists to allow
'delete' or 'check'. The 'check' option always creates a spooled
file.
In IFS terminology, a "directory" can be
** a directory in the root file system;
** a directory in a directory-centric file system such as
QOpenSys
** a folder in the QDLS file system ('/QDLS/foldername')
You cannot delete a directory if it is in use.
You cannot delete a directory unless one of the following conditions
is true:
** The directory IS empty when the command begins.
** The directory IS NOT empty when the command begins, but the
command is able to delete all the objects in the directory.
If a directory contains objects at the end of the command that were
supposed to be deleted, an escape message will occur.
See also the DLTIFSDIR command to delete a directory.
A typical command would be:
DLTIFS3 DIR('/TESTFOLDER')
OBJTYP(*STMF)
OWNER(SMITH)
SIZE(1000000)
This would delete all stream file objects in the /TESTFOLDER
directory (and all of its subdirectories) that are owned by SMITH and
are at least 1 million bytes.
Selection processing
--------------------
The selection criteria such as DATE and SIZE are 'anded' together
meaning the object is only selected if all selections are satisfied.
DLTIFS and DLTIFS3 differences and examples
-------------------------------------------
The following lists the differences between DLTIFS3 and DLTIFS:
** DLTIFS3 uses recursion to process all of the subdirectories of
a starting directory.
** DLTIFS3 does not utilize the CVTIFS tool.
To improve performance, the internal usage of the CVTIFS tool was
removed. CVTIFS was used in DLTIFS to process the entire
subdirectory tree beforehand and write the contents to an output
file. DLTIFS then read the file to process the tree. Consequently,
two process iterations were required. The use of recursion in
DLTIFS3 eliminates the need to do this. Objects can be analyzed and
deleted (if eligible) as they are processed.
** DLTIFS3 does not utilize user profile swapping. Use SWPUSRPRF
command if you need to do this.
** DLTIFS3 does not support deletion of the starting directory.
** DLTIFS3 does not support processing of ANYTHING in the QSYS
file system. This is to protect the system. This is done by
limiting the object types to those specified in the OBJTYPE
parameter and by forbidding the starting path of /QSYS.LIB.
** DLTIFS3 allows for different wildcard characters. This is a
change from the other DLTIFS commands.
** DLTIFS3 always produces a report that details every single
file selected. This could be large. Access problems would be
noted in the report. Any access issues would result in an
exception. This report is created with SPLFOWN(*JOB).
** DLTIFS3 provides an option to write the results to an output
file. Each object analyzed is written to the file whether it
was deleted or not. If the object was not deleted, the
disqualifying object criteria is provided. This is useful
when determining why an object was not deleted.
DLTIFS3 escape messages you can monitor for
------------------------------------------
TAA9895 Objects may have been deleted, but errors occurred
TAA9896 No objects to delete - check selection criteria
Escape messages from based on functions will be re-sent.
DLTIFS3 command parameters *CMD
--------------------------
DIR The DIR keyword is required.
This is the starting directory object (*DIR or
*FLR). It must be a full path name. The root
directory, /, is not allowed. Paths starting with
/QOPT and /QSYS.LIB are not allowed.
A typical command would be: DLTIFS3
DIR('/TESTFOLDER') OBJTYP(*STMF) OWNER(SMITH)
SIZE(*ACTUAL *GT 1000000)
This would delete all stream file (*STMF) objects in
/TESTFOLDER and its subdirectories that are owned by
user profile SMITH and are greater than 1,000,000
bytes in actual size.
OBJTYP The object type to select. The possible values are:
*STMF - IFS Stream files
*SYMLNK - IFS symbolic links
*DOC - DLO documents
*DIR - IFS directories. The directory must be empty
to be eligible for deletion.
*FLR - DLO folders. The folder must be empty to be
eligible for deletion.
PRCSUBDIR Whether or not to search all subdirectories. The
default is *YES which will recursively search all
subdirectories for objects. Use *NO to limit the
search to just the directory named in the DIR
keyword.
OBJNAM This is a three element list.
The first element is the name pattern to match in
each directory that would mark it as eligible for
deletion. You may have multiple wildcards in a
pattern. A wildcard matches the shortest string of
0 or more characters until the next specified
string.
For example, '*abc*.txt' will match objects with an
extension of 'txt' and where 'abc' occurs in any
location other than in the extension. The default
is * which will match all objects if the wildcard is
*.
The second element of this list is optional and
specifies if the match respects or ignores case.
The values are *RESPECT and *IGNORE. The default is
*IGNORE.
The third element of this list is optional and
specifies the wildcard character. This defaults to
*, but may be another single-byte character. This
reduces the need to "triple-quote" pattern strings
to select certain files.
OWNER The owning user profile.
This can be either *USER or a specific user profile.
The default is *USER which represents all non-IBM
provided user profiles. Objects matching this would
be eligible for deletion. Objects owned by QSYS,
QLPINSTALL, and QLPAUTO will never be deleted and
these profiles may not be specified. *USER
specifies profiles that return *NO from CHKIBMPRF.
SIZE This is either the single value of *ANY or a
three-element list. *ANY indicates that any object
will meet the size selection.
A three element list will designate a size
selection.
The first element is the size to compare. This may
be either *ACTUAL or *ALLOCATED.
The second element is the comparison operator which
may be one of *EQ, *NE, *GT, *GE, *LT, or *LE.
The third element is the number of bytes to compare
against. This is an integer in the range of 0 to
999999999999999.
An example would be:
DLTIFS3 DIR('/TESTFOLDER') OBJNAM(*) SIZE(*ACTUAL
*GT 10000000)
This would delete all stream files in the
/TESTFOLDER directory path and its subdirectories
that are greater than 10,000,000 bytes in size.
The 'date' of the object to select for if any. A
three element list. If present, all elements must
be specified.
The first element specifies which date to use
*CREATED - The object creation date is used to
determine deletion eligibilty.
*ACCESSED - The object last access date is used to
determine deletion eligibilty.
*CHANGED - The object last changed date is used to
determine deletion eligibilty.
The second element specifies the comparison operator
which may be *EQ, *NE, *GT, *GE, *LT, or *LE.
The third element is either *ANY or a date in job
date format. If *ANY is specified then the date
selection is ignored.
The default is DATE(*CHANGED *LT *ANY).
With a job date format of *MDY DATE(*CHANGED *LT
'01/01/17') would select objects whose change date
is prior to January 1, 2017.
ACTION Whether to delete objects or to check whether they
would be deleted.
*CHECK may be specified to create a listing of what
would be deleted.
*DLT will cause the objects to be deleted.
The name and library of the file that will receive
the output. The default is QTEMP/DLTIFS3P.
This is a two-element list that names the member of
the outfile and how the records are to be written.
The first element is the name of the member to
receive the output. The default is *FIRST which
names the first member of the output file.
The second element is *REPLACE or *ADD. Records to
be written to the member will either replace the
ones in the member or be added to the end. The
default is *REPLACE.
*YES is the default. The tool will send an escape
message if no objects are selected for deletion.
*NO may be used to suppress this message.
Restrictions
------------
You must be authorized to the TAACVTIFS authorization list.
You must be authorized to delete the object (*OBJEXIST).
You cannot delete a directory type object unless:
** The directory is empty when the command begins.
** All objects in the directory have been deleted and the
directory matches the criteria specified in the OBJNAM,
OBJTYPE, and OWNER keywords. For directories, the SIZE and
DATE criteria are ignored.
*DDIR objects are never deleted.
You cannot specify the root directory (/) or a directory starting
with /QOPT and /QSYS.LIB
You cannot delete an object that is owned by QSYS, QLPINSTALL, or
QLPAUTO.
Prerequisites
-------------
The following TAA Tools must be on your system:
ADJAPOST Adjust Apostrophes
CHKIFSE Check IFS Entry
RSNLSTMSG Resend Last Message
SNDCOMPMSG Send completion message
SNDDIAG Send diagnostic message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDESCMSG2 Send escape message 2
SNDSTS Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
DLTIFS3 *CMD TAAIFSX QATTCMD
TAAIFSXC *PGM CLP TAAIFSXC QATTCL
TAAIFSQX2 *PGM CLP TAAIFSXC2 QATTCL
TAAIFSQR *PGM RPGLE TAAIFSXR QATTRPG
Structure
---------
DLTIFS3 Cmd
TAAIFSXC CL Pgm
TAAIFSXR RPGLE Pgm
TAAIFSQX2 CL Pgm
|