Tuesday, 28 August 2012

Organization of OS/400 Objects

Objects

 

On the AS/400, everything that can be stored or retrieved is stored in an object. Examples of objects are libraries, files, executable programs, queues, and more. Objects share some common attributes such as name, type, size, description, date created, and owner.

 The concept of an object allows the system to perform certain standard operations, such as authorization management, on all objects types. The object types that we will be primarily concerned with in this manual are:
  • *LIB Libraries
  • *FILE Files
  • *PGM Compiled programs
  • *OUTQ Output queues

Libraries

Every object is contained in a library. A library is an object, of type *LIB, that contains a group of objects. It is similar to the "root" or top-level directory on Unix, MS-DOS, and VAX/VMS. However, unlike these systems, a library cannot "contain" other libraries (with the exception of QSYS, the system master library, which "contains" all libraries on the system).

 An interesting implication of the non-hierarchical nature of libraries is that two users cannot have libraries with the same name. There are basically three general categories of libraries:
  1. QSYS - the library that contains all other libraries,
  2. System supplied libraries NOTE:all IBM-supplied library names begin with the letter "Q" or "#"
  3. User-created libraries.

 

Files

 

A file is an object, of type *FILE, that contains data in the 
form of a database, device data, or a group of related records
that are handled as a unit. In this manual, we are primarily concerned with database files. 

There are two types of database files:
  1. physical files
  2. logical files.
A physical file contains actual data stored on the system. 
It has a fixed-length record format. In this manual, we are 
primarily interested in two kinds of physical files:
  1. data physical files
  2. source physical files
A data physical file (*FILE PF-DTA) contains data that cannot be compiled, such as an input file to a program. In conventional terms, a data physical file is a data file, for example an employee master file. A data physical file normally has a record format. 

This record format is defined using Data Description Specifications (DDS is a language that is used to describe database files to the system). This description is then compiled to produce a *FILE object with attribute PF-DTA.

A source physical file (*FILE PF-SRC) contains source statements, for example the source statements of a Pascal or COBOL program. A source physical file has the attribute "PF-SRC". It is usually created using the "Create Source Physical File" (CRTSRCPF) command.
 A source physical file is actually a special type of data physical file. The CRTSRCPF command creates a physical file with attributes appropriate for source physical files. 

Example:

 the default record length is 92 (80 for the source data field, 6 for the sequence number field, and 6 for the date field. Refer to the section on the SEU editor for the meanings of these fields.)


                    Work with Members Using PDM


 File  . . . . . .  SRCFILE___
   Library . . . .     YOURLIB___           Position to . . . . __________
      
 Type options, press Enter.

   2=Edit         3=Copy       4=Delete     5=Display     6=Print
   7=Rename       8=Display description     9=Save       13=Change text ...

 Opt  Member      Type        Text
 __   NAMEEMP     LF          Sample DDS Source for a Logical File
 __   CLPROG      CLP         Sample Control Language Source Program
 __   RPGPROG     RPG         Sample RPG Source Program
 __   EMPMAST     PF          Sample DDS Source for a Physical File
 __   SCRNMBR     DSPF        Sample DDS Source for a Display File



 Parameters or command
 ===> ___________________________________________________________

 F3=Exit          F4=Prompt             F5=Refresh           F6=Create
 F9=Retrieve      F10=Command entry     F23=More options     F24=More keys

Other Object Types

A program object (*PGM) is a compiled program. 

The attribute for a *PGM object indicates the language the program was written in. For instance, when a COBOL source program is compiled, it produces an object with a type of *PGM with the attribute CBL.

An important object type on the AS/400 is the output queue (*OUTQ). On the AS/400, whenever something is printed, the output goes to an output queue and it stays there as a spooled file. 

A spooled files, like a member, is not an object itself but a subset of an object. The spooled file stays in the output queue until it is directed to a printer or removed. An output queue has already been created for you with the creation of your user profile. 

The name of the output queue is normally the same as that of your user profile. Refer to the section "Printing Procedure" in this manual for more information on printing spooled files.

The relationships between the various objects:

 

   QSYS (*LIB)
                           [special library]
                                   |
                                   | contains
                                   |
                             Library (*LIB)

                                   |
                                   | contains
                                   |
           .------------------+----^-----------------.--------.
           |                  |                      |        |
    Programs (*PGM)    Outqueues (*OUTQ)       Files (*FILE) Other
     [Executable]            |                       |       objects
                             | contains              |                         
                        Spooled Files                |
                [Output intended for Printer]        |
                                                     |
                                    .----------------^--.
                                    |                   |
                                 Physical          Data Logical
                                   file               file
                                   (PF)              (LF-DTA)
                                    |                   ^ contains
                             .------^-----.         Member(s)
                             |            |     [Reorginized data]
                          Source        Data
                         Physical      Physical
                           File          File
                         (PF-SRC)      (PF-DTA)
                             |            |
                    contains |            | contains
                             |            |
                         Member(s)      Member(s)
                    [Program source]  [Actual Data]
 

 

 

No comments:

Post a Comment