Work with Optical Files (WRKOPTF)

Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC)
Threadsafe: No
Parameters
Examples
Error messages

The Work with Optical Files (WRKOPTF) command displays a list of optical files on the system and provides options to copy, to delete, to rename and to display or print a list of optical files and their attributes.

Restrictions:

  1. To use this command you must have *USE authority to the authorization list securing the volume containing the optical files.
  2. If this command is issued for an optical volume which is in a remote optical server, only the following can be specified:
    • DIR(optical-directory-name)
    • FILE(*ALL)
    • FILE(file-name)
    • FILE(generic*-file-name)
Top

Parameters

Keyword Description Choices Notes
VOL Volume identifier Character value Required, Positional 1
DIR Directory Character value, *ALL Required, Positional 2
FILE File Character value, *SELECT, *ALL Optional, Positional 3
SLTFILE Select files Element list Optional
Element 1: From file Character value, *ALL
Element 2: To file Character value
SLTDATE Select date Element list Optional
Element 1: Date type *CREATED, *MODIFIED
Element 2: Starting date and time Element list
Element 1: Starting time Time, *AVAIL
Element 2: Starting date Date, *BEGIN
Element 3: Ending date and time Element list
Element 1: Ending time Time, *AVAIL
Element 2: Ending date Date, *END
Top

Volume identifier (VOL)

Specifies the identifier of the optical volume that contains the files to be listed.

Top

Directory (DIR)

Specifies the optical directory that contains the files specified to be listed, beginning with the root directory of the volume.

This is a required parameter.

*ALL
All directories on the specified optical volume are listed. If DIR(*ALL) is specified, only optical files contained in the root directory are listed.
directory-name
Specify the name of a directory.
Top

File (FILE)

Specifies the file or files to be listed.

*ALL
All files in the specified directory are listed.
*SELECT
The files in the range specified on the SLTFILE parameter are listed.

Note: This value is ignored for volumes in remote optical servers.

file-name
Specify the name of a file.
generic*-file-name
Specify the generic name of the file you want to work with. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name.
Top

Select files (SLTFILE)

Specifies the range of files to be listed.

Notes:

  1. This parameter is valid only if FILE(*SELECT) is specified and is ignored if the optical volume was initialized as a backup volume.
  2. This parameter is not valid for remote optical servers.

Element 1: From file

*ALL
All files in the specified directory are selected.
from-file
Specify the name of the first file in the name range to be selected.
generic*-file-name
Specify the generic name of the optical files to be selected.

Element 2: To file

to-file
Specify the name of the last file in the name range.

Note: This value is ignored when the from-file value is *ALL or generic*.

Top

Select date (SLTDATE)

Specifies the date and the time range of the files to be selected.

Notes:

  1. This parameter is valid only if FILE(*SELECT) is specified and is ignored if the optical volume was initialized as a backup volume.
  2. This parameter is not valid for remote optical servers.

Element 1: Date type

*CREATED
The files are selected by the dates on which they were created.
*MODIFIED
The files are selected by the dates on which they were changed.

Element 2: Starting date and time

Element 1: Starting time

*AVAIL
The time range includes all possible times before the end time.
start-time
Specify the earliest time in the time range.

Element 2: Starting date

*BEGIN
The date of the oldest file is the starting date.
start-date
Specify the earliest date in the date range.

Element 3: Ending date and time

Element 1: Ending time

*AVAIL
The time range includes all times after the starting time.
end-time
Specify the last time in the time range.

Element 2: Ending date

*END
The date of the newest file is the ending date.
end-date
Specify the last date in the date range.
Top

Examples

Example 1: Displaying Optical Files in a Root Directory

WRKOPTF   VOL(VOL01)  DIR(*ALL)

This command displays a list of all optical files in the root directory on the optical volume VOL01.

Example 2: Displaying Optical Files in a Specific Directory

WRKOPTF   VOL(VOL02)  DIR('/DIR1')  FILE(*ALL)

This command displays a list of all optical files in the directory DIR1 on the optical volume VOL02.

Example 3: Displaying Optical Files Created on Specific Dates

WRKOPTF   VOL(VOL03)  DIR('/DIR2')
          FILE(*SELECT)  SLTFILE(*ALL)
          SLTDATE(*CREATED ('12:01:00' '1/1/94')
                           ('23:59:59' '12/31/94'))

This command displays a list of all optical files in the directory DIR2 on the volume VOL03 created between 12:01:00 on January 1, 1994 and 23:59:59 on December 31, 1994.

Top

Error messages

*ESCAPE Messages

OPT0159
Beginning selection is greater then ending selection.
OPT1115
File not found.
OPT1205
Directory not found.
OPT1212
Directory in use.
OPT1220
File or directory name already exists.
OPT1224
Path length exceeds the maximum of 256 bytes.
OPT1317
Directory name is too long.
OPT1320
Optical volume &1 in use.
OPT1325
Optical volume format not recognized.
OPT1330
Optical volume not found or not useable.
OPT1331
Optical volume &1 not found.
OPT1340
Optical volume &1 not initialized.
OPT1360
Media directory corrupted on optical volume &1.
OPT1460
Optical volume &1 is not in an optical device.
OPT1463
Operation not completed, optical volume is not a primary volume.
OPT1489
Volume parameter is not permitted for device &1.
OPT1530
&1 does not represent a valid optical device.
OPT1555
Optical device &1 in use.
OPT1605
Media or device error occurred.
OPT1640
Error occurred reading files or directories.
OPT1790
Operation not allowed or conflicts with another request.
OPT1805
Error accessing optical volume index file.
OPT1810
Error accessing optical directory index file.
OPT1815
Internal program error occurred.
OPT1820
Internal error occurred on optical device &1.
OPT1821
Error occurred on optical device &1.
OPT1825
Optical indexes are incorrect for optical device &1.
OPT1860
Request to optical device &1 failed.
OPT1861
No device description configured for resource &1.
OPT1862
No active device description for resource &1.
OPT1863
Optical libraries need to be reclaimed.
OPT1872
Optical request timed out or was cancelled.
OPT2301
Internal system object in use.
OPT7740
User not authorized to object &2 in library &3 type &4.
Top