Showing posts with label Library. Show all posts
Showing posts with label Library. Show all posts

Friday, April 18, 2014

Library, Source Physical File, Member, Record and Record Format



It is very important to understand the above jargons. All terms are related to each other in a following hierarchy.



Record & Record Format:
          The data in a file is called Record. it should be in some specific format and that format is called Record Format.

For example: On a page of paper, you have following data.



All the above detail/ data on the page is record.

Whole page is written in a pre-defined rules and that rules are specified in a template or format as mention below.

Example of Record Format.



If I want to code the above format as PF then I may code as following:

R       PFLETTERR                                       
                    SALUTATION      15A             TEXT('SALUTATION')    
                    BLNK_LINE1       80A             TEXT('BLANK LINE 1')  
                    DETAILS             500A           TEXT('DETAILS')       
                    BLNK_LINE2       80A             TEXT('BLANK LINE2')    
                    THANKS             15A             TEXT('THANKING YOU')  
                    BLNK_LINE3       80A             TEXT('BLANK LINE3')   
                    REGRADS          15A             TEXT('YOURS SINCERELY')
                    NAME                  30A             TEXT('NAME')          


Now a proper Example of Record Format & Records

Record Format – PF1R



PF1



In PF1R image:


  • it is restricted that each record (that means each line of data) will have only two columns.
  • It is restricting or telling us that any data (even blanks) in the 1st col: will be consider as CUSTOMER ID and anything in 2nd col: will be COUSTOMER NAME

In PF1 image:


  • PF1 has 3 lines of data that means it has 3 Records
  • It is a two column PF just as described by its format (PF1R).
  • First col: has ID and 2nd col: has Name.

Member:

          Member is the collection of record(s). it contains line of data in a proper
In the above PF1 example.
  • ·        PF1 is a Member
  • ·        It has 3 Records
  • ·        Record Format PF1R is for all the records in the Member PF


Source Physical File:
            Source physical file is a file which contains the sources of different types of objects. 
  • ·         It is the collection of file member(s).
  • ·         There can be up to 32767 members
  • ·        Used CRTSRCPF command to create library

·          

Library:
Library is a collection of files. Read more about Library (Here) 
  • ·        Used CRTLIB command to create library


Saturday, January 18, 2014

AS/400 Library

A library (*LIB) on the AS/400 is an object that is used as a system directory to keep track of other objects. 
OR
In AS/400 a library is an object that can contain other objects (executable objects, source files, etc.).
Library is used to find other OS/400 objects in the database. To find an OS/400 object you need the name of the library and the name of the object.  

The AS/400 identifies objects by their qualified name, which takes the form of LIBRARY/OBJECT.  

Some important Points:

  • The AS/400 library is organized as a single-level hierarchy.
  • An object can exist in only one library.
  • Two or more objects can have the same name but they must be different types of objects.
  • A library cannot reference other libraries except for the library called QSYS. This is the only library that can access other libraries.

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. 

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

Some IBM Standard Libraries:

QSYS -          System Parent Library
QSYS2 -        System Library for CPI's
QHLPSYS -  Online Documentation Library for Users
QTCP -          TCP Connectivity Utilities
QAFP -          Advanced Function Printing
QGPL -         General Purpose Library
QTEMP -      Job specific temporary Library (deleted when the job ends)


References:

  • http://en.wikipedia.org/wiki/AS/400_library
  • http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frbam6%2Frbam6objects.htm