1. Chapter 4 Objects, Libraries, and Library Lists 2. What Is an Object? * An object is anything that exists, occupies storage, and on which operations (commands) can be performed. 3. Object Structure ____________________________________ | Object name, type, owner, library, | Object | etc. | Header | | Portion |____________________________________| | This could be a files data, | Function | program statements, etc. | Portion of | | Object |____________________________________| Figure 4-1: Object Structure 4. WRKOBJ Command * Figure 4-3 5. Object Attributes * Name * Library * Type * Attributes * Owner name * Creation date * Creation time * Save date * Save time * Off-line size * Text description * Change Date 6. EMPPAYLIB Library Contents _______________________________________________ | EMPMST (*pgm) EMPMST(*file) | | | | | | EMPPGM1 (*pgm) QDDSSRC(*file) | | | | | | EMPPGM2 (*pgm) QCBLSRC (*file) | | | | | |_______________________________________________| 7. Objects in EMPPAYLIB _______________________________________________________________________ | Object Type |Object Name | | |_____________|______________|__________________________________________| |*Pgm EMPMST | The same name can be used for different | | | object types. The AS/400 determines which| |*File EMPMST | operations can be performed on the object| | | based on its type. | |____________________________|__________________________________________| |*Pgm EMP P GM1 | All objects of the same type must have | | | different names. | |*Pgm EMP P GM2 | | |____________________________|__________________________________________| |*Pgm UPDPROG | These two objects cannot have the same | | (RPG IV) | name because they are the same object | | | types. AS/400 does not distinguish | |*Pgm (CL) UPDPROG | between sub-object types. | |____________________________|__________________________________________| 8. Library Contents * Diagram of library OPR006 library containing: Source *FILE PF-SRC, PGM1 *PGM CLP, Payroll *PGM RPG, EMPMST *FILE PF-DTA Source contains source member PGM1, Payroll, and EMPMST 9. Object Attributes *File ________________________________|_______________________________ | | | | | | | | | | | | | | | V V V V V Physical Logical Display Printer ICF ____|_______ _____|_________ | | | | | | | | V V V V Source Data Screen Menu ^ ^ | | |___________| | Members 10. Object Definition ________________ _________________ | | | | | | | | | | | | | | | | | | | | | Source |-------------->| Object | | Code | | Code | | | | | | | CRTPF | | | | CRTLF | | | | CRTRPGPGM | | | | Etc. | | |_______________| |_______________| 11. Compile Commands ________________________________________________ | Object Type | Command | |-----------------------|-----------------------| |Physical File | CRTPF | |Logical File | CRTLF | |RPG Program (notILE) | CRTRPGPGM | |CLP Program | CRTCLP | |Display file | CRTDSPF | |ILE RPG Program | CRTBNDRPG | |Program | CRTPGM | |_______________________|_______________________| 12. Example Object Types ________________________________________ |(*AUTL) |Authorization List | |(*CLS) |Class | |(*CMD) |Command | |(*CTLD) |COntroller Description | |(*DEVD) |Device Description | |(*DOC) |Document | |(*DTAARA) |Data Area | |(*DTAQ) |Data Queue | |_______________|_______________________| 13. Example Object Types _______________________________________________ |(*FILE) |FILE | |(*FLR) |Folder | |(*JOBD) |Job Description | |(*JOBQ) |Job Queue | |(*JRN & *JRNRCV)|Journal and Journal Receiver | |(*LIB) |Library | |(*LIND) |Line Description | |(*MENU) |Menu | |________________|______________________________| 14. Example Object Types ________________________________________________________ |(*MSGF) |Message File | |(*MSGQ) |Message Queue | |*MODULE |Module(*Module) | |(*OUTQ) |Output Queue | |(*PGM) |Program | |(*PNLGRP) |Panel Group | |(*SBSD) |Subsystem Description | |(*SRVPGM) |Service Program | |(*USRPRF) |User Profile | |_______________________|_______________________________| 15. Functions Performed on Objects * System Functions * Object type verification: * Object authority verification: * Object lock enforcement: * Object damage detection and notification: 16. User Requested Functions on Objects * Specific Functions * Common Functions Apply to All Objects in General 17. Managing Objects – Operational Assistant (OA) * Figure 4-5 18. Libraries * The basic building block of your work on the AS/400 will be the library. A library, which is itself an object, is a container for objects. 19. PAYLIB Directory Structure ________________________________________________ |Object Name |Object Type |Object Address | |_______________|_______________|_______________| |Payroll |*PGM |Address | |Paym str |*FILE |Address | |Paytrans |*FILE |Address | |Payoutq |*OUTQ |Address | |_______________|_______________|_______________| 20. File Allocation Table (FAT) _______________________________________________ | Address | Allocation | |_______________________|_______________________| | Address 1 | Allocated | | Address 2 | Free | | Address 3 | Free | | Address 4 | Allocated | | Address 5 | Allocated | |_______________________|_______________________| 21. IBM Supplied Libraries _____________________________________________________________ |QSYS: |* Most important library on the AS/400. | | |* Contains OS/400, and master directory of | | | all libraries. | | |* Don't delete or rename. | | |* Need to operate the system. | | |* Some objects MUST be in QSYS. | | | * User Profiles | | | * Device description | | | * Authorization lists | | | * Library object descriptions | |_______________|_____________________________________________| |QUSRSYS: |* Place user objects, considered more less | | | "system" objects. | | |* Typically message queues for user profiles.| |_______________|_____________________________________________| 22. IBM Supplied Libraries – Cont. ________________________________________________________________ |QHLPSYS: | * All help informaiton | | | * Search Index Objects | |_______________|_______________________________________________| |QGPL: | * General Purpose Library. | | | * Contains objects used by the system or | | | users. | | | * Contains job queues, subsystem descriptions,| | | source physical files and output queues. | | | * Don't store unneccessary objects in QGPL | | | * Do not delete or rename this library. | |_______________|_______________________________________________| 23. IBM Supplied Libraries – Cont. ________________________________________________________________ |QSPL: | * Spooling library. | | | * Contains several databases files in spooling | | | * Used to stored reports and printed output | | | waiting to print. | |_______________|________________________________________________| |QDOC: | * Folders and documents created and maintained | | | in library QDOC. | | | * Use Save Document Library Objects | | | (SAVDLO) and Restore Document Library | | | objects (RSTDLO). | |_______________|________________________________________________| 24. IBM Supplied Libraries – Cont. __________________________________________________________________ | QTEMP: | * Created for every active object automatically. | | | * Lasts only for the duration of the job. | | | * Functions as a "scratch pad", for temporary | | | objects. | |_______________|__________________________________________________| 25. Product Libraries * IBM licensed program products are self-contained software packages. Each comes in a separate library (a product library). 26. Creating a Library * Figure 4-7 27. Working With Libraries * Figure 4-8 28. All User Libraries screen * Figure 4-9 29. Objects in a Library * Figure 4-10 30. Library List * List of system, product, and user libraries. * Library list give the default list of libraries to be searched for an object. * Every job has a library list. * Library list has a maximum of 40 names. * Scanned from top to bottom. 31. Library List Sections ____________________ | Portion | Values/Command Contents |____________________|__________________________________________ | System Library | QSYSLIBL QSYS | | 1-15 libraries |____________________| | Product | Optional | Library | |____________________| | Current | CHGCURLIB From User | Library | Profile |____________________| | User | QUSRLIBL QTEMP | Library | 1-25 Libraries |____________________| 32. Commands for Library List * Commands that affect user portion of library list * ADDLIBLE * RMVLIBLE * EDTLIBLE 33. Display a Library List * Figure 4-11