Showing posts with label AS400. Show all posts
Showing posts with label AS400. 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