Site icon AS400 ISeries

AS/400 Objects and Libraries

Everything is an Object

On many computing platforms everything is a file, but in contrast on the AS/400 everything is an object.

AS/400 objects share similarities with objects in object-oriented programming, but there are differences as well. There are similarities in that when storage is allocated for something, that something is of a specific type, and only a specific set of programs are allowed to act upon that object. There are differences in that even though the AS/400 supports Java and C++, AS/400 objects cannot be inherited like the classes in those languages. Another difference is that the set of object types in OS/400 (the AS/400’s operating system) is fixed by IBM, and only IBM has the ability to create new ones.

Advertisements
Ownership of Objects

Each object is assigned an owner when it is created. The owner is either the user or the group profile that created the object. When the object is created, the owner is given all the object and data authorities to that object. If ownership of the object is given to another user profile, the original owner has the option to keep all the object and data authorities the same, or to remove all authority to the object. If the creating user has specified that the group profile should be the owner of the object, then all members of the group profile have authority to the object. If the owner of an object is a group profile, then any user assigned to the group may add, modify, or delete records in the object, assuming all data authorities are provided. This feature is helpful when data sharing is necessary.

Object Types

The number of object types is huge and a small subset of them are available to users. The human readable form of the object type is always a three to six character mnemonic preceded by an asterisk. What follows is a short list of the more commonly used objects and their mnemonics:

Advertisements
Library

A library (*LIB) on the AS/400 is an object that is used as a system directory to keep track of other objects. AS/400 objects are not actually stored in libraries. They’re really nothing more than namespaces, but it’s easier to refer to an object as being “in” or “stored in” a library.

Certain types of the AS/400 object (database file, storage areas and executable program objects) can be compiled, copied, and stored into/from many different libraries concurrently, with the Library List hierarchy determining which instance of the object to use during execution of any application that utilizes that object name. There are AS/400 commands to help move objects around, and objects may be qualified at compile time to point to specific other objects statically at runtime, in order to circumvent the Library List.

Libraries cannot contain other libraries

The AS/400 uses a library in much the same way that personal computers use directories. Libraries and directories are holding areas for related material. For example, one library might be dedicated to payroll programs, another to inventory control. Libraries generally contain many other objects. Unlike directories, however, libraries cannot contain other libraries (with one exception library QSYS, discussed below). AS/400 is structured as a list, the opposite of Windows which has a tree-like structure. To find an AS/400 object requires the name of the library and the name of the object. The AS/400 identifies objects by their qualified name, which takes the form LIBRARY/OBJECT. For example, to reference the EMPMASTER file in the PAYROLL library, you’d usually refer to PAYROLL/EMPMASTER.

System Library

Other types of objects, designated as “system” objects cannot be replicated. Libraries are a “system” object, and therefore only one instance of any given Library “name” is possible. They’re made to appear as if they’re stored in the QSYS library. Other “system” objects include user profiles (*USRPRF), configuration objects (*LIND, *CTLD, *DEVD), etc..

Shop Standards

On systems with hierarchical filing systems the norm is to have many directories, most of which are contained one within the other, and with a moderate number of files in each directory. Since libraries cannot be stored within other libraries on the AS/400 and because historically the library list was always so small, the opposite became the norm; small numbers of libraries each of which contain large numbers of objects. A library is similar to a folder in Windows. In AS/400 a library is another object that can contain other objects (executable objects, source files, etc.).

Most homegrown applications have between one and three libraries. Some have program, source, and file objects together in one library. With shops that have a huge amount of data and a small backup window they usually split the database files into a separate data library and keep the source and programs in another library. In companies with a separate development systems they tend to split it further by placing the source into its own library.

Generally speaking all libraries created by IBM for use by the operating system begin with the letter ‘Q’.

IBM Standard Libraries:

User Libraries

In most installations, the system administrator creates user libraries. User libraries are commonly created to hold one individuals work; for example, each programmer should have his or her own user library. The administrator can create as many user libraries as are convenient; the only limit is the amount of disk space available in DASD.

Exit mobile version