+ All Categories
Home > Documents > IMS DB PRESENTATION ver 1.1

IMS DB PRESENTATION ver 1.1

Date post: 24-Nov-2014
Category:
Upload: veeraiah-putha
View: 322 times
Download: 8 times
Share this document with a friend
Popular Tags:
103
page number 1 IMS - DB IMS - DB
Transcript
Page 1: IMS DB PRESENTATION ver 1.1

page number 1

IMS - DBIMS - DB

Page 2: IMS DB PRESENTATION ver 1.1

page number 2

SESSION 1 IMS GENERAL CONCEPTS

SESSION 2 DL/I CONTROL BLOCKS

SESSION 3 SEGMENT SEARCH ARGUMENTS (SSAs)

SESSION 4 COBOL BASICS FOR IMS

SESSION 5 DL/I CALLS

SESSION 6 COMMAND CODES

SESSION 7 DL/I CALLS EXERCISE

SESSION 8 LOGICAL RELATIONSHIP

SESSION 9 DB RECOVERY/RESTART

SESSION 10 EFFICIENT PROGRAMMING TIPS

SESSION 11 COMMON IMS ABENDS

Page 3: IMS DB PRESENTATION ver 1.1

page number 3

SESSION 1SESSION 1

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

Page 4: IMS DB PRESENTATION ver 1.1

page number 4

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

IMS - INFORMATION MANAGEMENT SYSTEM

DEVELOPED IN 1968 BY IBM

DATA LANGUAGE-I (DL/I) WAS DEVELOPED AS A INTERFACE

BETWEEN APPLICATION CODE AND DATA IN IMS DATABASE

Page 5: IMS DB PRESENTATION ver 1.1

page number 5

B3

A2

D1B2

A1

C1

ROOT SEGMENT (PARENT)

SEGMENT OCCURRNCES

TWIN SEGMENTSDEPENDENT SEGMENTS

-- Level 1

-- Level 2B1

HIERARCHICAL STRUCTURE

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

FOLLOWS INVERTED TREE STRUCTURE

EACH BOX IN THE HIERARCHY REPRESENTS

A SEGMENT

ROOT SEGMENT WILL BE ON TOP

EACH SEGMENT (EXCEPT ROOT SEGMENT)

IS DIRECTLY DEPENDENT ON ONLY ONE

SEGMENT

Page 6: IMS DB PRESENTATION ver 1.1

page number 6

SEGMENT IS THE SMALLEST INFORMATION THAT DL/I CAN FETCH

EACH SEGMENT WILL HAVE UNIQUE 8 CHARACTER (MAX) NAME

SEGMENTS ARE MADE UP OF 1 OR MORE FIELDS

FIELD IS THE SMALLEST UNIT THAT DL/I CAN HANDLE

EACH FIELD WILL HAVE MAX 8 CHARACTER NAME

SEGMENT TYPE vs SEGMENT OCCURRENCE

SEGMENT OCCURRENCE IS A PARTICULAR INSTANCE OF A SEGMENT TYPE

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

Page 7: IMS DB PRESENTATION ver 1.1

page number 7

TWO TYPES OF FIELDS

KEY FIELDS

SEARCH FIELDS

KEY FIELD IS USED TO SEQUENCE DATABASE AND IT CAN NOT BE

CHANGED

BOTH TYPES OF FIELDS CAN BE USED TO SEARCH DATABASE

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

Page 8: IMS DB PRESENTATION ver 1.1

page number 8

ROOT A SEGMENT WITHOUT PARENT

PARENTA SEGMENT WITH ONE OR MORE DEPENDENT SEGMENTS

DIRECTLY UNDER IT

CHILDA SEGMENT WHICH IS DIRECTLY DEPENDENT ON ANOTHER

SEGMENT

DEPENDENTALL SEGMENTS UNDER A PARTICULAR SEGMENT OF THE

DATABASE

TWINALL OCCURRENCES (2 OR MORE) OF A SEGMENT TYPE

UNDER A PARENT

SIBLINGS OCCURRENCES OF DIFFERENT SEGMENT TYPES UNDER A PARENT

TYPES OF SEGMENTS

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

Page 9: IMS DB PRESENTATION ver 1.1

page number 9

2 4

1

3

5 76 8 9

1. WHICH SEGMENTS ARE DEPENDENT ON SEGMENT 4?2. WHICH SEGMENTS ARE CHILD SEGMENTS OF SEGMENT 1?3. WHICH SEGMENTS ARE DEPENDENT SEGMENTS OF SEGMENT 1?4. HOW MANY LEVELS?

EXERCISE - 1EXERCISE - 1

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 10: IMS DB PRESENTATION ver 1.1

page number 10

DATABASE RECORDDATABASE RECORD

ONE OCCURRENCE OF A ROOT SEGMENT ALONG WITH ALL ITS DEPENDENT SEGMENTS

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 11: IMS DB PRESENTATION ver 1.1

page number 11

HOW MANY DATABASE RECORDS?

EXERCISE-2EXERCISE-2

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 12: IMS DB PRESENTATION ver 1.1

page number 12

IMS DATABASE LIMITATIONSIMS DATABASE LIMITATIONS

IMS SUPPORTS

15 LEVELS

255 SEGMENTS

1000 FIELDS

NO LIMITATION ON NUMBER OF SEGMENT OCCURRENCES.

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 13: IMS DB PRESENTATION ver 1.1

page number 13

DL/I FORMS BRIDGE BETWEEN APPLICATION PROGRAM AND IMS DATABASE

DL/I IS DATABASE MANAGER. IT

CONSISTS OF IMS PROGRAM

MODULES THAT RUN EXTERNAL TO

APPLICATION PROGRAM

DL/I ALLOWS SEQUENTIAL OR

RANDOM PROCESSING OF DATABASE

IMS ENVIRONMENTIMS ENVIRONMENT

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

App Prog

DL/I DC

TerminalDatabase

DB PCBinterface

I/O PCBinterface

Continued ...Continued ...

Page 14: IMS DB PRESENTATION ver 1.1

page number 14

MODES OF PROCESSING

BATCH DL/I MODE

MPP MODE

BMP MODE

IMS ENVIRONMENTIMS ENVIRONMENT

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTS

MPP

ONLINE

DL/I

BATCH

BMP

Continued ...Continued ...

Page 15: IMS DB PRESENTATION ver 1.1

page number 15

BATCH DL/IBATCH DL/I

TRUE BATCH PROCESSING

NO DATA COMMUNICATION SERVICES ARE USED

DATABASES ACCESSED MUST BE OFFLINE

MPP (MESSAGE PROCESSING PROGRAM)MPP (MESSAGE PROCESSING PROGRAM)

TRUE ONLINE PROCESSING

TRANSACTION ARE ENTERED AT TERMINAL AND STORED IN MESSAGE QUEUE

DATABASES ACCESSED MUST BE ONLINE

IMS ENVIRONMENTIMS ENVIRONMENT

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 16: IMS DB PRESENTATION ver 1.1

page number 16

BMP (BATCH MESSAGE PROCESSING)BMP (BATCH MESSAGE PROCESSING)

TWO TYPES

1. TRANSACTION ORIENTED:

CAN READ & WRITE TO ONLINE MESSAGE QUEUES

CAN PROCESS ONLINE FILES AND DATABASES

2. BATCH ORIENTED:

CAN ONLY READ MESSAGE QUEUES

ACCESS ONLINE DATABASES IN BATCH MODE

IMS ENVIRONMENTIMS ENVIRONMENT

