Documente Academic
Documente Profesional
Documente Cultură
Unit 2
Copyright IBM Corporation 2008 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5.1
Objectives
Identify the context for and the major parts of an IMS database application program Learn the elements of an IMS database call Learn how SSAs and command codes are used in database calls to determine which segments are acted upon Demonstrate or simulate the four IMS database call functions Review the capability of the IMS Test Program (DFSDDLT0)
DL/I Processing
z/OS
APPLICATION PROGRAM
INPUT / OUTPUT
CALL
DATA
DL/I
DATA BASE
LOG
PROCESSING TERMINATION
DL/I MODULES
Copyright IBM Corporation 2008
DL/I AREA
Termination
PL/I
OR:
DLITPLI: PROC (DB_PCB1, DB_PCB2) OPTIONS (MAIN); DCL DLITPLI ENTRY, DB_PCB1 POINTER, DB_PCB2 POINTER;
ASSEMBLER
Standard convention: Upon entry, register 1 points to a parameter list of PCB pointers Example
CSECT L USING L USING 9,0 (1) PCB1, 9 7, 4 (1) PCB2, 7 LOAD PCB1 ADDRESS LOAD PCB2 ADDRESS
SIZE
FUNCTION
01 DB-PCB1. 02 DBD-NAME 02 SEG-LEVEL 02 STATUS-CODE 02 PROC-OPTIONS 02 RESERVE-DLI 02 SEG-NAME-FB 02 LENGTH-FB-KEY 02 NUM-SENS-SEGS 02 KEY-FB-AREA. 03 SKILL-KEY 03 NAME-KEY 03 EXPR-KEY
8 2 2 4 4 8 4 4
NAME OF DATABASE SEGMENT HIERARCHY LEVEL DL/I STATUS CODE DL/I PROCESSING OPTIONS RESERVED FOR DL/I SEGMENT NAME FEEDBACK LENGTH OF FEEDBACK KEY NUMBER OF SENSEGS
X(8). XX. XX. XXXX. S9(5) COMP. X(8). S9(5) COMP. S9(5) COMP.
COUNT
FUNCTION
PCB
DATABASE NAME
I/O-AREA SSA (s) (OPTIONAL, 0-15) SEGMENT SEGMENT SEARCH ARGUMENTS
Copyright IBM Corporation 2008
CODE
GUbb GNbb GNPb
DLET
REPL
ISRT
DL/I Interface
CALL 'CBLTDLI' USING GN, EDPCB, COURSE-SEG. FUNCTION CODE "WHAT"?
COURSCDE
COURSDES
COURSLEN
COURSPRC
GN COURSEbb
PSBLIB
DD
DSN=HDAM.EDUCDATA,DISP=SHR
HDAM. EDUCDATA
// EXEC PGM=IDCAMS DELETE CLUSTER (NAME (HDAM.EDUCDATA) ... DEFINE CLUSTER (NAME (HDAM.EDUCDATA) -
z/OS Address-space:
DATABASE DATA SET
COURSE
CLASS
I/O-AREA
CLASS
INSTRUCT
CLASS
STUDENT
DL/I Program
Retrieving Data
z/OS Address-space
Application Program: ... ...
GU COURSE U3700 C LASS SF980814 . . . . . . . . . . . . . . . . . . INPUT/OUTPUT AREA: CLASS SF980814 COURSE U3700 CLASS SF980814 COURSE U3702 CLASS SF980814 WY980905
INSTRUCT MBA
STUDENT SEQ01
STUDENT SEQ01
STUDENT
GU and GHU
Used to retrieve a specific segment occurrence independent of the current position within the database Qualified SSAs identifying each hierarchic level are normally provided
A GET-UNIQUE Call with missing levels of qualification uses current control block information for missing levels. If none exist, unqualified SSAs are assumed for the missing levels.
A GET-UNIQUE call always returns the first segment in the data base that satisfies the qualification
STATUS-CODES
GE bb Segment not found Successful CALL
Copyright IBM Corporation 2008
Hierarchic Format
1
U3700
EXPR CB3
Indented Format
4
NAME
ADAMS
6
JONES 8 SMITH
7
EXPR CB4
EDUC MBA 8
EXPR
EDUC
NAME SMITH 9
3 5
EXPR PL3
MBA
10
10
BBA
EDUC BBA
1
COURSE U3700
2 NAME ADAMS 3
EXPR CB3
bb
5 EXPR AL5
3A
bb
7
EXPR CB4
EDUC MBA
8 NAME SMITH
3B
EXPRbbbb(CLASSIF=AL5)
bb
9 EXPR PL3
3C 4A 4B
10
3 1 6
bb bb bb
COURSE U3700
EDUC BBA
EXPRbbbb(CLASSIF=CB4)
NAME
4C
EXPRbbbb(CLASSIF=PL3)
GE
EXPR
EDUC
4D
bb
GN and GHN
Used to sequentially process segments in a database, or start sequential processing on a portion of it Always proceeds forward from current position within the database A GN Call with no SSAs returns the next segment in the database A GN Call with an unqualified SSA returns the next occurrence of that segment type A GN Call with a qualified SSA returns the next occurrence of the specified segment type which meets the search criteria Unqualified SSAs are supplied for missing levels STATUS-CODES
Unqualified Calls Only
'GA' - Crossed hierarchic boundary to higher level 'GK' - Different segment type at the same level
'GB' - End of Database reached 'GE' - Segment not found 'bb' - Successful call
GNP or GHNP?
Works just like GN except only under established parent. Parent set by successful GN or GU call. Status codes
same as GN
2 NAME ADAMS 3
EXPR CB3
1A B C D E F G H I J K L 2A B C D 3A B
4 NAME JONES
1 2 3 4 5 6 7 8 9 10 (WRAP)
5 EXPR AL5
6 EXPR CB4
7 EDUC MBA
8 NAME SMITH
9 EXPR PL3
10
2 4 8 1 8
2 4 8 8 -
EDUC BBA
COURSE U3700
NAME
EXPR
EDUC
GE
3 5
CLASS WS911215 CLASS SF910814 INSTRUCT AAS INSTRUCT MBA STUDENT SEQ01 STUDENT SEQ05
1. 2. 3.
Class WS911215 segment moved to i/o-area Changes are made to data in i/o-area Updated segment replaced in database
Copyright IBM Corporation 2008
Application Program: . . . . . .
GHU COURSE U3702 . . . . . . . . . . . . DLET . . . . . . . . . INPUT/OUTPUT AREA: COURSE (U3700)
CLASS NY980905
INSTRUCT BBA
STUDENT SEQ05
INSTRUCT AAS
STUDENT SEQ05
U3702
INSTRUCT MBA STUDENT SEQ01
1. 2. 3.
Course (U3702) segment moved to i/o-area Segment and its dependents are eliminated What is in database after deletion?
Copyright IBM Corporation 2008
COURSE (U3700) CLASS WS981215 CLASS SL981015 CLASS SF980814 INSTRUCT AAS STUDENT SEQ05
SL981015
INSTRUCT MBA
STUDENT SEQ01
NO
NO
YES
RESTART PROCESSING
YES
PROCESS
Application
Application
Application
DL/I Modules
DL/I Modules
DL/I Modules
Data Buffers
Data Buffers
Data Buffers
Database (A)
System Log
Database (B)
System Log
Database (C)
System Log
SYSTEM LIBRARY
VSAM CLUSTER
EH L /*
OK 0006 GNP
. . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . IMS 10.1 TEST PROGRAM OUTPUT XX BEGIN TEST XX TIME= 10.57.08.93 DATE=04.081
) COMP RET CODE=OK DBPCB LEV=02 SEG=NAME RET CODE= KFDB LEN=05 KEY FDB=BU115 AKERSON, LAWRENCE R. COMMENTS TIME=10.57.09.49 DATE=04.081 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CALL=GNP SEGMENT = (05A100-30436 1000) COMP RET CODE=OK DBPCB LEV=03 SEG=EXPR RET CODE= KFDB LEN=0054 KEY FDBK= (BU115 AKERSON, LAWRENCE R. 1000) CALL=GNP SEGMENT = (06A200-10242 2000) COMP RET CODE=OK DBPCB LEV=03 SEG=EXPR RET CODE= KFDB LEN=0054 KEY FDBK= (BU115 AKERSON, LAWRENCE R. 2000) . . . . . . STATISTICS FOR DATA BASE CALLS: GU GN GNP GHU GHN GHNP ISRT DLET REPL TOTAL DL/I COUNTS BY CALL1 0 6 0 0 0 0 0 0 7 TOTAL NUMBER OF CALLS = 7 TOTAL NUMBER EQUAL COMPARES = 0 TOTAL NUMBER UNEQUAL COMPARES = PSB= PSBCOBOL PCB= DBD= SKILL STOP TIME= 10.57.10.27 DATE= 04.081
SEGMENT
= (AKERSON, LAWRENCE R. (
Unit Summary
I/O areas, PCB areas, entry points, calls and a process termination are the major parts of an IMS program executing in an IMS region IMS calls consist of an interface, functions, I/O areas, PCBs and optionally SSAs with command codes. SSAs with optional command codes are used to determine which segments are acted upon The Get, Insert, Update and Delete database functions were demonstrated IMS Test Program (DFSDDLT0) was introduced.