CL Command Reference - ADDIMGCLGE

CL Command List > ADDIMGCLGE Reference

Description:

The Add Image Catalog Entry (ADDIMGCLGE) command is used to create a virtual image in the image catalog directory (as specified by the Directory (DIR) parameter on the CRTIMGCLG command). If the image is added successfully, the image will be loaded and the image catalog (*IMGCLG) in library QUSRSYS will be updated. Images can be added from the following sources:
1. CD or DVD media (by specifying an optical device containing the CD or DVD image to be added). This source is only allowed for optical type image catalogs.
2. An image file located in a directory. The image file can exist in any directory that is accessible through the Copy Object (CPY) command.
3. A new image file by specifying the FROMFILE(*NEW) parameter

If an image catalog entry exists with the same index as specified for the Image catalog index (IMGCLGIDX) parameter, one of the following will occur:
1. If REPLACE(*NO) is specified, an error message will be issued and the catalog entry in the image catalog will not be replaced.
2. If REPLACE(*YES) is specified, the catalog entry in the image catalog will be replaced.
3. If REPLACE(*INSERT) is specified, the catalog entry in the image catalog will be inserted. If a catalog entry already exists at the index specified, the remaining entries will be incremented by one up to the next available index.

If the image does not exist in the target directory, the image is copied and the image catalog is updated with information about this image.

Restrictions:

. This command is shipped with public *EXCLUDE authority.
. The following authorities are required to add an image catalog entry:
1. Execute (*EXECUTE) authority to library QUSRSYS.
2. *CHANGE authority to the image catalog.
3. Execute (*X) authority to each directory in the image catalog path name.
4. If adding an image file from physical media, the following additional authorities are required: a. *USE authority to the physical device is required.
5. If adding an image file from an existing image located in a different directory, the authorities required are the same as those required by the Copy Object (CPY) command.
. Adding from physical CD or DVD media is only supported for optical type image catalogs.
. This command does not support dependent image catalogs.
. The following parameters are only valid for tape type image catalogs:
1. ALCSTG
2. VOLTYP
3. DENSITY
4. NEWOWNID
5. CODE
If any of the above parameters are specified for an optical type image catalog, they will be ignored.



Examples:

Example 1: Adding an Image Catalog Entry from CD/DVD Media

ADDIMGCLGE IMGCLG(MYCLG) FROMDEV(OPT01)

This command adds the optical image in device OPT01 to the image catalog directory and updates catalog MYCLG. The image catalog directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.



Example 2: Adding an Image Catalog Entry from a Directory

ADDIMGCLGE IMGCLG(MYCLG) FROMFILE(¡¯/MyDir/MyFile.img¡¯)

This command adds the image file /MyDir/Myfile.img to the image catalog directory /MyNewDir and updates catalog MYCLG. The image catalog directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.


Example 3: Inserting an Image Catalog Entry

ADDIMGCLGE IMGCLG(MYCLG) FROMDEV(OPT01) REPLACE(*INSERT)

This command adds the optical image in device OPT01 to the image catalog directory and, if a catalog entry exists at the specified index, will insert the entry in the catalog and increment the remaining entries up to the next available index. The image catalog directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.



Example 4: Adding a New Optical Type Image Catalog Entry

ADDIMGCLGE IMGCLG(MYCLG) FROMFILE(*NEW) TOFILE(MYFILE)
IMGSIZ(*CD650)

This command adds new optical image file MYFILE to the image catalog directory with a size of 650 megabytes. The image catalog directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.


Example 5: Adding a New Tape Type Image Catalog Entry

ADDIMGCLGE IMGCLG(TAPECLG) FROMFILE(*NEW) TOFILE(TAP001)
IMGSIZ(*IMGCLGTYPE) ALCSTG(*MIN) VOLNAM(MYVOL)
VOLTYP(*SL) DENSITY(*VRT256K) NEWOWNID(MYNAME)
CODE(*EBCDIC)

This command adds new image file TAP001 with a volume name of MYVOL to the target directory with the default maximum allowed size of 1000 megabytes. Only storage required to create and initialize the virtual volume will be allocated at the time of the create. The target directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.


Example 6: Adding a New Tape Type Image Catalog Entry with Allocation.

ADDIMGCLGE IMGCLG(TAPECLG) FROMFILE(*NEW) TOFILE(TAP002)
IMGSIZ(5000) ALCSTG(*IMGSIZ)

This command adds new image file TAP002 to the target directory with a maximum size of 5000 megabytes. All 5000 megabytes of storage will be allocated for this image file when it is created. The target directory is the directory specified for the Directory (DIR) parameter of the CRTIMGCLG command.


Example 7: Adding an Image Catalog Entry from the Image Catalog Directory

ADDIMGCLGE IMGCLG(MYCLG) FROMFILE(¡¯/MyClgDir/MyFile.img¡¯)
TOFILE(*FROMFILE)

This command updates the image catalog MYCLG with information about image file MyFile.img.