IMS GENERAL CONCEPTSIMS GENERAL CONCEPTSContinued ...Continued ...

Page 17: IMS DB PRESENTATION ver 1.1

page number 17

SESSION 2SESSION 2

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

Page 18: IMS DB PRESENTATION ver 1.1

page number 18

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

DATABASE DESCRIPTION (DBD)DATABASE DESCRIPTION (DBD)

DEFINES THE LAYOUT OF THE DATABASE

DATABASE ADMINISTRATOR DEFINES LAYOUT USING DBDGEN MACRO

PROGRAM SPECIFICATION BLOCK (PSB)PROGRAM SPECIFICATION BLOCK (PSB)

DEFINES THE PROGRAMS VIEW OF THE DATABASE AND APPLICATION PROGRAMS ACCESS AUTHORITY TO DATABASE

DATABASE ADMINISTRATOR / PROGRAMMER DEFINES THIS USING PSBGEN MACRO

Page 19: IMS DB PRESENTATION ver 1.1

page number 19

STATEMENTS IN DBD MACROSTATEMENTS IN DBD MACRO

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

DATADATA BASEBASE DESCRIPTIONDESCRIPTION (DBD)(DBD)

STATEMENT DESCRIPTION

DBD SPECIFIES DATABASE NAME, ACCESS METHOD

DATASET SPECIFIES DD NAME TO BE USED IN JCL, DISK TYPE

SEGM SPECIFIES SEGMENT NAME,SEGMENT LENGTH, PARENT

FIELD SPECIFIES FIELD NAME, LENGTH, STARTING POSITION

IDENTIFIES A FIELD AS KEY OR SEARCH FIELD

Continued ...Continued ...

Page 20: IMS DB PRESENTATION ver 1.1

page number 20

SAMPLE DBDGENSAMPLE DBDGEN

PRINT NOGEN

DBD NAME=VENDOR,ACCESS=HDAM

DATASET DD1=VEND,DEVICE=3380

SEGM NAME=VENSEG,PARENT=0,BYTES=10

FIELD NAME=(VENCODE,SEQ,U),BYTES=10,START=1,TYPE=C

SEGM NAME=ITEMSEG,PARENT=VENSEG,BYTES=5

FIELD NAME=(ITEMCODE,SEQ,U),BYTES=5,START=1,TYPE=C

SEGM NAME=LOCNSEG,PARENT=ITEMSEG,BYTES=9

FIELD NAME=(LOCNCODE,SEQ),BYTES=3,START=1,TYPE=C

FIELD NAME=ORDDATE,BYTES=6,START=4,TYPE=C

DBDGEN

FINISH

END

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 21: IMS DB PRESENTATION ver 1.1

page number 21

TYPE DESCRIPTION

C Character (Default)

COBOL PICTURE

X

P Packed Decimal COMP-3

Z Zoned Decimal S9

H Half Word Binary 9(4) COMP

F Full Word Binary 9(8) COMP

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

DATATYPESDATATYPES USEDUSED ININ DBDGENDBDGEN

Continued ...Continued ...

Page 22: IMS DB PRESENTATION ver 1.1

page number 22

CAN WE DEFINE OVERLAPPING FIELDS?

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 23: IMS DB PRESENTATION ver 1.1

page number 23

PROGRAMPROGRAM SPECIFICATIONSPECIFICATION BLOCKBLOCK (PSB)(PSB)

MADE UP OF ONE OR MORE PROGRAM COMMUNICATION BLOCKS (PCBs)

DB PCB - DEFINES PROGRAM’S VIEW OF A IMS DATABASE

WHENEVER A DATABASE VIEW DEFINED BY THE PCB IS ACCESSED BY A

CALL, THE RESULTS OF CALL ARE PASSED THROUGH THE PCB TO

PROGRAM

PSB IS GENERATED BY PSBGEN MACRO

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 24: IMS DB PRESENTATION ver 1.1

page number 24

A

B C

D E

DATABASEDATABASE PCBPCB

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

PCB GIVES LOGICAL VIEW OF A DATABASE

PORTION OF DATABASE THAT THE PROGRAM PROCESSES IS CALLED

APPLICATION DATA STRUCTURE

A

C

E

Continued ...Continued ...

Page 25: IMS DB PRESENTATION ver 1.1

page number 25

PRINT NOGEN

PCB TYPE=DB,DBDNAME=VENDOR,KEYLEN=15,PROCOPT=LS

SENSEG NAME=VENSEG

SENSEG NAME=ITEMSEG,PARENT=VENSEG

PSBGEN

END

• KEYLEN IS THE LENGTH OF CONCATENATED KEY

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

SAMPLESAMPLE PSBGENPSBGEN

Continued ...Continued ...

Page 26: IMS DB PRESENTATION ver 1.1

page number 26

PROCOPT DESCRIPTION

G Get or Read

I Insert

R Replace

D Delete

A All Options (G, I, R, D)

L Initial Load

LS Sequential Initial Load

K Access only Key of segment

O Used with G to Indicate that Hold is not allowed

P Path Calls

PROCOPTS IN PSB DEFINES SECURITY LEVEL FOR THE PROGRAM

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 27: IMS DB PRESENTATION ver 1.1

page number 27

DBD1 DBD3DBD2

PCB1 PCB2

PCB3 PCB4

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKS

APPLICATION PROGRAM CAN HAVE MULTIPLE VIEWS OF A DATABASE BY

USING SEPARATE PCBS FOR A SINGLE DATABASE

PSBPSB

Continued ...Continued ...

Page 28: IMS DB PRESENTATION ver 1.1

page number 28

PRINT NOGEN

PCB TYPE=DB,DBDNAME=VENDOR,KEYLEN=15

SENSEG NAME=VENSEG,PROCOPT=G

SENSEG NAME=ITEMSEG,PARENT=VENSEG,PROCOPT=R

SENSEG NAME=LOCNSEG,PARENT=ITEMSEG,PROCOPT=A

PSBGEN

END

1. LIST THE SEGMENTS THAT MAY BE UPDATED USING THIS PSB

2. LIST THE SEGMENTS THAT CANNOT BE UPDATED

3. GIVE THE VALID PROCOPT TO BE CODED FOR ADDING AND REPLACING RECORDS IN LOCATION SEGMENT

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 29: IMS DB PRESENTATION ver 1.1

page number 29

EMPDATA

WORKDATA DEPTDATA BENDATA

BASED ON THE ABOVE VIEW OF DATABASE FILL IN THE MISSING PIECES

OF PCB

PCB TYPE=DB,DBDNAME=EMPDB,KEYLEN=16,PROCOPT=G

SENSEG NAME=_________________,PARENT=_____________________

SENSEG NAME=_________________,PARENT=_____________________

SENSEG NAME=_________________,PARENT=_____________________

SENSEG NAME=_________________,PARENT=_____________________

PSBGEN LANG=COBOL,PSBNAME=EMPPSBY

END

DL/I CONTROL BLOCKSDL/I CONTROL BLOCKSContinued ...Continued ...

Page 30: IMS DB PRESENTATION ver 1.1

page number 30

SESSION 3SESSION 3

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENT

Page 31: IMS DB PRESENTATION ver 1.1

page number 31

THE SSA IS AN AREA IN WORKING STORAGE USED TO IDENTIFY THE

SEGMENT TO WHICH ACCESS IS REQUIRED

IT IS AN OPTIONAL DL/I CALL PARAMETER THAT QUALIFIES A CALL BY

SPECIFIYING A PARTICULAR SEGMENT TYPE OR OCCURRENCE

