Friday, February 6, 2015

Fill an IBM i image catalog with images with one API call

Image catalogs make the installation of new operating system releases or PTF's very easy. You do not need to change many CD's and if you want to install the update remote, image catalogs are the only possible solution. But in V7R1 there is no command to add a whole directory filled with images to an image catalog. You have to add every image with "ADDIMGCLGE"  which can be a very boring task, if you have many images to add.

Fortunately there is a system API which allows you to add all images at once. Folow this easy steps to create your image catalog with this API:



Upload the images either with FTP, Netserver or download them with "SNDPTFORD" to an IFS directory.

Work with IFS Object Links

Create your image catalog with "CRTIMGCLG". Set the parameters "Create directory" to "*No" and the "Directory" to the directory which contains the uploaded images.

Create Image Catalog IBM i

Call the API "QVOIFIMG" with your image catalog name as the first parameter and '*ALL' as the second one. The third parameter is empty, because it is only a placeholder where the API will store a possible error message. This error message can only be used when you call the API from a CL PGM.

Work with Object Links IBM i

If everything works you will see some progress messages.

Adding images to IBM i image catalog

After all images are added to yout catalog you can associate your image catalog with your virtual optical device with "LODIMGCLG" Fill in the correct name of the catalog and your virtual device. If you do not have an virtual optical device you can create one with "CRTDEVOPT"

Load IBM i Image Catalog

It is strongly recommended to verify and sort your image catalog with "VFYIMGCLG" before you use it to upgrade your system, or install PTF's from it. Please choose the correct Verify type whether you want to do an upgrade or a PTF install.

Verify IBM i Image Catalog

After that your image catalog is ready to make an upgrade, or a PTF install.

If you like this tutorial, please share it on your favorite social network.

1 comment:

  1. 27 files added with one command, thanks for the tips Ralf.

    ReplyDelete

ad