Académique Documents
Professionnel Documents
Culture Documents
CONTENTS
Introduction
2 Hrs
2 Hrs
4 Hrs
4 Hrs
2 Hrs
2 Hrs
2 Hrs
2
Introduction
IMS DB
Information Management System - DataBase Used for
Hierarchical Database
ACCOUNT
BILLING
ADVANCE
FEES
RATE
CASH
PAYMENT
PAYCASH
PAYCHEQ
CHEQUE
Terminology :
Segment : Smallest unit of data an application can
retrieve from a database, contains one or more
fields of data.
Root
: The entry point to the database. No parent.
Parent
: Segment with dependent segments.
Child
: Dependent segment of parent
Twin
: Multiple occurrences of a dependent segment
Key
: Unique identifier of a segment
Concatenated Key
: The concatenation of all the keys
of the parents with the key of the
segment.
Database Record
Search Field
IMS DB Components
Components of an IMS System
APPLICATION Program : The user modules written in
Assembler, Cobol, PL/1
DATABASE : The data accessed by one or more application.
DL/I Modules : The modules which interface between the MVS
access modules and the application program. All access to
IMS databases is through this module. So every time a
database is read or updated the DL/I interface must be called.
DL/I Control Blocks : The executable modules which define the
databases and the application programs view.
MVS
DATA
BASES
MVS
ACCESS
MODULES
PCB
MASK
DL/I
MODULES
DBD
PCB
APPLICATION
PROGRAM
(In
DBDLIB
PSBLIB
PSB)
APPL.
CONTROL
BLOCKS
10
Database name
Segment name
Key field names, lengths and locations
Search field names, lengths and locations
IMS and MVS access methods
DD names (Logical name for datasets)
11
12
SEGM NAME=OWTB58RT,
PARENT=0,
BYTES=5,
PTR=(TWIN,,,,)
FIELD NAME=(OWTBROOT,SEQ,U),
START=1,
BYTES=5,
TYPE=C
*******************************************
*
SEGMENT NUMBER 10
*
*******************************************
SEGM NAME=OWTMRSEG,
PARENT=((OWTB58RT,SNGL)),
BYTES=1250,
PTR=(NOTWIN,,,,)
DBDGEN
FINISH
END
13
14
I
R
D
G
A
L
LS
:
:
:
:
:
:
:
To add/insert a segment.
To change/replace a segment.
To remove/delete a segment.
To read/get a segment.
All functions except load
To initialize(Load) database
Load the database but database must be in key
seq..
GO : Read only. So to read a segment, even if another
program is updating it.
Multiple of the options can be defined as in GI, meaning that
the program can get and/or insert segments.
15
16
17
18
***********************************************************
*
PCB NUMBER 2
DB NUMBER 1
***********************************************************
TYPE=DB,
DBDNAME=FKTSTMDB,
PROCOPT=AP,
KEYLEN=12,
PCBNAME=PCB2,
LIST=YES
SENSEG NAME=FKSGROOT,
PARENT=0
SENSEG NAME=FKSG02ND,
PARENT=FKSGROOT
SENSEG NAME=FKSG03RD,
PARENT=FKSG02ND
PCB
19
***************************************************************
*
PCB NUMBER 3
DB NUMBER 2
***************************************************************
PCB
TYPE=DB,
DBDNAME=FKTSTPDB,
PROCOPT=AP,
KEYLEN=12,
PCBNAME=PCB3,
LIST=YES
SENSEG NAME=FKSGROOT,
PARENT=0
SENSEG NAME=FKSG02ND,
PARENT=FKSGROOT
SENSEG NAME=FKSG14TH,
PARENT=FKSG13TH,
PROCOPT=A
20
***********************************************************
*
PCB NUMBER 4
GSAM NUMBER 1
***********************************************************
TYPE=GSAM,
NAME=CSIBCHIN,
PROCOPT=G
***********************************************************
*
PCB NUMBER 5
GSAM NUMBER 2
***********************************************************
PCB TYPE=GSAM,
NAME=CSIQLOAD,
PROCOPT=L
PCB
PSBGEN PSBNAME=#FNT15,
LANG=ASSEM,
IOASIZE=512,
CMPAT=YES
END
21
22
23
IO-PCB
LOAN-PCB
PAY-PCB.
24
IO-PCB
LOAN-PCB
PAY-PCB.
25
26
PLITDLI call :
PARM-COUNT
FUNCTION
PCB
IO-AREA
SSA.
27
28
29
30
DESCRIPTION
1-8
9-10
11-12
13-16
17-20
21-28
29-32
33-36
37-XX
DATABASE NAME
SEGMENT LEVEL
STATUS CODE
PROCESSING OPTIONS
RESERVED FOR DL/I
SEGMENT NAME
KEY FEEDBACK LENGTH
NO. OF SENSITIVE SEGMENT
KEY FEEDBACK AREA
31
X(8).
99.
XX.
X(4).
X(4).
X(8).
S9(8) COMP.
COMP.
X(100).
32
33
IO-AREAS
The IO-AREA passed to the IMS is the storage location for
the segment to be processed. Its a two-way communication.
For retrieval calls, the IMS places the segment retrieved in
the IO-AREA.
For update calls, the program must place the update
segment in the IO-AREA and IMS will use it to update the
database.
The IO-AREA length should be more enough to hold the
longest segment used in the program, otherwise IMS will
overlay the subsequent storage after the IO-AREA.
34
35
QUALIFIED SSA
36
UNQUALIFIED SSA
POS
DESCRIPTION
1-8
9
SEGMENT NAME
BLANK
Example
01 UNQUAL-SSA.
03 segment-name pic x(9) value ACCOUNT.
37
QUALIFIED SSA
POS
DESCRIPTION
1-8
9
10-17
18-19
20-XX
XX+1
SEGMENT NAME
LEFT PARENTHESIS
KEY NAME FROM DBD
RELATIONAL OPERATOR
VALUE OF KEY-FIELD
RIGHT PARENTHESIS
38
Example
01 ACCOUNT-SSA.
03 seg-name
03 filler
03 key-value
03 filler
pic x value ).
39
GU
LOAN-PCB
BILLING-IO-AREA
ACCOUNT-SSA
BILLING-SSA.
40
41
IMS DB Functions
IMS Databases can be processed one of two ways :
42
GN : get next
GHN : get hold next
GU : get unique
GHU : get hold unique
43
44
45
46
PARANTAGE :
Parantage is set by the GNP or GHNP functions.
These commands sequentially process the database but limit
the segments to dependent segments of the established
parent.
The Seq. Search starts at the current position and stops at
the last dependent segment of the parent.
Parentage must have been set prior to issuing GNP/GHNP
request. This can be done by two ways :
By retrieving a parent segment with the help of GN, GU
etc. Command. Parentage will be set at the last segment
read.
By using Command codes.
47
After every call IMS returns a status code in the PCB. The status
code describes the success or failure of the call.
For calls using XXXTDLI all status codes are returned to the
application program.
48
Cont..
49
AI
DA
DJ
not
II
AJ
50
51
52
SUMMARY
The course is starting with the introduction of IMS
terminology and covering all areas essential to start writing a
IMS DB program.
The topics covered in the course are Intro to IMS DB
components, Programming techniques, Various functions and
status codes in IMS and finally a brief about the processing
mode available in the IMS world.
This course is definitely a good start to sail through
the IMS ocean and to explore its power and complexities.
53