WHEN SPECIFIED IN A DL/I CALL

THE SSA ALWAYS FOLLOWS I/O PARAMETER

THERE MAY BE 1 TO 15 SSAs IN A CALL STATEMENT

THE SSAs MUST APPEAR IN HIERARCHICAL ORDER BY SEGMENT TYPE

THE SSA CONTAINS INFORMATION TO OBTAIN THE REQUIRED SEGMENT. THE INFORMATION COULD BY SEGMENT NAME OR SEGMENT NAME & SEGMENT KEY OR SEGMENT NAME & SEARCH FIELD

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENT

Page 32: IMS DB PRESENTATION ver 1.1

page number 32

WHAT IS THE SIGNIFICANCE OF MAX 15 SSA?

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 33: IMS DB PRESENTATION ver 1.1

page number 33

UNQUALIFIEDUNQUALIFIED

SEARCHES FOR A SPECIFIC SEGMENT TYPE

QUALIFIEDQUALIFIED

SEARCHES FOR A SPECIFIC SEGMENT OCCURRENCE

MORE EFFICIENT THAN UNQUALIFIED SSA

TYPESTYPES OFOF SSASSSAS

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 34: IMS DB PRESENTATION ver 1.1

page number 34

WORKING-STORAGE-SECTIONWORKING-STORAGE-SECTION.

…………..

01 HISTORY-SSA.

05 SEGMENT-NAME PIC X(8) VALUE ‘HISTORY ‘.

05 FILLER PIC X(1) VALUE SPACE.

Blank in 9th position or ‘*’ in 9th position ‘-‘ in position 10 and a blank in position 11

UNQUALIFIEDUNQUALIFIED SSASSA

H I S T O R Y *

H I S T O R Y

-

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 35: IMS DB PRESENTATION ver 1.1

page number 35

WORKING-STORAGE-SECTIONWORKING-STORAGE-SECTION.…………..01 SSA-EMPLOYEE. 03 SEGMENT-NAME PIC X(8) VALUE ‘EMPLOYEE’ 03 COMMAND-CODE PIC X(2) VALUE ‘*-’. 03 BEGIN-QUALIFY PIC X(1) VALUE ‘(‘. 03 KEY-NAME PIC X(8) VALUE ‘EMPKEY ‘. 03 OPERATOR PIC X(2) VALUE ‘ =‘. 03 KEY-VALUE PIC X(12) . 03 END-QUALIFY PIC X(1) VALUE ‘)‘.PROCEDURE DIVISION.…..MOVE ‘123456789000’ TO KEY-VALUE.CALL ‘CBLTDLI’ USING FUNC-CODE, PCB-MASK-1, IO-AREA, SSA-EMPLOYEE.

QUALIFIEDQUALIFIED SSASSA

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 36: IMS DB PRESENTATION ver 1.1

page number 36

OPERATORS USED IN QUALIFIED SSA

OPERATOR SYMBOLS

Equal to ‘EQ’, ‘= ‘, ‘ =‘

Not Equal to ‘NE’, ‘¬=‘, ‘=¬’

Less than ‘LT’, ‘< ‘, ‘ <‘

Less than or Equal to ‘LE’, ‘<=‘, ‘=<‘

Greater than ‘GT’, ‘> ‘, ‘ >’

Greater than or Equal to ‘GE’, ‘>=‘, ‘=>’

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 37: IMS DB PRESENTATION ver 1.1

page number 37

COMMAND CODES INCREASE THE FUNCTIONALITY OF IMS CALLS

COMMAND CODES ARE DESIGNATED BY AN ASTERISK ‘*’ FOLLOWED BY CHARACTERS

NOTE: Detailed description of Command codes will be covered in Session “COMMAND CODES”

COMMAND CODESCOMMAND CODES

SEGMENT SEARCH ARGUMENTSEGMENT SEARCH ARGUMENTContinued ...Continued ...

Page 38: IMS DB PRESENTATION ver 1.1

page number 38

SESSION 4SESSION 4

COBOL BASICS FOR IMSCOBOL BASICS FOR IMS

Page 39: IMS DB PRESENTATION ver 1.1

page number 39

IN A COBOL-IMS PROGRAM. THE FIRST SECTION TO CONTAIN ANY IMS RELATED

COMPONENTS IS THE WORKING STORAGE SECTION

IDENTIFICATION DIVISION

ENVIRONMENT DIVISION

DATA DIVISIONFILE SECTIONWORKING STORAGE SECTIONLINKAGE SECTION

PROCEDURE DIVISION

FUNCTION CODES

I/O AREA

SEGMENT SEARCH ARGUMENTS

PCB MASKS

COBOL BASICS FOR IMSCOBOL BASICS FOR IMS

DATADATA DIVISIONDIVISION

Page 40: IMS DB PRESENTATION ver 1.1

page number 40

FUNCTIONFUNCTION CODESCODES

A FUNCTION CODE IS A 4 BYTE CODE TO TELL DL/I WHAT KIND OF CALL THE PROGRAM IS MAKING

SOME VALID FUNCTION CODES ARE

GU - GET UNIQUEGN - GET NEXTGNP - GET NEXT WITHIN PARENTGHU - GET HOLD UNIQUEGHN - GET HOLD NEXTGHNP - GET HOLD NEXT WITHIN PARENTDLET - DELETEREPL - REPLACEISRT - INSERTXRST - EXTENDED RESTARTCHKP - CHECKPOINT

COBOL BASICS FOR IMSCOBOL BASICS FOR IMSContinued ...Continued ...

Page 41: IMS DB PRESENTATION ver 1.1

page number 41

IS A STANDARD RECORD DESCRIPTION IN THE WORKING STORAGE SECTION

WHICH HOLDS DATABASE SEGMENTS FOR MANIPULATION

IS USED BY DL/I TO PASS SEGMENTS TO THE PROGRAM

CAN BE USED BY PROGRAMMER TO ADD OR REPLACE SEGMENT DATA

MUST BE EQUAL TO OR GREATER THAN THE LENGTH OF THE LONGEST

SEGMENT TO BE USED BY THE PROGRAM

IN CASES WHERE MULTIPLE SEGMENTS OF A HIERARCHY ARE UPDATED OR

RETRIEVED, THE I/O AREA MUST BE LARGE ENOUGH TO HOLD THE LARGEST

CONCATENATION OF THESE SEGMENTS

INPUT/OUTPUTINPUT/OUTPUT AREAAREA

COBOL BASICS FOR IMSCOBOL BASICS FOR IMSContinued ...Continued ...

Page 42: IMS DB PRESENTATION ver 1.1

page number 42

USED IN LINKAGE SECTION

LINKAGELINKAGE SECTIONSECTION

01 DB-PCB-1.

03 DBD-NAME PIC X(8).

03 SEG-LEVEL PIC X(2).

03 STATUS-CODE PIC X(2).

03 PROC-OPTIONS PIC X(4).

03 IMS-RESERVED PIC S9(5) COMP.

03 SEG-NAME PIC X(8).

03 KEY-LEN PIC S9(5) COMP.

03 NUM-SENS-SEGS PIC S9(5) COMP.

03 KEY-FEEDBACK PIC X(??). <= length depends on segment key

THETHE PCBPCB MASKMASK

COBOL BASICS FOR IMSCOBOL BASICS FOR IMSContinued ...Continued ...

Page 43: IMS DB PRESENTATION ver 1.1

page number 43

THERE SHOULD BE ATLEAST ONE PCB FOR EACH DATABASE USED

