CL Command Reference - PKGINSOBJ
CL Command List > PKGINSOBJ Reference
Description:
The Package Installable Object (PKGINSOBJ) command saves a copy of one or more objects of any file system and the associated name of the target library, folder or path where they must be created into an installable object. It also creates a distribution catalog entry and loads the installable object that contains the saved objects into the distribution repository.
Restrictions:
1. The GLBNAME consists of up to 9 tokens with the following format:
. At least 3 tokens should be specified.
. Only 1 token should contain the REF value and must be any token from the second to the eighth.
. A refresh level token must follow the REF token. This token must contain only characters from 0-9 and it must be the last token in the global name.
. The token values MEM, LIB, OBJ, UPD, FIX, or CVRLTR cannot be specified.
2. An installable object that is packaged with objects from the QSYS.LIB file system cannot contain objects from any other file system.
3. An installable object that is packaged with objects from the QDLS file system cannot contain objects from any other file system.
4. This command is shipped with public *EXCLUDE authority
5. The user to run this command must have the authority necessary to perform the SAVxxx commands over the object to be packaged, to the ADDDSTCLGE command, the Delete File (DLTF) command, Create Save File (CRTSAVF) command, and their required authorities.
6. At least one *INCLUDE value must be specified in the OBJ parameter
Examples:
Example 1: Packaging All Objects in Current Directory and Subdirectories
PKGINSOBJ GLBNAME(PACKAGE CURRENT DIRECTORY REF 001)
OBJ((¡¯*¡¯ *INCLUDE *SAME))
SUBTREE(*ALL) TGTRLS(*CURRENT) AUTL(QCQRPSAUTL)
This command packages all the objects in the current directory and its subdirectories. When installed, the packaged objects are created in the current directory of the user under which the install request runs. The default OBJ value can be used. The current directory is resolved during the packaging.
Example 2: Packaging All Objects in Current Directory
PKGINSOBJ GLBNAME(PACKAGE CURRENT DIRECTORY NO SUBDIR REF 002)
OBJ((¡¯*¡¯ *INCLUDE *SAME)) SUBTREE(*OBJ)
TGTRLS(*CURRENT) AUTL(QCQRPSAUTL)
This command packages all the objects in the current directory but not in the subdirectories. The current directory is resolved during the packaging. The objects are installed in the directory specified in the path name that must already exist in the managed system at the time of the installing.
Example 3: Packaging All Objects in Specified Directory
PKGINSOBJ GLBNAME(PACKAGE A DIRECTORY OMITTING REF 001)
OBJ((¡¯/A¡¯ *INCLUDE *SAME)) (¡¯/A/B/C¡¯ *OMIT))
SUBTREE(*ALL) TGTRLS(*CURRENT) AUTL(QCQRPSAUTL)
This command packages all the objects in directory /A and its subdirectories, except those in directory /A/B/C. If the directory does not already exist, when the objects are installed, the directory /A is created including its subdirectories and their objects.
Example 4: Packaging All Files
PKGINSOBJ GLBNAME(PACKAGE ALL FILES IN MYLIB REF 003)
OBJ((¡¯/QSYS.LIB/MYLIB.LIB/*.FILE¡¯ *INCLUDE *SAME))
SUBTREE(*ALL) TGTRLS(*CURRENT) AUTL(QCQRPSAUTL)
This command packages all files in MYLIB. When it is installed, the library MYLIB is created, including its objects.
Example 5: Packaging Object in One Library and Installing Object in Another Library
PKGINSOBJ GLBNAME(RENAMING OBJECTS WHEN INSTALLING REF 001)
OBJ((¡¯MyDir/X.PGM¡¯ *INCLUDE ¡¯YourDir/Y.PGM¡¯))
SUBTREE(*ALL) TGTRLS(*PRV) AUTL(QCQRPSAUTL)
This command packages program X from MyDir and installs the object in YourDir with Y name. The system where it will be installed is in the previous release.