Delete Document Library Object (DLTDLO)

The Delete Document Library Object (DLTDLO) command allows you to delete a document or a folder.

This command is used to delete documents and folders that are no longer needed from the system, which prevents system storage from being used for obsolete objects.

Note: When a document is deleted, a request is generated to remove its entry (if it exists) from the text index.

Restrictions:

Parameters

Keyword Description Choices Notes
DLO Document library object Single values: *SEARCH, *ALL, *SYSOBJNAM
Other values (up to 300 repetitions): Character value
Required, Positional 1
FLR In folder Character value, *ANY, *NONE Optional, Positional 2
CRTDATE Creation period Element list Optional
Element 1: Starting time and date Element list
Element 1: Starting time Time, *AVAIL
Element 2: Starting date Date, *CURRENT, *BEGIN
Element 2: Ending time and date Element list
Element 1: Ending time Time, *AVAIL
Element 2: Ending date Date, *END
CHKEXP Expiration date Date, *NO, *CURRENT Optional
DOCCLS Document class Character value, *ANY Optional
OWNER Owner profile Name, *CURRENT, *ALL Optional
SYSOBJNAM System object name Values (up to 300 repetitions): Name Optional
CMDCHRID Command character identifier Single values: *SYSVAL, *DEVD
Other values: Element list
Optional
Element 1: Graphic character set Integer
Element 2: Code page Integer
ASP Auxiliary storage pool ID 1-32, *ANY Optional

Document library object (DLO)

Specifies the documents or folders that are deleted. If DLO(*SEARCH) is not specified, CRTDATE, CHKEXP, DOCCLS, CMDCHRID, and OWNER cannot be specified.

This is a required parameter.

*ALL
All documents or folders currently filed in the folder specified on the In folder (FLR) parameter are deleted.
*SEARCH
All documents and folders that meet the specified search values are deleted. Search values are specified using the following parameters. When more than one parameter is specified, the "AND" relationship is used to combine them:
  • In folder (FLR) parameter
  • Creation period (CRTDATE) parameter
  • Expiration date (CHKEXP) parameter
  • Document class (DOCCLS) parameter
  • Owner profile (OWNER) parameter

When *SEARCH is specified, the search is performed by examining the document details.

*SYSOBJNAM
The system object names for the documents or folders specified on the System object name (SYSOBJNAM) parameter are used.
name
Specify one or more document or folder names of specific documents or folders that are deleted. A maximum of 300 documents or folders can be specified.

Note: To delete a folder and all documents and folders within it, specify *ALL on the Document library object (DLO) parameter and the folder name using the In folder (FLR) parameter. Otherwise, if a folder name is specified on the Document library object (DLO) parameter, the folder must be empty to be deleted.

In folder (FLR)

Specifies the folder that contains the documents or folders. If the document or folder does not exist in a folder, *NONE is specified.

*NONE
The document or folder is not contained in a folder. The *SEARCH and *ALL values on the Document library object (DLO) parameter apply only to documents and folders not contained in folder.
*ANY
A system-wide search takes place. The *SEARCH and *ALL values on the Document library object (DLO) parameter apply to all documents and folders, including those which are not contained in any folder.
name
Specify the folder name that contains the documents or folders.

Creation period (CRTDATE)

Specifies that documents and folders created during the time period specified are deleted. If this parameter is specified, *SEARCH must be specified on the Document library object (DLO) parameter.

Element 1: Starting time

*AVAIL
Documents and folders created at any time are deleted.
time
Specify a time. Only those documents and folders created at or after the specified time on the starting date are deleted. The time can be specified with or without a time separator:
  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds.
  • With a time separator, specify a string of 5 or 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If you enter this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.
  • Specify 0 for the seconds value as the seconds are not used in the selection process.

When the start-time is used as a search value, the start-date must not be *BEGIN.

Element 2: Starting date

*CURRENT
Only those documents and folders created on the day you enter this command, and after the starting time (if specified), are deleted.
*BEGIN
Documents and folders created on any specified date are deleted. (The starting date and time is ignored.)
date
Specify a date. Only those documents and folders created on or after the date specified are deleted. The date must be specified in the job date format.

Element 3: Ending time

*AVAIL
Documents and folders created at any time are deleted.
time
Specify a time. Only those documents and folders created at or before the specified time on the ending date are deleted. See the start-time on this parameter for details about how time must be specified. When the end-time is used as search values, the end-date must not be *END.

Element 4: Ending date

*END
Documents and folders created on any date are deleted. The ending time is ignored when *END is specified.
date
Specify a date. Only documents and folders created on or before this date are deleted. The date must be specified in the job date format.

Expiration date (CHKEXP)

Specifies the expiration date of the documents being deleted. The expiration date is assigned to specify when a document is no longer needed. A document with an expiration date (as specified by the user on the Change Document Details display) earlier than the date specified is deleted. If this parameter is specified, *SEARCH must also be specified on the Document library object (DLO) parameter.

*NO
The expiration date for the document is ignored.
*CURRENT
Only documents with an expiration date earlier than today's date are deleted.
date
Specify a date. Only documents with an expiration date earlier than the date specified are deleted.

Document class (DOCCLS)

Specifies the class of documents that are deleted. If this parameter is specified, *SEARCH must also be specified on the Document library object (DLO) parameter.

