幻灯片 1

Application Development on Power System (IBM i)
Application Development on Power System (IBM i)
School of Software Engineering Tongji University
HUANGJie
Syllabus
No
Subject
Hours
Abstract
Instructor
Server, Power System and Power System IBM i
Huangjie
iOS fundamental
2
4
i OS & Basic Operation
Huangjie
3
File system & object management
4
Object management concept and integrated file system
Huangjie
4
Message management
2
Message & Its management
Huangjie
5
Work management
4
Concepts of job, subsystem and library, job routing
Huangjie
6
Administration ABC
2
Security, Storage & Restore Management
Huangjie
7
Application Development
6
ILE development enviroment , RPG programming
Huangjie
8
Database Development
4
Database on IBM i
Huangjie
9
IBM i & SOA
2
SOA approach on IBM i
Huangjie
10
Case Study
2
Csae Study
Huangjie
11
Examination
2
Examination
1
Overview of IBM i
2
Huangjie
Unit 1 Power System Foundation
Chapter 5
Work Management
Outline
• Agenda:
–
–
–
–
–
–
–
Work management concept and structure
Subsystem
Job
Major subsystem and job commands
Job description
Exercise/Practice
Question & Answer
Work management - TIMI
Applications
Direct access to hardware
is not allowed!
OS/400*
OS
SLIC
Kernel
Hardware
Machine Interface (MI)
- or Technology Independent Machine Interface (TIMI)
- logical not physical interface
System License Internal Code (SLIC)
- insulate applications from underlying hardware
- SLIC is hardware dependent!
* called i5/OS on i5 systems
2015/10/1
5
Work management - OS Functional Split
Work
management
Device
support
OS/400
Machine
Security Database
Interface
SLIC
Hardware
2015/10/1
6
Work Management Concept
• Work management is the core of the operation system. It
provides functions necessary to control system operation and
job processing on the system.
• A Job is a set of tasks performed on a computer system. With
a job, any number of functions can be performed.
• Jobs may be requested by a single control language command,
a series of CL commands, a single program (i.e., a CL program
or a high-level language program such as an RPG program), or
a series of programs.
• Work management controls batch jobs, interactive jobs and
spooled jobs.
2015/10/1
7
Work Management Structure
• IBM i work management has three major levels in its structure.
– System
– Subsystem
– Job entries
• System
– IBM i system as a whole is defined by system values and network
attributes. Both of which must be configured and established when
the system is first set up.
– Examples of system values are system time, date, the maximum
number of activity levels of the system.
– Examples of network attributes are system name, local network ID,
and network server name.
2015/10/1
8
Work Management Structure (Continued)
• Both system values and network attributes can be retrieved
and changed by CL commands.
• Command examples for system values:
– Retrieve system values command: RTVSYSVAL – Retrieve System Value
• RTVSYSVAL SYSVAL (system-value-name) RTNVAR (CL-variable-name)
– Change system value command: CHGSYSVAL – Change system value
• CHGSYSVAL SYSVAL (system-value-name) VALUE (new-value)
• Command examples for network attributes:
– RTVNETA – Retrieve Network Attributes
• RTVNETA SYSNAME (CL-variable-name) LCLNETID(CL-variable-name) +
NETSERVER (CL-variable-name)
– CHGNETA – Change Network Attributes
2015/10/1
• CHGNETA SYSNAME (system-name) LCLNETID (local-network-ID) +
NETSERVER (network-ID)
9
术语_选自《计算机操作系统教程[张尧学 著]》
• JOB(作业):
– 在一次应用业务处理过程中,从输入开始到输出结束,用户要求计算机
所做的有关该次业务处理的全部工作。
– 作业由不同的顺序相连的作业步组成。
– 作业步是在一个作业的处理过程中计算机所做的相对独立的工作。
• JOB(作业): 比程序更广的概念
– 作业由程序、数据和作业说明书组成。
– 系统通过作业说明书控制程序和数据,使之执行和操作。
• Process(进程):
– 并发执行的程序在执行过程中分配和管理资源的基本单位。
• Thread(线程):
– 是进程的一部分,没有自己的地址空间,它和进程内的其他线程一起共
享分配给该进程的所有资源。
– 使用线程的好处是:在有多个任务需要处理时,减少处理机的切换时间,
且线程的创建和结束所需要的系统开销比进程的创建和结束开销少得多。
2015/10/1
10
Work management objects
OS/400
SYSTEM
VALUES
NETWORK
ATTRIBUTES
Job
MI
Thread
Process
2015/10/1
SUBSYSTEM
SBSD
JOB
THREAD
WORK
ENTRIES
JOBD
ROUTING
ENTRIES
CLASS
POOLS
PROGRAM
11
Interactive Job Routing - Operator‘s View
Main Storage
7
CLASS
Priority
Initial Program
PROG1
6
4
PROFILE
Job Description
QCMD
1
5
SBSD
Routing
2015/10/1
3
SBS
Monitor
OS/400
2
JOBD
Job
Description
Routing
12
Outline
• Agenda:
–
–
–
–
–
–
–
Work management concept and structure
Subsystem
Job
Major subsystem and job commands
Job description
Exercise/Practice
Question & Answer
Subsystem
• Subsystem
– Subsystems contain job entries where jobs are placed and processed.
– Subsystems include IBM-supplied subsystems and user-created subsystems.
– IBM-supplied subsystems include the QBASE, QCTL, QBATCH, QINTER,
QSPL, and QCMN.
– QBASE
• QBASE is the default subsystem that allows users to run all jobs when the
system is first installed.
• The QBASE subsystem should be regarded only as a transitory subsystem
because it is very inefficient to run all jobs in just one subsystem.
• As soon as the system is established up and running, you should use the
CHGSYSVAL command to change the subsystems that run your jobs.
2015/10/1
14
Subsystem (2)
• Subsystem
– QCTL
• The subsystem that starts and ends other subsystems such as QBATCH, QINTER, QSPL
and QCMN. QCTL also controls the functions of other subsystems.
– QBATCH
• The subsystem contains job queues that allows batch jobs to be submitted and run.
QBATCH arranges and manages the batch entries, job priorities, and running of active
jobs.
– QINTER
• The subsystem has workstation entries that allow interactive jobs to run simultaneously
in this subsystem.
– QSPL
• The subsystem has spooled job queue entries for spooled jobs. Example of spooled jobs
are read and write spooled jobs.
– QCMN
• The subsystem has communication entries for all communications jobs that are to run in
this subsystem.
2015/10/1
15
Subsystems
A specialized environment for handling a certain type of work or function, such as:
- WRKSBS
INTERACTIVE
BATCH
SPOOLING
COMMUNICATIONS
2015/10/1
16
Subsystem Description (1/4)
Display Subsystem Description
Subsystem description: QINTER
System: ABC
Status: ACTIVE
Library: QSYS
Select one of the following:
1. Operational attributes
2. Pool definitions
3. Autostart job entries
4. Work station name entries
5. Work station type entries
6. Job queue entries
7. Routing entries
8. Communications entries
9. Remote location name entries
10. Prestart job entries
30. All of the above
Operational Attributes
Maximum jobs in subsystem
*NOMAX
Sign-on display file
QSYS/QDSIGNON
Pool Definitions
Pool
ID
Storage
Size (KB)
1
*BASE
Selection or command
*INTERACT
2
==>____________________________________________________________________
2015/10/1
17
Subsystem Description (2/4)
Display Subsystem Description
Subsystem description: QINTER
System: ABC
Status: ACTIVE
Library: QSYS
Select one of the following:
1. Operational attributes
2. Pool definitions
3. Autostart job entries
4. Work station name entries
5. Work station type entries
6. Job queue entries
7. Routing entries
8. Communications entries
9. Remote location name entries
10. Prestart job entries
30. All of the above
WORKSTATION Entries
Type
Jobd
Name
Jobd
*ALL
*USRPRF
DSP03
*USRPRF
Job Queue Entries
Jobq
QBATCH
AUTOSTART Job Entries
Job
Jobd
PRESTART Job Entries
Prog
Jobd
PROG01
JOBDAPPC
Communication Entries
Dev
Jobd
Selection or command
*ALL
START
STARTJD
*USRPRF
==>____________________________________________________________________
2015/10/1
18
Subsystem Description (3/4)
Display Subsystem Description
Subsystem description: QINTER
System: ABC
Routing
Status: ACTIVE
Library: QSYS Entries
Select one of the following:
1. Operational attributes
2. Pool definitions
3. Autostart job entries
4. Work station name entries
5. Work station type entries
6. Job queue entries
7. Routing entries
8. Communications entries
9. Remote location name entries
10. Prestart job entries
30. All of the above
SEQNBR
CMPVAL
CLASS
PGM
POOL ID
10
QCMDB
QBATCH
QCMD
1
50
QCMDI
QINTER
QCMD
2
9999
*ANY
QBATCH
QCMD
1
Class Information
QBATCH
QINTER
Run Priority
50
20
Time Slice
5000 ms
2000 ms
Selection or command
Purge
*NO
*YES
==>____________________________________________________________________
Wait Time
2015/10/1
120 sec
30 sec
19
Subsystem Description (4/4)
Display Subsystem Description
Subsystem description: QINTER
System: ABC
Status: ACTIVE
Library: QSYS
Select one of the following:
1. Operational attributes
2. Pool definitions
3. Autostart job entries
4. Work station name entries
5. Work station type entries
6. Job queue entries
7. Routing entries
8. Communications entries
9. Remote location name entries
10. Prestart job entries
Job queue entries in subsystem description
JOBQ
SEQNBR
MAXACT
MAXPTY1
.
MAXPTY9
JOBQA
1O
*NOMAX
*NOMAX
:
:
JOB 2
JOB 1
JOBQB
20
1
*NOMAX
:
:
JOBQC
30
1
*NOMAX
:
JOB 4
JOB 3
JOB 5
Jobs 1 to 5 have equal priority.
30. All of the above
Which jobs run concurrently if the subsystem description has:
MAXJOBS = 2
Selection or command
MAXJOBS = 3
==>____________________________________________________________________
MAXJOBS = 4
MAXJOBS = *NOMAX
?
2015/10/1
20
Outline
• Agenda:
–
–
–
–
–
–
Work management concept and structure
Subsystem
Job
Major subsystem and job commands
Exercise/Practice
Question & Answer
Job Type
2015/10/1
22
Job
• Job Entries
– The Job Entries are the depositories where jobs actually run.
– Job Queue Entries are job queues that are normally defined and created in
the subsystems that run batch jobs (i.e., QBATCH, QBATCH2)
– Workstation Entries are entries that are defined in the subsystems that run
interactive jobs (i.e., QINTER, QINTER2). Interactive jobs are run by users
through workstation terminals. Subsystems must allow multiple
workstation entries running multiple interactive jobs simultaneously.
– Spooled job entries are job queues that are defined in the subsystem that
run spooled jobs (i.e., QSPL). Spooled job entries allow reader and writer
spooled jobs to run.
– Communication entries are normally defined in the QCMN subsystem.
They contain communications protocols and allow communications jobs to
run.
2015/10/1
23
Job identification
Qualified job name
000578 AS24xx DSP01
Job number
2015/10/1
User name
Job name
24
Job Life Cycle
Submit
2015/10/1
Job queue
Subsystem
Memory pool
Output
25
Job Processing
2015/10/1
26
Job Queue
2015/10/1
27
Job Description
Display Job Description
System:
Job description:
QDFTJOBD
Library:
User profile . . . . . . . . . . .
CL syntax check . . . . . . . . .
Hold on job queue . . . . . . . .
End severity . . . . . . . . . . .
Job date . . . . . . . . . . . . .
Job switches . . . . . . . . . . .
Inquiry message reply . . . . . .
Job priority (on job queue) . . .
Job queue . . . . . . . . . . . .
Library . . . . . . . . . . . .
Output priority (on output queue)
Printer device . . . . . . . . . .
Output queue . . . . . . . . . . .
Library . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
HYDRA
QGPL
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
:
:
:
:
:
:
:
:
:
:
:
:
:
:
*RQD
*NOCHK
*NO
30
*SYSVAL
00000000
*RQD
5
QBATCH
QGPL
5
*USRPRF
*USRPRF
More...
Press Enter to continue.
F3=Exit
F12=Cancel
Message logging:
Level . . . . . . . . . . . . . . . . . . . . :
Severity . . . . . . . . . . . . . . . . . . . :
Text . . . . . . . . . . . . . . . . . . . . . :
2015/10/1
4
0
*NOLIST
28
User Profile
Display User Profile - Basic
User profile . . . . . . . . . . . . . . . :
Storage information:
Maximum storage allowed . . . .
Storage used . . . . . . . . . .
Storage used on independent ASP
Highest scheduling priority . . .
Job description . . . . . . . . .
Library . . . . . . . . . . . .
Accounting code . . . . . . . . .
Message queue . . . . . . . . . .
Library . . . . . . . . . . . .
Message queue delivery . . . . . .
Message queue severity . . . . . .
Output queue . . . . . . . . . . .
Library . . . . . . . . . . . .
Printer device . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
:
:
:
:
:
:
:
:
:
:
:
:
:
:
AS2401
*NOMAX
312
*NO
3
QDFTJOBD
QGPL
AS2401
QUSRSYS
*NOTIFY
00
AS24OUTQ
AS2401
*WRKSTN
More...
Press Enter to continue.
F3=Exit
2015/10/1
F12=Cancel
29
Output of job - Job log (DSPJOBLOG)
Display All Messages
Job . . :
QPADEV0001
User . . :
ZHONGHUI
System:
Number . . . :
T6060A1C
009283
Job 009283/ZHONGHUI/QPADEV0001 started on 07/11/28 at 20:58:30 in
subsystem QINTER in QSYS. Job entered system on 07/11/28 at 20:58:30.
> /*
*/
3 > go cmdsbs
3 > STRSBS
3 > ENDSBS
3 > WRKSBS
3 > wrksbs
3 > WRKSBS
3 > go cmdsbsd
3 > WRKSBSD SBSD(QBATCH)
3 > WRKSBSD
3 > dspusrprf zhonghui
More...
Press Enter to continue.
F3=Exit
2015/10/1
F5=Refresh
F12=Cancel
F17=Top
F18=Bottom
30
Output of job – Spooled file (WRKSPLF)
Work with All Spooled Files
Type options, press Enter.
1=Send
2=Change
3=Hold
4=Delete
5=Display
8=Attributes
9=Work with printing status
Opt
File
QSYSPRT
T5MIGSAV
T5MIGSAV
T5MIGSAV
T5MIGSAV
QGLDDIRTRC
User
ZHONGHUI
ZHONGHUI
ZHONGHUI
ZHONGHUI
ZHONGHUI
ZHONGHUI
Device or
Queue
QPRINT
QPRINT
QPRINT
QPRINT
QPRINT
QPRINT
User Data
WRKSYSVAL
QGLD007328
6=Release
Sts
RDY
RDY
RDY
RDY
RDY
HLD
7=Messages
Total
Pages
4
5
5
5
5
69
Cur
Page
Copy
1
1
1
1
1
1
Bottom
Parameters for options 1, 2, 3 or command
===>
F3=Exit
F10=View 4
F11=View 2
F12=Cancel
2015/10/1
F22=Printers
F24=More keys
31
Output of job – Spooled file (DSPSPLF)
Display Spooled File
File . . . . . :
QSYSPRT
Page/Line
1/1
Control . . . . .
Columns
1 - 78
Find . . . . . .
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+...
System Values
5722SS1 V5R4M0 060210
Current
Shipped
Name
value
value
QABNORMSW
0
0
QACGLVL
*NONE
*NONE
QACTJOB
20
20
QADLACTJ
10
10
QADLSPLA
2048
2048
QADLTOTJ
10
10
QALWJOBITP
0
0
QALWOBJRST
*ALL
*ALL
QALWUSRDMN
*ALL
*ALL
QASTLVL
> *INTERMED
*BASIC
QATNPGM
*ASSIST
*ASSIST
QAUDCTL
> *AUDLVL
*NONE
More...
F3=Exit
F12=Cancel
F19=Left
F20=Right
F24=More keys
2015/10/1
32
Output of job – Output Queue (WRKOUTQ)
Work with All Output Queues
Type options, press Enter.
2=Change
3=Hold
4=Delete
9=Work with Writers
14=Clear
Opt
Command
===>
F3=Exit
2015/10/1
Queue
CBSAOUTQ
CBSBOUTQ
CBSCOUTQ
CBSTOUTQ
CBSWOUTQ
PFOQBACH
PFOQBKUP
PFOQTEXT
PFSBK
PFSBK01101
PFSBK01103
PFSBK01104
F4=Prompt
Library
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
CBSSYSLIB
F5=Refresh
5=Work with
Files
3
0
0
0
0
0
0
0
0
0
0
0
F12=Cancel
6=Release
8=Description
Writer
Status
RLS
RLS
RLS
RLS
RLS
RLS
RLS
RLS
RLS
RLS
RLS
RLS
More...
F24=More keys
33
Output of job – Message Queue (WRKMSGQ)
Work with Message Queues
Type options, press Enter.
1=Create
2=Change
4=Delete
Opt
Message
Queue
Library
Text
QIJS
QIPP
QMGTC
QNETSPLF
QPGMR
QPM400
QSECOFR
QSRV
QSRVAGT
QSRVBAS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
QUSRSYS
User
User
User
User
User
User
User
User
User
5=Display messages
14=Clear
QIPP message queue
QMGTC message queue
QNETSPLF message queue
QPGMR message queue
QPM400 message queue
QSECOFR message queue
QSRV message queue
QSRVAGT message queue
QSRVBAS message queue
More...
Parameters for options 1, 2 and 5 or command
===>
F3=Exit
F4=Prompt
F5=Refresh
F9=Retrieve
F11=Display names only
F12=Cancel
F16=Repeat position to
F17=Position to
F24=More keys
2015/10/1
34
Output of job – Message Queue (WRKMSGQ)
Display Messages
Queue . . . . . :
Library . . . :
Severity . . . :
ZHONGHUI
QUSRSYS
00
Type reply (if required), press Enter.
From . . . :
ZHONGHUI
07/11/28
Test message
System:
Program . . . . :
Library . . . :
Delivery . . . :
T6060A1C
*DSPMSG
*NOTIFY
21:47:40
Bottom
F3=Exit
F13=Remove all
2015/10/1
F11=Remove a message
F16=Remove all except unanswered
F12=Cancel
F24=More keys
35
What everyone would like to have …
iSeries Performance
2015/10/1
36
But what we do have
iSeries Performance
Subsystem
Descriptions
Job Queues
Activity Levels
2015/10/1
Pool Sizes
Network Attributes
Fault Rates
Job Descriptions
System
Values
Job State
Transitions
System
Displays
Classes
37
Outline
• Agenda:
–
–
–
–
–
–
Work management concept and structure
Subsystem
Job
Major subsystem and job commands
Exercise/Practice
Question & Answer
Major subsystem and job commands - Job
• GO CMDJOB
– Lists all job related commands
• DSPJOBLOG
– shows commands and related messages for a job that is still active when its
job log has not been written.
• WRKJOB
– works with or change information concerning a user job
• WRKACTJOB
– works with performance and status information for the active jobs in the
system.
• WRKSBMJOB
– works with all jobs submitted from your work station, job, or user profile.
• WRKUSRJOB
– works with a list of selected user jobs.
• CHGJOB
– changes some of the attributes of a job.
• SBMJOB
– allows a job that is running to submit another job to a job queue to be run
later as a batch job.
– The default subsystem for batch job is QBATCH
• DLYJOB
– causes your current job to wait for a specified number of seconds, or until a
specified time of day, before running resumes.
Major subsystem and job commands - Subsystem
• GO CMDSBS
– Lists all subsystem related commands
• STRSBS
– starts a subsystem using the subsystem description specified in the command
• ENDSBS
– ends the specified subsystem (or all active subsystems) and specifies what
happens to active work being processed.
• WRKSBS
– allows you to work with each active subsystem in the system.
• WRKSBSD
– shows a list of subsystem descriptions and allows you to change, delete,
display, start, and end specified subsystem descriptions.
Outline
• Agenda:
–
–
–
–
–
–
Work management concept and structure
Subsystem
Job
Major subsystem and job commands
Exercise/Practice
Question & Answer
Exercise - System i work management
• Qualified Job Name is built up by?
– Job Number + User Name + Job Name
Job queue entries in subsystem description
JOBQ
SEQNBR
MAXACT
MAXPTY1
.
MAXPTY9
JOBQA
1O
*NOMAX
*NOMAX
:
:
JOB 2
JOB 1
JOBQB
20
1
*NOMAX
:
:
JOBQC
30
1
*NOMAX
:
JOB 4
JOB 3
Jobs 1 to 5 have equal priority.
Which jobs run concurrently if the subsystem description has:
MAXJOBS = 2
MAXJOBS = 3
MAXJOBS = 4
MAXJOBS = *NOMAX
?
JOB 5
Questions & Answer
2015/10/1
43