STATUS CODE OF PCB MASK EXPLAINS WHETHER A CALL IS SUCCESSFUL OR NOT

THE SEQUENCE IN WHICH PCB MASKS ARE DEFINED IN LINKAGE SECTION NEED NOT BE SAME AS THAT IN PSBGEN MACRO

THETHE PCBPCB MASKMASK

COBOL BASICS FOR IMSCOBOL BASICS FOR IMSContinued ...Continued ...

Page 44: IMS DB PRESENTATION ver 1.1

page number 44

PROCEDUREPROCEDURE DIVISIONDIVISION.

ENTRY ‘DLITCBL’ USING DB-PCB-1, DB-PCB-2. <= Sequence should match that of

:::::::::::: PSB Macro

::::::::::::

CALL ‘CBLTDLI’ USING WS-PARM-COUNT, <= Optional

WS-FUNCTION-CODE,

DB-PCB-MASK,

IO-AREA,

SSA-1, SSA-2, SSA-3, ….

::::::::::

::::::::::

GOBACK.

PROCEDUREPROCEDURE DIVISIONDIVISION

COBOL BASICS FOR IMSCOBOL BASICS FOR IMSContinued ...Continued ...

Page 45: IMS DB PRESENTATION ver 1.1

page number 45

COBOL BASICS FOR IMSCOBOL BASICS FOR IMS

RUN JCL

DL/I

APPLICATIONPROGRAM

IMSDATABASE

PROGRAM NAME

PSB NAME

CB

LT

DL

I

DL

ITC

BL

GOBACK

RUN JCL EXECUTES THE BATCH PROCESSOR DFSRRC00 AND PASSES THE APPLICATION PROGRAM NAME AND PSBNAME AS PARAMETERS

ENTRY DLITCBL PASSES THE PCB ADDRESS TO THE PROGRAM

CBLTDLI ACCEPTS PARAMETERS LIKE FUNCTION CODE, I/O AREA AND SSA TO DO THE NECESSARY DATABASE OPERATIONS AND RETURNS DATA AND STATUS CODES DESCRIBING THE SUCCESS OF THE CALL

GOBACK IN THE COBOL PROGRAM TAKES THE CONTROL BACKTO DL/I WHICH PERFORMS IMS FILES CLOSING AND TERMINATES THE BATCH STEP. “STOP RUN” SHOULD NEVER BE USED AS IT WILL NOT FREE RESOURCES

Continued ...Continued ...

Page 46: IMS DB PRESENTATION ver 1.1

page number 46

SESSION 5SESSION 5

DL/I CALLSDL/I CALLS

Page 47: IMS DB PRESENTATION ver 1.1

page number 47

ONE OF THE FOLLOWING FUNCTIONS WILL BE USED IN A RETRIEVAL DL/I CALL

GU - GET UNIQUE

GN - GET NEXT

GNP - GET NEXT WITHIN PARENT

WHEN A RETRIEVAL IS DONE WITH AN INTENT TO UPDATE OR DELETE RECORDS, THE ABOVE FUNCTION CODES WILL BE PREFIXED WITH ‘HOLD’

GHU - GET HOLD UNIQUE

GHN - GET HOLD NEXT

GHNP - GET HOLD NEXT WITHIN PARENT

DL/I RETRIEVAL CALLSDL/I RETRIEVAL CALLS

DL/I CALLSDL/I CALLS

Page 48: IMS DB PRESENTATION ver 1.1

page number 48

GET UNIQUEGET UNIQUE

CALL ‘CBLTDLI’ USING ‘GU ‘, PCB-MASK,

SEGMENT-IO-AREASEGMENTA*-(AKEY=1)SEGMENTB*-(BKEY=2)SEGMENTD*-(DKEY=6)

AFTER THE CALL SEGMENTD WITH DKEY=6 WILL BE IN SEGMENT-IO-AREA

1

6

5

117

104

2 8

3 9

AKEY

BKEY

EKEY

CKEY DKEY FKEY

EXERCISEEXERCISE: WRITE A GU TO RETRIEVE FKEY=10

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 49: IMS DB PRESENTATION ver 1.1

page number 49

WHAT WILL BE THE OUTPUT OF A GU CALL WITH NO SSA?

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 50: IMS DB PRESENTATION ver 1.1

page number 50

GETGET NEXTNEXT

RETREIVALRETREIVAL SEQUENCESEQUENCE

TOP TO BOTTOM

FRONT TO BACK

LEFT TO RIGHT

1

6

5

117

104

2 8

3 9

AKEY

BKEY

EKEY

CKEYDKEY FKEY

GK

GA

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 51: IMS DB PRESENTATION ver 1.1

page number 51

CALL ‘CBLTDLI’ USING ‘GN ‘, PCB-MASK,SEG-IO-AREA,SEGMENTA*-(AKEY=1)SEGMENTE*-(EKEY=8)

AFTER THE CALL SEGMENTE WITH EKEY=8 WILL BE IN PROGRAM I/O AREA

1

6

5

117

104

2 8

3 9

AKEY

BKEY

EKEY

CKEYDKEY

FKEY

EXERCISEEXERCISE: WHAT WILL BE THE RESULTS OF FOUR CONSEQUETIVE GNs AFTER EKEY=8 IS RETRIEVED

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 52: IMS DB PRESENTATION ver 1.1

page number 52

CALL ‘CBLTDLI’ USING ‘GN ’, LS-PCB-MASK, SEGMENT-IO-AREA,

SEGMENTA*-(AKEY=1)

SEGMENTB*-(BKEY=2)

CALL ‘CBLTDLI’ USING ‘GNP ‘, LS-PCB-MASK, SEGMENT-IO-AREA

AFTER THE CALL SEGMENTC WITH CKEY=3 WILL BE IN SEGMENT-IO-AREA

GET NEXT WITHIN PARENTGET NEXT WITHIN PARENT

1

6

5

117

104

2 8

3 9

AKEY

BKEY

EKEY

CKEYDKEY

FKEY

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 53: IMS DB PRESENTATION ver 1.1

page number 53

WHAT WILL BE THE OUTPUT IF GNP IS DONE 4 MORE TIMES IN

PREVIOUS EXAMPLE?

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 54: IMS DB PRESENTATION ver 1.1

page number 54

CALL ‘CBLTDLI’ USING ‘GN ‘, LS-PCB-MASK, WS-SEG-IO-AREA,

SEGMENTA*D(AKEY=1)

SEGMENTF*-(FKEY=10)

WHAT WILL BE THE RESULT AFTER SUCCESSFUL COMPLETION OF THE ABOVE CALL?

PATH CALLS EXERCISEPATH CALLS EXERCISE

1

6

5

117

104

2 8

3 9

BKEY

EKEY

CKEYDKEY

FKEY

DL/I CALLSDL/I CALLSContinued ...Continued ...

Page 55: IMS DB PRESENTATION ver 1.1

page number 55

FUNCTIONS IDENTICAL TO GU/GN/GNP

INDICATES THE REQUESTED SEGMENT(S) MAY BE DELETED OR REPLACED

FORCING IMS TO PUT A LOCK ON THESE SEGMENTS WHICH WILL BE

RELEASED ONLY AFTER ANOTHER CALL BY SAME PCB

THIS ENSURES DATA INTEGRITY

GET HOLD CALLS (GHU/GHN/GHNP)GET HOLD CALLS (GHU/GHN/GHNP)

Continued ...Continued ...DL/I CALLSDL/I CALLS

Page 56: IMS DB PRESENTATION ver 1.1