*ANY
Documents are deleted without regard to the document's class.
class
Specify a character string, ranging from 1 through 16 characters in length. Only documents of the specified class are to be deleted. For comparison, the document class specified and the document class of all documents are converted to uppercase.

Owner profile (OWNER)

Specifies the owner of the documents and folders that are deleted. If this parameter is specified, *SEARCH must also be specified on the Document library object (DLO) parameter.

*CURRENT
Only documents or folders owned by you are deleted.
*ALL
Document and folders are deleted without regard to the object's owner. The user must have all object (*ALLOBJ) or security administrator (*SECADM) special authority to specify *ALL.
name
Specify the name of a user. Only documents or folders owned by the specified user are deleted. You must have *ALLOBJ or *SECADM special authority to specify an owner other than yourself.

System object name (SYSOBJNAM)

Specifies the system object names of the document library objects that are deleted. A maximum of 300 system objects can be specified. System object names can be specified only if *SYSOBJNAM is specified on the Document library object (DLO) parameter.

name
Specify one or more system object names that are deleted.

Command character identifier (CMDCHRID)

Specifies the character identifier (graphic character set and code page) for the data being entered as command parameter values (applies to the Document class (DOCCLS) parameter. The character identifier is related to the display device that was used to enter the command.

*SYSVAL
The system determines the graphic character set and code page values for the command parameters from the QCHRID system value.
*DEVD
The system determines the graphic character set and code page values for the command parameter from the display device description where this command is entered. This option is valid only when specified from an interactive job. If this value is specified in an interactive CL program or a batch job, an error message is sent.
graphic-character-set-code-page
Specify the graphic character set and code page values that are used to create the command parameter. Each value can be up to 3 digits in length.

Auxiliary storage pool ID (ASP)

Specifies the identifier (ID) of the auxiliary storage pool (ASP) of the document library object to be deleted. A value other than *ANY can be specified on this parameter only if *ALL or *SEARCH is specified on the DLO parameter and *ANY is specified on the FLR parameter.

*ANY
Document library objects on the system are deleted without regard to the object's ASP.
1-32
Only the document library objects that reside in the specified ASP are to be deleted. All document library objects in other ASPs are ignored. The value must designate an existing ASP that contains document library objects. ASP 1 is the system ASP.

Note: This option is provided to aid in recovery from damage to a user ASP, particularly one that has overflowed. The document library objects and their details are deleted from the damaged ASP (after the necessary data recovery actions are taken for the ASP), thereby removing overflowed objects and potentially damaged objects from the ASP prior to restoring from backup media. More information on document library objects in ASPs is in the Recovering your system book, SC41-5304.

Examples

Example 1: Deleting a Folder

DLTDLO   DLO(ABC)

This command deletes folder ABC if it contains no documents or folders.

Example 2: Deleting All Documents and Folders Within a Folder

DLTDLO   DLO(*ALL)  FLR(ABC)

This command deletes all the documents and folders that the user is authorized to delete from folder ABC. If folder ABC turns out to be empty, then it is also deleted.

Example 3: Deleting All Documents in a Document Class, Using *SECADM Special Authority

DLTDLO   DLO(*SEARCH)
         CRTDATE((*AVAIL 080187) (*AVAIL 083187))
         DOCCLS(LETTERS)  OWNER(*ALL)

This command deletes all documents in document class LETTERS that were filed in the system during August 1987. Only the security officer or a user with *SECADM special authority is allowed to specify OWNER(*ALL).

Example 4: Deleting Current User's Documents

DLTDLO   DLO(*SEARCH)  CRTDATE((*AVAIL *BEGIN) (*AVAIL *END))
         DOCCLS(*ANY)  OWNER(*CURRENT)

This command deletes all documents belonging to the current user.

Example 5: Deleting User's Documents Filed Today

DLTDLO   DLO(*SEARCH)

This command deletes all documents belonging to the specified user that were filed on that day.

Example 6: Deleting Documents and Folders With Document Descriptors

DLTDLO   DLO(*SEARCH)  CRTDATE((*AVAIL *BEGIN) (*AVAIL *END))
         DOCCLS(*ANY)  OWNER(*ALL)

This command deletes all documents and folders with document descriptors from the system. If the document descriptors are not synchronized with the document and folder objects, then they are the same as DLO(*ALL). The Backup, Recovery, and Availability topic in the Information Center has more information about synchronizing document descriptors.

Error messages

*ESCAPE Messages

CPF2204
User profile &1 not found.
CPF8A16
Document library objects not deleted. &1 objects deleted.
CPF9005
System resource required to complete this request not available.
CPF9006
User not enrolled in system distribution directory.
CPF9012
Start of document interchange session not successful for &1.
CPF9029
Not allowed to specify owner profile &1.
CPF903A
Document or folder activity not stopped, requested operation cannot be done.
CPF9031
No authority to specify DLO(*ALL).
CPF9032
Document interchange session not started.
CPF9046
No documents found satisfying search specification in folder &1.
CPF9062
Date must be specified when time not *AVAIL.
CPF9063
Starting and ending CRTDATE specified in reverse order.
CPF9096
Cannot use CMDCHRID(*DEVD), DOCCHRID(*DEVD) in batch job.
CPF9845
Error occurred while opening file &1.
CPF9846
Error while processing file &1 in library &2.
CPF9847
Error occurred while closing file &1 in library &2.