CHKDLO (Check Document Library Object)

CHKDLO Command syntax diagram

 

Purpose

The Check Document Library Object (CHKDLO) command verifies that an object exists and that a user has authority to the object before trying to access it.

These checks are useful before the user tries to access several objects at the same time. The CHKDLO command is also used to check the validity of document library object names contained in CL variables and to verify object authorizations under program control.

When the command runs, the system searches for the specified object. If the object is found, the system verifies that the user is authorized to that object in the manner specified on the CHKDLO command. If the object is not found or the user does not have the authority specified on the CHKDLO command, an escape message is sent to the user.

When the CHKDLO command is used in a CL program, at least one Monitor Message (MONMSG) command should follow the CHKDLO command to monitor messages that result from running this command. More information on this parameter is in Commonly used parameters.

 

Required Parameters

DLO
Specifies the document library object that is checked.

*SYSOBJNAM: The system object name is used to identify the document or folder that is checked. This parameter must be used to check a document that is not in a folder. It may also be used instead of a folder name or document name, whenever the system object name is known. The SYSOBJNAM parameter and DLO(*SYSOBJNAM) must be specified together.

document-name: Specify the name of the document that is checked.

folder-name: Specify the name of the folder that is checked.

 

Optional Parameters

FLR
Specifies the name of the folder that contains the document.

*NONE: The object that is checked is not contained in a folder.

folder-name: Specify the name of the folder that contains the document or folder that is checked. A folder name can be specified only if a folder or document name is specified for the DLO parameter.

SYSOBJNAM
Specifies the system object name. This parameter is valid only when DLO(*SYSOBJNAM) or DOCL(*SYSOBJNAM) is specified. A full ten characters must be specified.

OBJTYPE
Specifies the OS/400 system object type of the document library object that is checked. OBJTYPE(*DOC) cannot be specified when a document or folder name is specified for the DLO parameter, and FLR(*NONE) is also specified. More information on this parameter is in Commonly used parameters.

*ANY: The object that is checked is either a document or a folder.

*DOC: The object that is checked is a document.

*FLR: The object that is checked is a folder.

AUT
Specifies the authority being checked. More information on this parameter is in Commonly used parameters.

*NONE: Authority is not checked.

*ALL: The user is checked for authority to perform all operations on the document or folder except those limited to the owner.

*CHANGE: The user is checked for authority to perform all operations on the document or folder except those limited to the owner or 'ALL' authority.

*USE: The user can perform basic operations on the document library object, such as running a program or reading a file. The user cannot change the document library object. *USE authority provides object operational authority, read authority, and execute authority.

*EXCLUDE: The user cannot access the document library object.

USRID
Specifies the user ID and address of the user for whom the object is being checked. If a user ID and address of someone other than the user who is signed on is specified,

the user must have *ALLOBJ special authority or both users must be enrolled in the system directory and the user who is signed on must be granted permission (using the GRTUSRPMN command) to work on behalf of the specified user.

*CURRENT: The user profile that is currently running is used.

Element 1: User ID

user-ID: Specify the user ID of the user on whose behalf the object is to be checked.

Element 2: User Address

user-address: Specify the address of the user on whose behalf the object is to be checked.

Note: The USRID parameter is useful only when the AUT parameter and any special value are specified, except *NONE.

Example for CHKDLO

CHKDLO  DLO(FLR1)  OBJTYPE(*ANY)  AUT(*NONE)
  USERID(USER1 ADDR1)

This command checks for the existence of a folder named FLR1 on behalf of a user whose user ID is USER1 and whose address is ADDR1. The user's authority to FLR1 is not checked.

Error messages for CHKDLO

*ESCAPE Messages

CPF8A11
CHKDLO command failed.
CPF8A75
Not authorized to access folder &1.
CPF8A77
Folder &1 not found.
CPF8A82
Document &2 not found in folder &1.
CPF8A83
Not authorized to access document &2 in folder &1.