page number 56

MUST HAVE BEEN OBTAINED WITH A GET HOLD CALL (GHU, GHN, GHNP)

NO INTERVENING CALLS BETWEEN GET HOLD CALL AND REPLACE/DELETE CALLS

MULTIPLE REPLACE ALLOWED AFTER GET HOLD

DELETE/REPLACE CALLSDELETE/REPLACE CALLS

Continued ...Continued ...DL/I CALLSDL/I CALLS

Page 57: IMS DB PRESENTATION ver 1.1

page number 57

CALL ‘CBLTDLI’ USING ‘GHU ‘, LS-PCB-MASK, WS-SEGMENT-IO-AREA

SEGMENTA*-(AKEY=1)

SEGMENTB*-(BKEY=2)

CALL ‘CBLTDLI’ USING ‘DLET’, LS-PCB-MASK

DELETE CALLDELETE CALL

WHAT WILL BE THE RESULT IF THE FIRST GHU CALL IS SEGMENTA*D(AKEY=1)?

Continued ...Continued ...DL/I CALLSDL/I CALLS

1

6

5

117

104

2 8

3 9

BKEY

EKEY

CKEYDKEY

Page 58: IMS DB PRESENTATION ver 1.1

page number 58

UPDATE CONTENTS OF A SEGMENT

KEY FIELD MAY NOT BE ALTERED

SSAs ARE NOT USED NORMALLY

COMMAND CODES

D - TO REPLACE PATH OF SEGMENTS

N - TO EXCLUDE SEGMENTS FROM PATH

STATUS CODES

DA - TRYING TO CHANGE KEY

DJ - NO PRECEDING GET HOLD CALL

RX - REPLACE RULE VIOLATION

REPLACE (REPL)REPLACE (REPL)

Continued ...Continued ...DL/I CALLSDL/I CALLS

Page 59: IMS DB PRESENTATION ver 1.1

page number 59

CALL ‘CBLTDLI’ USING ‘GHU ‘, LS-PCB-MASK, WS-IO-AREA,

SEGMENTA*-(AKEY=1)

SEGMENTB*-(BKEY=2)

SEGMENTC*-(CKEY=3)

Change contents of WS-IO-AREA

CALL ‘CBLTDLI USING ‘REPL’, LS-PCB-MASK, WS-IO-AREA

WILL RESULT IN UPDATE OF SEGMENTC

Continued ...Continued ...DL/I CALLSDL/I CALLS

1

6

5

117

104

2 8

3 9

BKEY

EKEY

CKEYDKEY

FKEY

Page 60: IMS DB PRESENTATION ver 1.1

page number 60

TWO MODES OF INSERTTWO MODES OF INSERT

LOAD MODE - FOR INITIAL LOADING OF DATABASE

UPDATE MODE - ADD TO EXISTING DATABASE

LOAD MODELOAD MODE:

FOR LOAD MODE PROCOPT = L or LS MUST BE SPECIFIED IN PSB

PROCOPT=L LOADS DATABASE BUT NOT NECESSARILY IN SEQUENTIAL ORDER

INSERT (ISRT)INSERT (ISRT)

Continued ...Continued ...DL/I CALLSDL/I CALLS

Page 61: IMS DB PRESENTATION ver 1.1

page number 61

UPDATE MODEUPDATE MODE:

FOR UPDATE MODE PROCOPT=I or IS MUST BE SPECIFIED IN PSB

PROCOPT=I INSERTS SEGMENTS IN SEQ OR RANDOM ORDER

PROCOPT=IS ADDS NEW SEGMENTS ONLY IN ASCENDING ORDER

COMMAND CODESCOMMAND CODES

“F” OR “L” - OVERRIDES INSERT RULE

“D” - INSERT PATH OF SEGMENTS

Continued ...Continued ...DL/I CALLSDL/I CALLS

INSERT (ISRT)INSERT (ISRT)

Page 62: IMS DB PRESENTATION ver 1.1

page number 62

99

MOVE DATA FOR SEGMENTE INTO WS-SEGMENT-IO-AREA WITH EKEY=99

CALL ‘CBLTDLI’ USING ‘ISRT’, LS-PCB-MASK, WS-SEGMENT-IO-AREA,

SEGMENTA*-(AKEY=1)

SEGMENTE

AFTER THE CALL SEGMENTE WITH EKEY=99 IS INSERTED

Continued ...Continued ...DL/I CALLSDL/I CALLS

1

6

5

117

104

2 8

3 9

BKEY

EKEY

CKEYDKEY

FKEY

Page 63: IMS DB PRESENTATION ver 1.1

page number 63

SOME COMMON STATUS CODESSOME COMMON STATUS CODES

DL/I CALLSDL/I CALLSContinued ...Continued ...

STATUS CODE DESCRIPTION

SPACES SUCCESSFUL CALL

CALL TYPES

ALL CALLS

AC CALL HAS SSA WITH A HIERARCHICAL ERROR ALL GET CALLSISRT

AI ERROR WHILE OPENING DATABASE. COMMON CAUSE IS LOADING A DATABASE WHICH IS NOT EMPTY OR DO OTHER THAN LOAD PROCESSING ON EMPTY DATABASE

ALL CALLS

AJ CALL SPECIFIES AN INVALID SSA ALL CALLS

AK FIELD NAMED IN A QUALIFIED SSA IS NOT CORRECT ALL GET CALLSISRT

DA SEQUENCE FIELD IS CHANGED REPL

DJ CALL IS NOT PRECEDED BY A SUCCESSFUL GET HOLD CALL

DLETREPL

GA A HIGHER LEVEL SEGMENT IS RETRIEVED IN SEQUENTIAL PROCESSING

GN, GNP

Page 64: IMS DB PRESENTATION ver 1.1

page number 64

SOME COMMON STATUS CODESSOME COMMON STATUS CODES

DL/I CALLSDL/I CALLSContinued ...Continued ...

STATUS CODE DESCRIPTION

GE SPECIFIED SEGMENT NOT FOUND

CALL TYPES

ALL GET CALLSISRT

GK A SEGMENT OF DIFFERENT TYPE, BUT AT THE SAME LEVEL IS RETRIEVED DURING SEQUENTIAL PROCESSING

GN, GNP

GP PROPER PARENTAGE IS NOT IN EFFECT GNP

II DUPLICATE INSERT ISRT

GB END OF DATA BASE WAS REACHED DURING SEQUENTIAL RETRIEVAL

GN

Page 65: IMS DB PRESENTATION ver 1.1

page number 65

SESSION 6SESSION 6

COMMAND CODESCOMMAND CODES

Page 66: IMS DB PRESENTATION ver 1.1

page number 66

ONE OR MORE COMMAND CODES CAN BE USED IN SSA

EACH COMMAND CODE IS REPRESENTED BY A SINGLE CHARACTER

FOLLOWING AN ASTERISK AFTER SEGMENT NAME

COMMAND CODESCOMMAND CODES

H I S T O R Y * -

DL/I CONSIDERS ALL CHARACTERS FOLLOWING ‘*’ TO BE COMMAND

