HCL Technologies Ltd.
An Introduction to the AS/400 / iSeries / i5 Mid-Range System (Part 2)
Joy Patnaik
Agenda
Commonly Used Terms
Commonly Used Terms - 1
System
The AS/400 is the system The system is downorThe system is slow today
OS/400
AS/400s Object-Based Operating System Controls all the activity on the AS/400 Incorporates many features that would be separate software components on other systems (ex. Database)
IPL
Initial Program Loading (Programs executed during Boot-sequence)
Commonly Used Terms - 2
Licensed Internal Code (LIC)
Work Management
Provides the hardware interface
Any changes to the hardware invite corresponding changes to the LIC. However, the application programs need not undergo any changes, thereby reducing maintenance costs.
Users never interact directly with the LIC, and it cannot be tampered by programmers or system operators.
Programming Languages
Pascal, PL/1, Basic, RPG, C, C++, Cobol, Java, SQL, etc.
Commonly Used Terms - 3
System Values
Control and Configuration attributes that allow you to customize the operating environment to suit the company. These values define what the default values will be. You cant change them, but you can look at them. Examples : QDATE, QTIME Commands : DSPSYSVAL
User
A person who uses the AS/400 A User-Id identifies you to the system when you sign-on User Class : *USER, *SYSOPR, *PGMR, *SECADM, *SECOFR Each User-Id has a User Profile which describes the user and their authorities Commands : CRTUSRPRF, DSPUSRPRF, etc
Commonly Used Terms - 4
Library
Library is a container of Objects but cannot contain other Libraries
Exception : QSYS library contains other libraries
Commands : CRTLIB
File
Contained in a Library Data Container that can contain either
Application Data Application program source code
Member
One File can be made up of one or more members Can be data or program source
Commonly Used Terms - 5
Library List
List of commonly-used libraries (Short notation *LIBL) Similar to PATH in Windows systems
Messages
Message Queues
Work Station Queue User Message Queue
Message Types
Information : *INFO Inquiry : *INQ
Commands :
SNDMSG - Sends Messages to user message queue. SNDBRKMSG - Send Messages to work station.
Important Libraries
IBM-Supplied Libraries - 1
QSYS:
Most important library on the AS/400. Contains OS/400, and master directory of all libraries. Dont delete or rename. Need to operate the system. Some objects MUST be in QSYS.
User Profiles Device descriptions Authorization lists Library object descriptions
QUSRSYS:
Place user objects, considered more or less system objects. Typically message queues for user profiles.
IBM-Supplied Libraries - 2
QHLPSYS: QGPL:
All help information Search Index Objects General Purpose Library. Contains objects used by the system or users. Contains job queues, subsystem descriptions, source physical files and output queues. Dont store unnecessary objects in QGPL Do not delete or rename this library.
IBM-Supplied Libraries - 3
QSPL:
Spooling library. Contains several databases files in spooling system. Used to store reports and printed output waiting to print. Folders and documents created and maintained in library QDOC. Use Save Document Library Objects (SAVDLO) and Restore Document Library Objects (RSTDLO).
QDOC:
IBM-Supplied Libraries - 4
QTEMP:
Created for every active job automatically. Lasts only for the duration of the job. Functions as a scratch pad, for temporary objects.
Working With Libraries
Creating a Library
Create Library (CRTLIB)
Type choices, press Enter.
Library . . . . . . . . . . . . Library type . . . . . . . . . . Text 'description' . . . . . . . Name *PROD, *TEST
*PROD *BLANK
Additional Parameters
Authority . . . . . . Auxiliary storage pool Create authority . . . Create object auditing . . ID . . . . . . . . . . . . *LIBCRTAUT 1 *SYSVAL *SYSVAL Name, *LIBCRTAUT, *CHANGE... 1-16 Name, *SYSVAL, *CHANGE... Character value, *SYSVAL...
F3=Exit F4=Prompt F24=More keys
F5=Refresh
F12=Cancel
Bottom F13=How to use this display
Working with Libraries
Work with Libraries (WRKLIB)
Type choices, press Enter.
Library . . . . . . . . . . . . *LIBL Name, generic*, *LIBL...
F3=Exit F4=Prompt F24=More keys
F5=Refresh
F12=Cancel
Bottom F13=How to use this display
Using Library, File and Member
Usage of Library
How the AS/400 finds Objects
When an object is created, it is created in a particular library. To access an object, the AS/400 needs to know what library the object is in. The library is really a directory which contains pointers to the objects in that library.
Library List - 1
What is a Library List
List of commonly-used libraries (Short notation *LIBL)
OS/400 searches for the objects required for executing any program or command in the LIBL that is enforced at the time of running the program or command
Similar to PATH in Windows systems 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 251 names. Scanned from top to bottom.
Four library list types
System (SYS), Product (PRD), Current (CUR), User (USR)
Library List - 2
Library List Sections
Portion Values/Command Contents
System Library
Product Library Current Library User Library
QSYSLIBL
Optional CHGCURLIB QUSRLIBL
QSYS 1-15 libraries
From User Profile QTEMP 1-25 Libraries
Library List - 2
Usage of LIBL
Library List is a convenience only
you can always access a library not on the list! (as long as your user profile has proper authority to the library)
We could have a program object named PROGA in two different libraries!
Qualified Object Name: Library/Object (ex. CMOPS324/REVIEWS) Library Descriptions, Device Descriptions and User Profiles are stored in library QSYS. This means that you do not have to specify a library name when you access these objects.
Library List - 3
Each job has an attached Library List
Different Types of Libraries:
System: Product: Current: User: IBM Supplied Added automatically when an IBM product is used Defined by an individual user ID
User IDs default Library Dont rename or delete your current Library!
Non-IBM Supplied Libraries Created by Business to organize programs, files, etc.
Library List Commands - 1
ADDLIBLE Adds an entry to a library list to the USER portion of the library list RMVLIBLE Removes an entry from the USER portion of the library list EDTLIBL Adds/Deletes/Changes entries on the USER portion of the library list
Library List Commands - 2
CHGCURLIB Changes the Current Library CHGLIBL Changes the Current Library and allows Add/Change/Delete to the USER portion of the library list.
All Library List commands are listed on the CMDLIBL menu.
Library List contd
Files
objects that store data
ie.
customer file: customer #, address, billing info etc. for each customer
source file
special
file that stores a programmers source code
eg. Judy stores all her source code in source file Judysrc (in library Judylib)
File Member
Source
one
files have many members
member for each source program eg. Judysrc file has 3 members: RPGPGM1, RPGPGM2, CLPROG, each contains a different program
PDM
gives
(Prog Dev Mgr)
easy access to a programmers stuff (libs/files/mbrs)
Database Files
Types of *FILES
Physical File PF (Source and Data) Logical File LF Printer File PRTF Display File DSPF
Data stored as
EBCDIC - Extended Binary Coded Decimal Interchange Code
Source Physical File vs Data Physical File
Source Physical File
Layout is fixed: 3 fields
programmers can only alter the length of the text field
Used to store code
Data Physical File
Layout is determined by Application Design Used to store data
What is Work Management ?
Important building block of OS/400
Work enters the system Gets Processed Gets completed
Supports commands and internal system functions
Work Management - 1
Job
A job is any and every piece of work on the AS/400 Commands : DSPJOB
Interactive Jobs
A job that begins when a user signs on to the system and ends when they sign off. It is a job with interaction between the user and the AS/400, similar to a conversation ( a polite conversation!). Input for the job is entered via the screen.
Batch Jobs
A job that runs in the background. They do not require input from the screen, but would read data from files. They are generally jobs that use a lot of resources and are lower priority than interactive jobs. Usually submitted by interactive jobs e.g. a program compile
Work Management - 2
Subsystem
Jobs run in subsystems. An pre-defined operating environment in which system resources (eg. main storage) are divided up and allocated for the work to be done Described in subsystem descriptions. Most subsystems are started at IPL (Initial Program Load) time.
IPL can be equated to the processes that get executed when a PC boots up.
Subsystems (Examples)
Interactive jobs run in subsystem QINTER Batch jobs run in subsystem QBATCH
Commands : DSPSBSD <QBATCH>
Work Management - 3
Queue
A queue is a line-up! A place where things wait. Examples of AS/400 queues:
job queues: where batch jobs wait message queues: where messages wait output queues: where spool files wait to print
Work Management - 4
Job Description
Defines the attributes of the job Important parameters
Job queue Output Queue Initial Library list Job Priority QDFTJOBD ( Default Job description)
Most Often-used Work Management Concepts and Tasks
A Jobs Life - 1
Submit a job
On submitting a job to an iSeries server, it (the job) is created and enters the system. At this time, the properties of a job are given to the job. Once the properties have been defined, the job moves to the job queue where it waits to enter the subsystem. The job description holds properties the job will use to go through the work management life-cycle. These properties include the user profile the job will start to run under, the request data (which tells the job what it will do), and the initial user portion of the library list, as well as others.
A Jobs Life - 2
Job enters a job queue
Job queues are work entry points for batch jobs to enter the system. They can be thought of as "waiting rooms" for the subsystem. A number of factors affect when the job is pulled off the job queue into the subsystem, like job priority on the job queue, the sequence number of the job queue, and the maximum active jobs. When all of these factors work together, the job will be pulled off the job queue to start running in the subsystem.
A Jobs Life - 3
Job enters the subsystem
When the job enters the subsystem it becomes active.
Until a job gets its activity level and memory from a memory pool, it cannot run.
The job uses several pieces of information before it can receive memory to run.
The subsystem description, like the job description, carries information, such as the memory pool to use, the routing entry, the maximum active jobs, and the number of active jobs currently in the subsystem.
A Jobs Life - 4
Memory pool allocates memory to the subsystem
Memory is a resource from the memory pool that the subsystem uses to run the job.
The amount of memory from a memory pool, as well as how many other jobs are competing for memory affect how efficiently a job runs.
The subsystem gives the memory pool the information it needs to process the order in which jobs are allocated memory, and the memory pool allocates memory for the job to run to completion.
Subsystems use different memory pools to support different types of jobs that run within them.
A Jobs Life - 5
Job finishes
Spooled File - 1
What is a Spooled File ?
When you print something, a spool file is created with the data to be printed and stored in an Output Queue WRKSPLF shows your spooled files (WRKSPLF groups all of YOUR spooled files together on one screen regardless of the Output Queue)
What is an Output Queue (OUTQ) ?
Output Queue is a queue of all spooled files awaiting printing. (WRKOUTQ groups together all of the spooled file in ONE output queue regardless of the USER) To print a Spooled File, the file must be moved to an Output Queue attached to a printer.
Spooled File - 2
What is a Printer Writer ?
Printer Writer is a job that monitors a specified output queue When a spooled file entry is placed in an output queue, the printer writer will direct the spooled file to printer device.
Commands
DSPSPLF WRKOUTQ , CRTOUTQ WRKWTR, STRPRTWTR, ENDWTR
How Do Spooled Files get Created?
QINTER Job
Program/ Command
Output Queue Spooled File
Data
Report Layout *FILE
*FILE
How Do Spooled Files get Printed?
DC234X99 SPLF#1 SPLF#2
WRKSPLF option 2. Change the Spooled File to OutQ PRT01
PRT01 SPLF#3 SPLF#4
Working with Jobs - 1
How to get info about Jobs
WRKJOB :
Display information about your current Interactive job Display information about any other job, by entering Job Name and User (Job Number is Optional) To display your Batch Jobs, use the Work with Submitted Jobs Commands Shows you a list of all of the jobs that you own on the system regardless of the subsystem
WRKSBMJOB :
WRKUSRJOB :
Working with Jobs - 2
Job Status
Active = Job is currently running Outq = Job is finished Jobq = Job is waiting to process.
Work Management Summary
Not every job follows this exact path; however, you can better understand how other work is completed on the system by the below-mentioned flow :
The life of a simple batch job begins when you submit it to the system. The job is then sent to a job queue where it waits to enter a subsystem where it can run. Once the job moves to the subsystem it is allocated memory in which to run. When the job is complete, it is sent to a printer output queue to await further instruction on what to do (for example, printing).
Summary
The AS/400 is easy to use
Menu driven Lots of built-in help Built-in security