CODES TILL IT ENCOUNTERS A BLANK OR ‘(‘

RESULTS IN MINIMIZING THE NUMBER OF CALLS AND HENCE IMPROVE

PROGRAM EFFICIENCY

Page 67: IMS DB PRESENTATION ver 1.1

page number 67

SOME COMMAND CODESSOME COMMAND CODES

COMMAND CODESCOMMAND CODES

COMMAND CODE DESCRIPTION

D RETRIEVE A PATH

F FIRST OCCURRENCE OF SEGMENT TYPE

L LAST OCCURRENCE OF SEGMENT TYPE

U MAINTAIN CURRENT POSITION AT THIS LEVEL

V MAINTAIN CURRENT POSITION AT THIS AND HIGHER LEVELS

N DO NOT REPLACE THIS SEGMENT

C USE A CONCATENATED KEY

P ESTABLISH PARENTAGE AT THIS LEVEL

- NULL/IGNORE

Continued ...Continued ...

Page 68: IMS DB PRESENTATION ver 1.1

page number 68

REQUESTS DL/I TO USE PATH CALLS

ALLOWS ENTIRE PATH IN SEGMENT HIERARCHY TO BE RETRIEVED IN ONE

SINGLE CALL

FOR PROGRAMS USING PATH CALLS PROCOPT IN PSB SHOULD HAVE “P” AS

ONE OF THE VALUES

DL/I DOES NOT RETRIEVE SEGMENTS IF THE CORRESPONDING SSA DOES

NOT HAVE PATH COMMAND CODE “D”

COMMANDCOMMAND CODE “D”CODE “D”

COMMAND CODESCOMMAND CODESContinued ...Continued ...

Page 69: IMS DB PRESENTATION ver 1.1

page number 69

SEGMENT IN THE LAST SSA WILL ALWAYS BE RETRIEVED EVEN IF SSA DOES

NOT HAVE COMMAND CODE “D”

FOR ISRT CALLS COMMAND CODE “D” DESIGNATES THE FIRST SEGMENT TO

BE INSERTED

FOR ISRT CALLS SSAS FOR LOWER LEVEL SEGMENTS NEED NOT HAVE “D”

COMMAND CODE, “D” COMMAND CODE IS PROPAGATED TO ALL SPECIFIED

SEGMENTS AUTOMATICALLY

I/O AREA USED SHOULD BE BIG ENOUGH TO ACCOMMODATE ALL SEGMENTS

IN PATH

COMMANDCOMMAND CODE “D”CODE “D”

COMMAND CODESCOMMAND CODESContinued ...Continued ...

Page 70: IMS DB PRESENTATION ver 1.1

page number 70

CALL ‘CBLTDLI’ USING ‘GU ‘, LS-PCB-MASK, WS-SEG-IO-AREA,SEGMENTA*D(AKEY=1)

SEGMENTB*D(BKEY=2)

SEGMENTD*-(DKEY=5)

AFTER THE CALL SEGMENTS #1, #2 & #5 WILL BE RETURNED IN I/O AREA

PATH CALLS EXAMPLEPATH CALLS EXAMPLE

1

6

5

117

104

2 8

3 9

AKEY

BKEY

EKEY

CKEYDKEY

FKEY

Continued ...Continued ...COMMAND CODESCOMMAND CODES

Page 71: IMS DB PRESENTATION ver 1.1

page number 71

CALL PROCESSES FIRST OCCURRENCE OF THE SEGMENT TYPE

•EXAMPLE:

SEGMENT 2 CAN BE RETRIEVED AFTER SEGMENT 4 BY USING

CALL ‘CBLTDLI’ USING ‘GNP ‘ LS-PCB-MASK, WS-SEG-IO-AREA,

SEGMENTB*F

COMMAND CODE “F”COMMAND CODE “F”

COMMAND CODESCOMMAND CODES

4

3

1

2

SEGMENTA

SEGMENTBSEGMENTC

Continued ...Continued ...

Page 72: IMS DB PRESENTATION ver 1.1

page number 72

COMMAND CODE “L”COMMAND CODE “L”

COMMAND CODESCOMMAND CODES

CALL PROCESSES LAST OCCURRENCE OF THE SEGMENT TYPE

•EXAMPLE:

SEGMENT 4 CAN BE RETRIEVED AFTER SEGMENT 2 BY USING

CALL ‘CBLTDLI’ USING ‘GNP ‘ LS-PCB-MASK, WS-SEG-IO-AREA,

SEGMENTC*L

4

3

1

2

SEGMENTA

SEGMENTBSEGMENTC

Continued ...Continued ...

Page 73: IMS DB PRESENTATION ver 1.1

page number 73

COMMAND CODE “N”COMMAND CODE “N”

COMMAND CODESCOMMAND CODES

USED IN REPL CALLS FOLLOWING PATH CALLS

IF ANY SEGMENT RETRIEVED DURING PATH CALL NEED NOT BE REPLACED

COMMAND CODE “N” IS USED IN SSA OF THAT SEGMENT

Continued ...Continued ...

Page 74: IMS DB PRESENTATION ver 1.1

page number 74

COMMAND CODESCOMMAND CODES

COMMAND CODE “P”COMMAND CODE “P”

IS USED TO SET PARENTAGE TO A SPECIFIC SEGMENT IN THE HIERARCHY

USED IN SSAS

EXAMPLE:

CALL ‘CBLTDLI’ USING ‘GU ‘ LS-PCB-MASK, WS-IO-AREA SEGMENTA*PSEGMENTC

WILL RETRIEVE SEGMENTC TO I/O AREA BUT PARENTAGE WILL BE SET TO SEGMENTA

Continued ...Continued ...

3

1

2

SEGMENTA

SEGMENTBSEGMENTC

Page 75: IMS DB PRESENTATION ver 1.1

page number 75

SESSION 7SESSION 7

DL/I CALL EXERCISEDL/I CALL EXERCISE

Page 76: IMS DB PRESENTATION ver 1.1

page number 76

COURSE# TITLE DESCRIPN

COURSE# TITLE DATE LOCATION FORMAT

EMPNUM NAME GRADEEMPNUM NAME

COURSE

PREREQ OFFERING

TEACHER STUDENT

Continued ...Continued ...DL/I CALL EXERCISEDL/I CALL EXERCISE

Page 77: IMS DB PRESENTATION ver 1.1

page number 77

GIVE SYNTAX OF DL/I CALLS FOR THE FOLLOWING SCENARIOS

1. GET THE FIRST OFFERING OCCURRENCE WHERE THE LOCATION IS “CHENNAI”

2. GET ALL STUDENT OCCURENCES FOR THE OFFERING FOUND IN 1

3. GET ONLY STUDENT OCCURENCES WITH GRADE OF “A”

4. SEQUENTIAL READ OF ALL SEGMENTS IN THE DATABASE

Continued ...Continued ...DL/I CALL EXERCISEDL/I CALL EXERCISE

Page 78: IMS DB PRESENTATION ver 1.1

page number 78

5. GET ALL STUDENTS WITH GRADE OF “A” IN COURSE “IMS”

6. ADD A STUDENT OCCURRENCE FOR THE COURSE “IMS” OFFERED ON DATE “3/26/02”

7. DELETE THE OFFERING OF COURSE “XYZ” ON 26 March, 2002

8. CHANGE THE LOCATION OF COURSE “IMS” OFFERED ON “3/26/02” TO “MUMBAI”

Continued ...Continued ...DL/I CALL EXERCISEDL/I CALL EXERCISE

Page 79: IMS DB PRESENTATION ver 1.1

page number 79

9. GET THE FIRST OFFERING OCCURRENCE WHERE THE LOCATION IS “CHENNAI”, TOGETHER WITH ITS PARENT COURSE OCCURRENCE

10. INSERT A NEW COURSE “ABC” TOGETHER WITH AN OFFERING AT CHENNAI ON 26 March 2002, FOR WHICH TEACHER IS EMPLOYEE NUMBER 12345

11. GET THE TEACHER OF THE FIRST OFFERING ATTENDED BY STUDENT 222222

Continued ...Continued ...DL/I CALL EXERCISEDL/I CALL EXERCISE

Page 80: IMS DB PRESENTATION ver 1.1

page number 80

SESSION 8SESSION 8

LOGICAL RELATIONSHIPSLOGICAL RELATIONSHIPS

Page 81: IMS DB PRESENTATION ver 1.1

page number 81

RELATIONSHIP BETWEEN TWO SEGMENTS IN TWO PHYSICALLY SEPARATE DATABASES

CAN ALSO CONNECT TWO SEGMENTS WITHIN THE SAME DATABASE

ALLOWS APPLICATION TO HAVE DIRECT ACCESS FROM A SEGMENT IN ONE PHYSICAL DATABASE TO A LOWER LEVEL SEGMENT IN ANOTHER PHYSICAL DATABASE

RESULTS IN A NEW HIERARCHY- ONE THAT DOES NOT EXIST IN PHYSICAL STORAGE BUT CAN BE PROCESSED BY APPLICATION PROGRAMS AS THOUGH IT EXISTS

THREE TYPES OF LOGICAL RELATIONSHIPSUNIDIRECTIONAL LOGICAL RELATIONSHIP BIDIRECTIONAL PHYSICALLY PAIRED LOGICAL RELATIONSHIPBIDIRECTIONAL VIRTUALLY PAIRED LOGICAL RELATIONSHIP

LOGICAL RELATIONSHIPSLOGICAL RELATIONSHIPS

Page 82: IMS DB PRESENTATION ver 1.1

page number 82

DETAIL

ORDER

SHIPMENT

PART

STOCK

PART Database

ORDER Database

Physical Parent

of DETAIL

Logical Parent

of DETAIL

Physical Children

of ORDER

Logical Children

of PART

Logical Relationship

Continued ...Continued ...LOGICAL RELATIONSHIPSLOGICAL RELATIONSHIPS

Page 83: IMS DB PRESENTATION ver 1.1

page number 83

DETAIL

ORDER

SHIPMENT

PART /ORDERPART /ORDER

Logical Database

ORDER/PARTORDER/PART

Logical Database

PART

STOCK

STOCK

PART

ORDERDETAIL

SHIPMENT

Continued ...Continued ...LOGICAL RELATIONSHIPSLOGICAL RELATIONSHIPS

Page 84: IMS DB PRESENTATION ver 1.1

page number 84

SESSION 9

DB RECOVERY / RESTART

Page 85: IMS DB PRESENTATION ver 1.1

page number 85

WHY?WHY?

TO RESTORE A DATABASE AFTER ITS PARTIAL DESTRUCTION

WHEN?WHEN?

A DLI BATCH UPDATE JOB FAILS AFTER MAKING AT LEAST ONE DATABASE UPDATE

A FAILURE HAS OCCURRED ON A PHYSICAL DASD DEVICE A FAILURE HAS OCCURRED IN A DATABASE RECOVERY UTILITY A FAILURE OF DYNAMIC BACKOUT OR BATCH BACKOUT UTILITY HAS

OCCURRED AN IMS ONLINE SYSTEM FAILURE AND EMERGENCY RESTART HAS NOT BEEN

COMPLETED

DATABASE RECOVERYDATABASE RECOVERY

Page 86: IMS DB PRESENTATION ver 1.1

page number 86

HOW?HOW?

ONLINEONLINE RECOVERYRECOVERY PROCESSPROCESS

IMS DOES DYNAMIC BACKOUT USING THE LOG INFORMATION FOR DL/I

PROGRAMSFOR BMP PROGRAMS UPDATES ARE AUTOMATICALLY BACKED OUT TO

THE LAST CHECKPOINT

BATCHBATCH RECOVERYRECOVERY PROCESSPROCESS

FORWARD RECOVERY

BACKWARD RECOVERY / BATCH BACK OUT

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 87: IMS DB PRESENTATION ver 1.1

page number 87

UTILITIES FOR RECOVERYUTILITIES FOR RECOVERY

DFSUDMP0DFSUDMP0: DATABASE IMAGE COPY UTILITY FOR CREATION OF IMAGE COPIES OF DATABASES

DFSUCUM0DFSUCUM0:DATABASE CHANGE ACCUMULATION UTILITY FOR ACCUMULATION OF DATABASE CHANGES FROM DL/I LOG TAPES SINCE THE LAST COMPLETE IMAGE COPY

DFSURDB0DFSURDB0: DATABASE RECOVERY UTILITY FOR RESTORATION OF THE DATABASE, USING A PRIOR DATABASE IMAGE COPY AND THE ACCUMULATED CHANGES FROM DL/I LOG TAPES

DFSBBO00DFSBBO00: DATABASE BACK OUT UTILITY FOR REMOVAL OF CHANGES MADE TO DATABASES BY A SPECIFIC APPLICATION PROGRAM

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 88: IMS DB PRESENTATION ver 1.1

page number 88

DATABASE RECOVERY CONTROL (DBRC)DATABASE RECOVERY CONTROL (DBRC)

DBRC INCLUDES THE IMS FUNCTIONS WHICH PROVIDE IMS SYSTEM AND DATABASE INTEGRITY AND RESTART CAPABILITY.

DBRC RECORDS INFO IN 3 RECON VSAM DATASETS

RECON CONTAINS FOLLOWING INFORMATION LOG DATA SET INFORMATION DATABASE DATA SET INFORMATION ALLOCATION OF A DATABASE UPDATE OF A DATABASE IMAGE COPY OF A DATABASE ABEND OF A SUBSYSTEM RECOVERY OF A DATABASE REORGANIZATION OF A DATABASE

DBRC AUTHORIZES OR REFUSES TO AUTHORIZE THE DATABASES DEPENDING ON THE CURRENT AUTHORIZATIONS AND THE ACCESS INTENT OF THE SUBSYSTEM.

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 89: IMS DB PRESENTATION ver 1.1

page number 89

FORWARD RECOVERYFORWARD RECOVERY

RESTORE MOST RECENT IMAGE COPY DATASET

CHANGES MADE TO DATABASE SINCE THE LAST IMAGE COPY ARE APPLIED ON THE RESTORED DATABASE BY USING

CHANGE ACCUMULATION DATASETSLOG DATASETS

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 90: IMS DB PRESENTATION ver 1.1

page number 90

BACKWARDBACKWARD RECOVERYRECOVERY

USES BATCH BACKOUT UTILITY TO DO A FULL BACKOUT OR BACKOUT TO ANY PRIOR CHECKPOINT

PSB USED IS SAME AS PSB OF THE PROGRAM WHOSE EFFECTS HAVE TO BE BACKED OUT

INPUTSINPUTSLOG DATASETSDATABASES WHOSE UPDATES ARE TO BACKED OUTCHECKPOINT ID

WARNING: DO NOT USE CHECKPOINT ID WHILE BACKING OUT BMP. IT TAKES BY DEFAULT THE LAST CHECKPOINT ISSUED.

OUTPUTSOUTPUTSBACKED OUT DATABASESLOG DATASETS

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 91: IMS DB PRESENTATION ver 1.1

page number 91

HOW DO YOU BACK OUT A NORMALLY TERMINATED PROGRAM?

BY GIVING DBRC=C IN THE JCL SHOWN BELOW

//STEP1 EXEC PGM=DFSRRC00, // REGION=5632K, // PARM=(DLI,&MBR,&PSB,, // &SPIE&TEST&EXCPVR&RST,&PRLD, // &SRCH,&CKPTID,&MON,,&FMTO,,&SWAP, // &DBRC,&IRLM,&IRLMNM,&BKO) //*

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 92: IMS DB PRESENTATION ver 1.1

page number 92

CHECKPOINTCHECKPOINT CALLCALL (CHKP)(CHKP)

CHECKPOINT RESTART IS USED DURING BACKWARD RECOVERY

CHECKPOINT COMMITS PROGRAMS UPDATES TO THE DATABASE AND LOGS THE UPDATES

TWO TYPES OF CHECKPOINTS

•BASICBASIC CHECKPOINTCHECKPOINT

–STORES JUST CHECKPINT ID ( 8 BYTES STORED IN IO-AREA)

–SYNTAX: CALL ‘CBLTDLI’ USING WS-CHKP, IO-PCB, IO-AREA

•SYMBOLICSYMBOLIC CHECKPOINTCHECKPOINT

–STORES CRITICAL DATA APART FROM CHECKPOINT ID

–MUST USE XRST FOR RESTARTING

–SYNTAX: CALL ‘CBLTDLI’ USING WS-CHKP,

IO-PCB, IO-AREA-LEN, IO-AREA,

IO-AREA-LEN1, IO-AREA1…

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 93: IMS DB PRESENTATION ver 1.1

page number 93

RESTARTRESTART CALL(XRST)CALL(XRST)

USED TO RESTART A PROGRAM AFTER ABNORMAL TERMINATION

RESTART FROM

SPECIFIC CHECKPOINT ID

TIME/DATESTAMP

LAST CHECKPOINT (‘LAST’) - BMPs ONLY

MUST BE THE FIRST CALL IN THE PROGRAM

SYNTAX: CALL ‘CBLTDLI’ USING WS-XRST,

IO-PCB, IO-AREA-LEN, IO-AREA,

IO-AREA-LEN1, IO-AREA1…

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 94: IMS DB PRESENTATION ver 1.1

page number 94

FACTORS TO BE CONSIDERED FOR CHKP & XRST CALLSFACTORS TO BE CONSIDERED FOR CHKP & XRST CALLS

ALL FILES (INCLUDING SYSIN, SYSOUT) USED BY PROGRAM SHOULD BE DL/I (GSAM) DATABASES OTHERWISE THERE WILL BE DUPLICATE DATA OR LOSS OF DATA

GSAM OUTPUT FILES SHOULD USE DISP=(NEW,KEEP,KEEP) FOR INITIAL RUN AND DISP=(OLD,KEEP,KEEP) FOR RESTARTS

Continued ...Continued ...DATABASE RECOVERYDATABASE RECOVERY

Page 95: IMS DB PRESENTATION ver 1.1

page number 95

SESSION 10

EFFICIENT PROGRAMMING TIPS

Page 96: IMS DB PRESENTATION ver 1.1

page number 96

INSTEAD OF USING GET CALL PRECEDING A ISRT CALL USE ISRT WITH

APPROPRIATE SSA

USE QUALIFIED SSAS WHEREVER POSSIBLE

IMPLIED SSAS SHOULD BE AVOIDED EVENTHOUGH DL/I CONSTRUCTS

MISSING SSAS

MINIMIZE THE NUMBER OF DL/I CALLS BY USING COMMAND CODES

USE SEARCH FIELDS IN DL/I CALLS INSTEAD OF USING IF STATEMENTS IN

COBOL PROGRAM

PROGRAMMING TIPSPROGRAMMING TIPS

Page 97: IMS DB PRESENTATION ver 1.1

page number 97

TRY USING SECONDARY INDICES

DESIGN YOUR PROGRAM TO RUN IN BOTH BMP AND BATCH MODE

USE CHECKPOINT/RESTART

THERE IS ONLY A SMALL PERFORMANCE DIFFERENCE BETWEEN THE GET AND GET HOLD CALLS. SO USE GET HOLD CALLS WHENEVER THERE IS A CHANCE ( > 5%) OF SEGMENT UPDATE/DELETE

IT IS GOOD PRACTICE TO PROGRAM FOR EASY ADJUSTMENT OF CHECKPOINT FREQUENCY

PROGRAMMING TIPSPROGRAMMING TIPSContinued ...Continued ...

Page 98: IMS DB PRESENTATION ver 1.1

page number 98

SESSION 11

COMMON IMS ABENDS

Page 99: IMS DB PRESENTATION ver 1.1

page number 99

U0047U0047

DESCRIPTION

ONE OF THE DBPCBS IN THE PSB FAILED TO OBTAIN THE DATABASE AUTHORIZATION THROUGH DBRC. USUALLY OCCURS WHEN DATABASE IS UP IN ONLINE OR DATABASE IS USED IN UPDATE MODE BY ANOTHER PROGRAM.

SOLUTION

•BRING DOWN THE DATABASE USING /DBR DB DATABASE NAME

•WAIT TILL CONTENDING JOB COMPLETES AND RESTART THE JOB

COMMON IMS ABENDSCOMMON IMS ABENDS

Page 100: IMS DB PRESENTATION ver 1.1

page number 100

U0456U0456

DESCRIPTION

A DL/I BATCH REGION, BMP PROGRAM COULD NOT BE INITIATED BECAUSE THE PSB HAS BEEN STOPPED OR LOCKED BY A COMMAND OR A PRIOR PROGRAM FAILURE

SOLUTION

•ANALYZE WHY THE PSB IS LOCKED OR STOPPED. RESTART THE JOB AFTER THE PSB HAS BEEN UNLOCKED

TO UNLOCK PSB FOR A BMP PROGRAM USE /START PROGRAM psbname COMMAND

COMMON IMS ABENDSCOMMON IMS ABENDS

Page 101: IMS DB PRESENTATION ver 1.1

page number 101

U0476U0476

DESCRIPTION

A DL/I CALL DOES NOT INCLUDE A VALID PCB ADDRESS

PROBABLE CAUSES

• PSB LANGUAGE TYPE SPECIFIED IS NOT SAME AS THAT OF APPLICATION PROGRAM

• COBOL MAIN PROGRAM ENTERED AT PROCEDURE DIVISION INSTEAD OF DLITCBL BECAUSE ENTRY DLITCBL NOT INCLUDED IN LKED

• WRONG PCB WITH FEWER PCBS THAN EXPECTED IS USED

COMMON IMS ABENDSCOMMON IMS ABENDS

Page 102: IMS DB PRESENTATION ver 1.1

page number 102

U0852U0852

DESCRIPTION

THE SEGMENT CODE RETURNED IS NOT VALID FOR THE DATABASE

SOLUTION

ANALYZE THE DATABASE. IF THERE IS AN INVALID POINTER, RECOVER THE DATABASE.

COMMON IMS ABENDSCOMMON IMS ABENDS

Page 103: IMS DB PRESENTATION ver 1.1

page number 103

U3303U3303

DESCRIPTION

APPLICATION PROGRAM TRIED TO USE A DATABASE THAT WAS NOT AVAILABLE FOR ACCESS AND/OR UPDATE. DFS3303I MESSAGE ACCOMPANIES THIS ABEND

SOLUTION

CHECK THE STATUS OF DATABASE GIVEN IN DFS3303I MESSAGE USING

/DISPLAY DB database name

IF DATABASE IS DOWN START THE DATABASE USING THE COMMAND

/START DB database name

COMMON IMS ABENDSCOMMON IMS ABENDS


Recommended