You are on page 1of 89

IMS Class Room Session

IMS/DB Program is the user of IMS/DB. Types of processing

IMS

Online Transaction Processing Message Processing Program (MPP) Two Batch n!ironment Share" Batch Processing (BMP) #clusi!e Batch (D$/I)(DBB)

$e!el of %&straction

'o&ol ) %D

(S%M Macro

M(S $ow $e!el )outines * T+ P,T

D%SD

''--

IMS Data&ase

E P PE!S"N#$ D#%#

E P P#&!"$$

E P $'B!#!&

E P SK'$$

If MP personal "ata is "elete"+ all the others shoul" get "elete". This is referential integrity.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 1 of 89

IMS Class Room Session

IMS "ata manager

(I .

$O*I'%$ MOD $

P-/SI'%$ $%/ )

.hat user wants

D%SD

-ierarchical Mo"el

,ser "eals with logical !iew only. -e is not &othere" a&out how "ata is store" physically. This is "ata in"epen"ence. IMS $ogical Structure

$e!el 0

Parent )*S%" E!

Parent/'hil"

"!DE!

$e!el 1

'hil" DE$'+E!& '%E Twins

$e!el 2

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ( of 89

IMS Class Room Session


Process an" $e!el Of %&straction IMS/DM PSB DBD

P)B P ! " 3 ! #

#)B

D$/'

-ierar.hi.al #..ess ethods

0ile anage1ent

$o2 $evel '/" routines

-IS%M -D%M

(S%M -ID%M

OS%M

M(S

Dis3 (olumes 4ote5 PSB an" DBD must &e create" &efore e#ecuting program.

(iew "etermines what user can see an" PSB "etermines (iew -ow to use IMS Data&ase Manager6

0. 'reate -ierarchical Mo"el 1. Inform IMS/DM a&out your "ata mo"el. This mo"el is to &e translate" to physical me"ium. The process is calle" Data&ase Description *eneration. DBD* 457 'reates DBD elements for IMS. 4ow IMS 3nows a&out your "ata mo"el. 4ow mo"el is create"+ nee" to put segments into it. Therefore nee" to pro!i"e access to user. 2. Pro!i"e access to user 7.hich "ata&ase/segments/fiel"s 7.hat user can "o 8 '),D -ow this !iew is "efine"6 This is "one &y Program Specification Bloc3 *eneration. PSB* 457 'reates PSB elements PSB restricts/allows what user can see. -ere user is a program. DB% loo3s after these things i.e. 0+1+2 Programmer ne!er "efines new "ata&ases. 9or any new program+ you nee" to create PSB element.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page , of 89

IMS Class Room Session

Process %ccess )e:uest .hat 8 '),D ('reate+ )eplace+ ,p"ate+ Delete) On what 8 "&"(one P'B for each "ata&ase)/segment/segment :ualification .ith what/where 8 segment i7o %rea (-ere IMS returns the re:uire" "ata in this area "efine" in wor3ing storage) .as it successful 8 'ommunication P'B (e:ui!alent to S;$'%)

IMS reports on the call through program communication &loc3. IMS pro!i"es this programming interface through D$/I calls. '%$$ <'B$TD$I= ,SI4* 9,4'TIO4 P'B I7O7%) % SS%

DBD fee"&ac3 Segment ;ualification

In"i!i"ual hierarchical mo"el is one "ata&ase. 'ollection of all "ata&ases is corporate "ata&ase. (Only for IMS) Assignment1 :,tility '%IS%'B is e:ui!alent of DBD* 4. 'reate a file DBD0.%'B using te#t e"itor ( DIT)+ in!o3e the utility '%IS%'B to create a "ata&ase. In the same file write DBD an" then PSB specification.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 4 of 89

IMS Class Room Session


Day 3

Persistent Data

Pro&lems57 0. Dura&ility 1. 'oncurrent ,sage (Isolation) 2. Manage (catalog) 'atalog policy57 )eco!ery + asy %ccess

IMSSRCLIB: DBD source DBDLIB: Generated DBD---------------Get the information IMS/ESA Version !" Manual# $tilities Reference-S%stem &Generated $tilities' Li(rar% Reader for )indo*s &do*nload from Internet or Cds'

Assignment2: Two ntities5 MP$O/ > P)O? 'T

-ierarchical Mo"el E P P!"6E)%

P!

SK$

#SS'3N

-ere there are two "ata&ases.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 5 of 89

IMS Class Room Session


EMP EMPNO MP4%M MP%D) P) P$%%%%MM PIC 4 T7P%/7%MT PI' SE$ S&'-ID SE$74%M @P/)S P$O(EC) P$O(EC)-ID PIC 4%M PI' '$I 4T74%M PI' %SSI*4 EMPNO ST%)T7D%T 4D7D%T PIC PI' PI' X(06 !ni"#e @(AG) @(AG) X(0* !ni"#e @(1A) @(FA) PIC PI' PI' X(03 !ni"#e @(2A) C(A1) X(06 C(AD) !ni"#e PIC PI' PI' X(06 !ni"#e @(2A) @(BA)

Three ways of accessing information57 0. )an"om 1. Se:uential (all) 2. Se:uential with criteria MP4O is a Eey fiel". Therefore all the MP occurrences will &e in ascen"ing or"er of MP4O One root with all "epen"ents is a "ata&ase recor"

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 7 of 89

IMS Class Room Session

P)I4T 4O* 4 DBD 4%M H MPDB S * 4%M H MP+P%) 4THA+B/T SHID 9I $D 9I $D 9I $D S * 4%M HP)+P%) 4TH MP+B/T SH01 9I $D 9I $D S * 4%M HSE$+P%) 4TH MP+B/T SH2F 9I $D 9I $D 9I $D DBD* 4 9I4IS4D (S ;+,)5 ,ni:ue 3ey fiel" (S ;+M)5 4on7uni:ue 3ey fiel" IMS!MACLIB: Loo+ out in for DBD#SEG ,IELD etc! $tilit% to anal%-e DBD: IS.,/01tion 2 &IMS DB3 &DataBase 3ools' Manuals' DBDSRC: Contains DBD source DBDLIB: Contains DBD elements

Assignment3: 0. 1. 2. B. Print pictures of all the "ata&ase )eport of DBD use" &y "ifferent program PSBwise )eport DBD &y access metho"s5 -IS%M+ -D%M+ an" -ID%M. There won=t &e )eport for *S%M

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8 of 89

IMS Class Room Session

-ierarchical Se:uence 0. Top to Bottom 1. $eft to )ight IMS puts the segments in this or"er. If nee"s to a"" new segments into the "efine" se:uence+ e!ery time that se:uence has to &e &rea3 therefore IMS gi!es 2 access metho"s 2. B. F. D. -S%M (Se:uential) -IS%M (In"e#e") -D%M (Direct) -ID%M (In"e#e" "irect)

+SAM -ierarchical se:uential access metho" (-S%M) "ata&ases use the se:uential metho" of accessing "ata. %ll "ata&ase recor"s an" all segments within each "ata&ase recor" are physically a"Jacent in storage. %n -S%M "ata&ase can &e store" on tape or on a "irect7 access storage "e!ice. -S%M "ata&ases can only &e up"ate" &y rewriting them. Delete (D$ T) an" replace () P$) calls are not allowe"+ an" insert (IS)T) calls are only allowe" when the "ata&ase is &eing loa"e". %lthough the fiel"7le!el sensiti!ity option can &e use" with -S%M "ata&ases. %lthough the uses of -S%M are limite" &ecause of its processing characteristics+ it is use" for applications re:uiring se:uential processing only. Typically+ -S%M is use" for low7use files. These are files containing+ for e#ample+ statistical reports or files containing historical or archi!e "ata that has &een purge" from the main "ata&ase. In the "ata set+ a "ata&ase recor" is store" in one or more consecuti!e &loc3s. /ou "efine what the &loc3 siKe will &e. ach &loc3 is fille" with segments of the "ata&ase recor" until there is not enough space left in the &loc3 to store the ne#t segment. .hen this happens+ the remaining space in the &loc3 is pa""e" with Keros an" the ne#t segment is store" in the ne#t consecuti!e &loc3. .hen the last segment of a "ata&ase recor" has &een store" in a &loc3+ any unuse" space+ if sufficient+ is fille" with segments from the ne#t "ata&ase recor". In storage+ an -S%M segment consists of a 17&yte prefi# followe" &y user "ata. The first &yte of the prefi# is the segment co"e+ which i"entifies the segment type to IMS. This num&er can &e from 0 to 1FF. The segment co"e is assigne" to the segment &y IMS in ascen"ing se:uence+ starting with the root segment an" continuing through all "epen"ents in hierarchic se:uence. The secon" &yte of the prefi# is the "elete &yte. Because D$ T calls cannot &e use" against an -S%M "ata&ase+ the secon" &yte is not use".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8 of 89

IMS Class Room Session


Initial entry to an -S%M "ata&ase is through *, or *4 calls. .hen the first call is issue"+ the search for the "esire" segment starts at the &eginning of the "ata&ase an" passes se:uentially through all segments store" in the "ata&ase until the "esire" segment is reache". %fter the "esire" segment is reache"+ its position is use" as the starting position for any a""itional calls that process the "ata&ase in a forwar" "irection.

+ISAM Distri&utes one "ataset into two "atasets. Is a slowest access metho" of all. .hen DBD generation ta3es place+ it suggests space+ 'I siKe etc. then accor"ingly DB% creates the two "atasets+ ESDS > SDS

E P E P E P Primary Dataset

!B# !B#

P! SK$

P! SK$

SK$

!B#

O!erflow Dataset

4ISAM data-(ase re5uires fre5uent reor6ani-ation

In a hierarchical in"e#e" se:uential access metho" (-IS%M) "ata&ase segments in each "ata&ase recor" are relate" through physical a"Jacency in storage. ach -IS%M "ata&ase recor" is in"e#e"+ allowing "irect access to a "ata&ase recor". In "efining a -IS%M "ata&ase+ you must "efine a uni:ue se:uence fiel" in each root segment. These se:uence fiel"s are then use" to construct an in"e# to root segments (an" therefore "ata&ase recor"s) in the "ata&ase. -IS%M is typically use" for "ata&ases that re:uire "irect access to "ata&ase recor"s an" se:uential processing of segments in a "ata&ase recor".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 9 of 89

IMS Class Room Session

Data&ase )ecor"5 Starting from root to the last "epen"ant is one complete "ata&ase recor". $ogical )ecor" The logical recor" is a part of "ata&ase recor"+ which can &e store" in one 'I. In a logical recor"+ the first B &ytes are a "irect7a""ress pointer to the ne#t logical recor" in the "ata&ase recor". This pointer maintains all logical recor"s in a "ata&ase recor" in correct se:uence. The last logical recor" in a "ata&ase recor" contains Keros in this fiel". 9ollowing the pointer are one or more segments of the "ata&ase recor" in hierarchic se:uence. 9ollowing the segments is a 07&yte segment co"e of A. It says that the last segment in the logical recor" has &een reache".

-IS%M "ata&ase recor"s are store" in two "ata sets. The first "ata set+ calle" the primary "ata set+ contains an in"e# an" all segments in a "ata&ase recor" that can fit in one logical recor". The in"e# pro!i"es "irect access to the root segment (an" therefore to "ata&ase recor"s). The secon" "ata set+ calle" the o!erflow "ata set+ contains all segments in the "ata&ase recor" that cannot fit in the primary "ata set. % ESDS is the primary "ata set an" an SDS is the o!erflow "ata set. $ogical recor"s are groupe" into control inter!als ('Is). % control inter!al is the unit of "ata transferre" &etween an I/O "e!ice an" storage. /ou "efine the siKe of 'Is. ach "ata&ase recor" starts at the &eginning of a logical recor" in the primary "ata set. % "ata&ase recor" can only occupy one logical recor" in the primary "ata set+ &ut o!erflow segments of the "ata&ase recor" can occupy more than one logical recor" in the o!erflow "ata set. Segments in a "ata&ase recor" cannot &e split an" store" across two logical recor"s. Because of this an" &ecause each "ata&ase recor" starts a new logical recor"+ unuse" space e#ists at the en" of many logical recor"s. .hen the "ata&ase is initially loa"e"+ IMS inserts a root segment with a 3ey of all @L99Ls as the last root segment in the "ata&ase. ach logical recor" in the primary "ata set contains the root plus all "epen"ents of the root (in hierarchic se:uence) for which there is enough space. The remaining segments of the "ata&ase recor" are put in the o!erflow "ata set (again in hierarchic se:uence). The two MpartsM of the "ata&ase recor" are chaine" together with a "irect7a""ress pointer. .hen o!erflow segments in a "ata&ase recor" use more than one logical recor" in the o!erflow "ata set the logical recor"s are also chaine" together with a "irect7a""ress pointer.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 19 of 89

IMS Class Room Session


In -IS%M+ when an application program issue a call with a segment search argument (SS%) :ualifie" on the 3ey of the root segment+ the segment is foun" &y5 0. Searching the in"e# for the first pointer with a !alue greater than or e:ual to the specifie" root 3ey (the in"e# points to the highest root 3ey in each 'I)

1. 9ollowing the in"e# pointer to the correct 'I 2. Searching this 'I for the correct logical recor" (the root 3ey !alue is compare" with each root 3ey in the 'I) B. .hen the correct logical recor" (an" therefore "ata&ase recor") is foun"+ searching se:uentially through it for the specifie" segment If an application program issues a *, call with an un:ualifie" SS% for a root segment or with an SS% :ualifie" on other than the root 3ey+ the -IS%M in"e# cannot &e use". The search for the segment starts at the &eginning of the "ata&ase an" procee"s se:uentially until the specifie" segment is foun". Picture to &e "rawn for "ata&ase -ow new segments are inserte" 6 'I split6

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 11 of 89

IMS Class Room Session


P,inte-s !se. in +D .ata/ase Types of Pointers /ou 'an Specify5 The hierarchic se:uence of segments in a "ata&ase recor" using the se:uential access metho"s is maintaine" &y 3eeping segments physically a"Jacent to each other in storage. In the -D access metho"s+ segments in a "ata&ase recor" are 3ept in hierarchic se:uence using "irect7a""ress pointers. ach pointer is B &ytes long an" consists of the relati!e &yte a""ress of the segment to which it points. Se!eral "ifferent types of "irect7a""ress pointers e#ist5 -ierarchic pointers+ which point from one segment to the ne#t in either forwar" or forwar" an" &ac3war" hierarchic se:uence Physical chil" pointers+ which point from a parent to each of its first or first an" last chil"ren+ for each chil" segment type Physical twin pointers+ which point forwar" or forwar" an" &ac3war" from one segment occurrence of a segment type to the ne#t+ un"er the same parent

.hen segments in a "ata&ase recor" are typically processe" in hierarchic se:uence+ use hierarchic pointers. .hen segments in a "ata&ase recor" are typically processe" ran"omly+ use a com&ination of physical chil" an" physical twin pointers. .hen an application program issues a call for a segment+ -9 pointers are followe" until the specifie" segment is foun". In this sense+ the use of -9 pointers in an -D "ata&ase is similar to using a se:uentially organiKe" "ata&ase. In &oth+ to reach a "epen"ent segment all segments that hierarchically prece"e it in the "ata&ase recor" must &e e#amine". -9 pointers shoul" &e use" when segments in a "ata&ase recor" are typically processe" in hierarchic se:uence an" processing "oes not re:uire a significant num&er of "elete operations. If there are a lot of "elete operations+ hierarchic forwar" an" &ac3war" pointers (e#plaine" ne#t) might &e a &etter choice. 9our &ytes are nee"e" in each "epen"ent segmentLs prefi# for the -9 pointer. ight &ytes are nee"e" in the root segment. More &ytes are nee"e" in the root segment &ecause the root points to &oth the ne#t root segment an" first "epen"ent segment in the "ata&ase recor". -9 pointers are specifie" &y co"ing PT)H- in the S *M statement in the DBD. -ierarchic 9orwar" an" Bac3war" Pointers5 .ith hierarchic forwar" an" &ac3war" pointers (-9 an" -B)+ each segment in a "ata&ase recor" points to &oth the segment that follows an" the one that prece"es it in the hierarchy (e#cept "epen"ent segments "o not point &ac3 to root segments). -9 an" -B pointers must &e use" together+ since you cannot use -B pointers alone.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 1( of 89

IMS Class Room Session

-9 an" -B pointers are specifie" &y co"ing PT)H-B in the S *M statement in the DBD.

Physical 'hil" 9irst Pointers5 .ith physical chil" first (P'9) pointers+ each parent segment in a "ata&ase recor" points to the first occurrence of each of its imme"iately "epen"ent chil" segment types. .ith P'9 pointers+ the hierarchy is only partly connecte". 4o pointers e#ist to connect occurrences of the same segment type un"er a parent. Physical twin pointers (e#plaine" later) can &e use" to form this connection. P'9 pointers shoul" &e use" when segments in a "ata&ase recor" are typically processe" ran"omly an" se:uence fiel"s are either "efine" for the segment type. If not+ new segments are not inserte" at the en" of all e#isting segment occurrences. If se:uence fiel"s are not "efine" an" new segments are inserte" at the en" of e#isting segment occurrences+ the com&ination of P'9 an" physical chil" last (P'$) pointers (e#plaine" ne#t) can &e a &etter choice. 9our &ytes are nee"e" in each parent segment for each P'9 pointer. P'9 pointers are specifie" &y co"ing P%) 4TH((name+S4*$)) in the S *M statement in the DBD. This is the S *M statement for the chil" &eing pointe" to+ not the S *M statement for the parent. 4ote+ howe!er+ that the pointer is store" in the parent segment.

Physical 'hil" 9irst an" $ast Pointers5 .ith physical chil" first an" last pointers (P'9 an" P'$)+ each parent segment in a "ata&ase recor" points to &oth the first an" last occurrence of its imme"iately "epen"ent chil" segment types. P'9 an" P'$ pointers must &e use" together+ since you cannot use P'$ pointers alone. P'9 an" P'$ pointers (as oppose" to Just P'9 pointers) are typically use" when5 4o se:uence fiel" is "efine" for the segment type. 4ew segment occurrences of a segment type are inserte" at the en" of all e#isting segment occurrences.

On insert operations+ if the IS)T rule of $%ST has &een specifie"+ segments are inserte" at the en" of all e#isting segment occurrences for that segment type. .hen P'$ pointers are use"+ fast access to the place where the segment will &e inserte" is possi&le. This is &ecause there is no nee" to search forwar" through all segment occurrences store" &efore the last occurrence. P'$ pointers also gi!e application programs fast retrie!al of the last segment in a chain of segment occurrences. %pplication programs can issue calls to retrie!e the last segment &y using an un:ualifie" SS% with the comman" co"e $. .hen a P'$ pointer is followe" to get the last segment occurrence+ any further mo!ement in the "ata&ase is forwar".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 1, of 89

IMS Class Room Session

% P'$ pointer "oes not ena&le you to search from the last to the first occurrence of a series of "epen"ent chil" segment occurrences. 9our &ytes are nee"e" in each parent segment for each P'9 an" P'$ pointer. P'9 an" P'$ pointers are specifie" &y co"ing the P%) 4TH operan" in the S *M statement in the DBD as P%) 4TH((name+DB$ )). This is the S *M statement for the chil" &eing pointe" to+ not the S *M statement for the parent. 4ote+ howe!er+ that the pointers are store" in the parent segment. % parent segment can ha!e S4*$ specifie" on one imme"iately "epen"ent chil" segment type an" DB$ specifie" on another. 'o"ing these pointers in the DBD5 DBD S *M % S *M B P%) 4TH((name.S4*$)) (specifies P'9 pointer only) S *M ' P%) 4TH((name.DB$ )) (specifie" P'9 an" P'$ pointers)

)esults in these pointers &eing create"5 Physical Twin 9orwar" Pointers5 .ith physical twin forwar" (PT9) pointers+ each segment occurrence of a gi!en segment type un"er the same parent points forwar" to the ne#t segment occurrence. 4ote that PT9 pointers can &e specifie" for root segments. .hen this is "one in an -D%M "ata&ase+ the root segment points to the ne#t root in the "ata&ase chaine" off the same root anchor points ()%P). ()%Ps are e#plaine" in a following section calle" M*eneral 9ormat of -D Data&ases an" ,se of Special 9iel"s.M) If no more root segments are chaine" from this )%P+ the PT9 pointer is Kero. .hen PT9 pointers are specifie" for root segments in -ID%M "ata&ase+ the root segment "oes not point to the ne#t root in the "ata&ase. .hat happens is e#plaine" in a su&se:uent section calle" M,se of )%Ps in a -ID%M Data&ase.M The important thing for you to 3now now is that if you specify PT9 pointers on a root segment in a -ID%M "ata&ase+ the -ID%M in"e# must &e use" for all se:uential processing of root segments. This increases access time. This pro&lem is eliminate" if you specify PT9 an" physical twin &ac3war" (PTB) pointers ("iscusse" ne#t). .ith PT9 pointers+ the hierarchy is only partly connecte". 4o pointers e#ist to connect parent an" chil" segments. Physical chil" pointers can &e use" to form this connection. PT9 pointers shoul" &e use" when segments in a "ata&ase recor" are typically processe" ran"omly+ an" you "o not nee" se:uential processing of "ata&ase recor"s. 9our &ytes are nee"e" for the PT9 pointer in each segment occurrence of a gi!en segment type. PT9 pointers are specifie" &y co"ing PT)HT in the S *M statement in the DBD. This Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 14 of 89

IMS Class Room Session


is the S *M statement for the segment containing the pointer. The com&ination of P'9 an" PT9 pointers is use" as the "efault when pointers are not specifie" in the DBD. Physical Twin 9orwar" an" Bac3war" Pointers5 .ith physical twin forwar" an" &ac3war" (PT9 an" PTB) pointers+ each segment occurrence of a gi!en segment type un"er the same parent points &oth forwar" to the ne#t segment occurrence an" &ac3war" to the pre!ious segment occurrence. PT9 an" PTB pointers must &e use" together+ since you cannot use PTB pointers alone. 4ote that PT9 an" PTB pointers can &e specifie" for root segments. .hen this is "one+ the root segment points to &oth the ne#t an" the pre!ious root segment in the "ata&ase. %s with PT9 pointers+ PT9 an" PTB pointers lea!e the hierarchy only partly connecte". 4o pointers e#ist to connect parent an" chil" segments. Physical chil" pointers (e#plaine" pre!iously) can &e use" to form this connection. PT9 an" PTB pointers (as oppose" to Just PT9 pointers) shoul" &e use" on the root segment of a -ID%M "ata&ase when you nee" fast se:uential processing of "ata&ase recor"s. By using PTB pointers in root segments+ "ata&ase recor"s can &e se:uentially processe" without inter!ening references to the -ID%M in"e#. PTB pointers impro!e performance when "eleting a segment in a twin chain accesse" &y a !irtually paire" logical relationship. This happens when the "elete that causes D%SD space to &e release" occurs on a "elete from the logical access path. ight &ytes are nee"e" for the PT9 an" PTB pointers in each segment occurrence of a gi!en segment type. PT9 an" PTB pointers are specifie" &y co"ing PT)HTB in the S *M statement in the DBD. Mi#ing Pointers5 Because pointers are specifie" &y segment type+ the !arious types of pointers can &e mi#e" within a "ata&ase recor". -owe!er+ only hierarchic or physical+ &ut not &oth+ can &e specifie" for a gi!en segment type. The types of pointers that can &e specifie" for a segment type are5 -9 -9 an" -B P'9 P'9 an" P'$ PT9 PT9 an" PTB -ierarchic forwar" -ierarchic forwar" an" &ac3war" Physical chil" first Physical chil" first an" last Physical twin forwar" Physical twin forwar" an" &ac3war"

01en a segment is .e2ete. in an +D .ata/ase3 it is 41ysi5a22y -em,6e. 7-,m t1e .ata/ase8 )1e s4a5e it ,55#4ie. 5an /e -e#se. 91en ne9 segments a-e inse-te.8

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 15 of 89

IMS Class Room Session

-D%M Define" using one "ataset+ SDS or OS%M which is logically "i!i"e" into 1 parts

)%% 'Is ()oot %""ressi&le %rea) 99991

O!erflow %rea 'is

-ow "ata is place" 6 IMS pro!i"es )an"omiKing Mo"ule (%ssem&ly language mo"ule) Eey !alue (AAAA0) will &e the input !ando1i:ing odule

Output will &e a &loc3 num&er+ which will &e %!aila&le range. If it is G+ then recor" gets Store" into Gth &loc3. -ere there is a pro&lem. If the &loc3 num&er is "uplicate"+ the recor" gets store" into same &loc3. .hich re:uires more o!erhea". Therefore re:uire" to choose proper ran"omiKing mo"ule an" num&er of )%% &loc3s. If segment is "elete" that space is a!aila&le for new segments. -D%M supports ran"om access. It "oes not support for se:uential access. 27 8-IMS 279:-VSAM 3herefore IMS used 0SAM &0;erflo* Se5uential Access Method'# ISAM 1rior to VSAM <SDS#ESDS

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 17 of 89

IMS Class Room Session


-D%M "ata&ases are typically use" when you nee" primarily "irect access to "ata&ase recor"s. The ran"omiKing mo"ule pro!i"es fast access to the root segment (an" therefore the "ata&ase recor"). -D%M "ata&ases also gi!e you fast access to paths of segments as specifie" in the DBD in a "ata&ase recor". /ou cannot process -D%M "ata&ase recor"s in 3ey se:uence unless the ran"omiKing mo"ule you use stores root segments in physical 3ey se:uence. +IDAM It ma3es use of two "ata7sets+ SDS an" ESDS

SDS 1 5 7 99

ESDS

% -ID%M "ata&ase is actually compose" of two "ata&ases. (-ID%M uses an in"e# to get to a specific root segment rather than the root anchor points use" &y -D%M.) The first "ata&ase contains the "ata&ase recor"s as the "ata&ase. The secon" "ata&ase contains the -ID%M in"e# as the in"e# "ata&ase. )oot segments in a -ID%M "ata&ase must ha!e a uni:ue 3ey fiel"+ &ecause an in"e# entry e#ists for each root segment &ase" on the rootLs 3ey. .hen initially loa"ing a -ID%M "ata&ase+ all root segments shoul" &e presente" to the loa" program in ascen"ing 3ey se:uence+ an" all "epen"ents of a root shoul" follow the root in hierarchic se:uence. 4ote that -ID%M+ unli3e -D%M+ has no root a""ressa&le or o!erflow area+ Just a series of &loc3s or 'Is. .hen "ata&ase recor"s are initially loa"e"+ they are simply loa"e" one after another in the or"er in which they are presente" to the loa" program. The space in 4ote how segments in a "ata&ase recor" are chaine" together. In this case+ hierarchic pointers were use" instea" of the com&ination of physical chil"/physical twin pointers. ach segment points to the ne#t segment in hierarchic se:uence. %lthough -ID%M "ata&ases can ha!e )%Ps+ you pro&a&ly "o not nee" to use them.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 18 of 89

IMS Class Room Session


%s each root is store" in a -ID%M "ata&ase+ IMS creates an in"e# segment for the root an" stores it in the in"e# "ata&ase. The in"e# "ata&ase consists of a single (S%M ESDS. The ESDS contains an in"e# segment for each root in the "ata&ase. .hen initially loa"ing a -ID%M "ata&ase+ IMS will insert a root segment with a 3ey of all @L99Ls as the last root in the "ata&ase. The prefi# portion of the in"e# segment contains the "elete &yte an" the rootLs a""ress. The "ata portion of the in"e# segment contains the 3ey fiel" of the root &eing in"e#e". This 3ey fiel" i"entifies which root segment the in"e# segment is for an" remains the reason why root segments in a -ID%M "ata&ase must ha!e uni:ue se:uence fiel"s. ach in"e# segment is a separate logical recor". Persistent Data 'ont=" $e5,6e-y DB)'57 Data&ase )eco!ery 'ontrol /ou nee" to "efine DB)' for e!ery "ata&ase. %ll the reco!ery process is automatic. ach an" e!ery acti!ity is recor"e" &y IMS. DB)' ma3es use of a log. .hene!er changes are ma"e to "ata&ases+ are store" in log. ,sing that DB)' "oes the reco!ery. It can &e semiautomatic that is ?'$s are create" &ut not su&mitte". DB)' is locate" in a separate a""ress space. It is in!o3e" &y an M(S start proce"ure comman" that is issue" from the IMS control region. %n IMS online system uses this separate a""ress space to contain the DB)' co"e. ach system must o&tain authoriKation from DB)' &efore it can access the "ata&ase+ e!en if the "ata&ase is not registere" for sharing. 9or area7le!el sharing+ authoriKation is o&taine" at the point in the processing when that "ata resource is re:ueste". Is,2ati,n I)$M57 IMS )esource $oc3 Manager or Internal $oc3 manager. It puts the loc3 automatically.

DB!) D$/I '!$

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 18 of 89

IMS Class Room Session

A#t,mi5ity ,7 t-ansa5ti,n: )olling &ac3 the transaction Transaction starts 'hanges 3ept in log Transaction completes 'hanges are ma"e permanent or else changes are un"one &y IMS if transaction fails 'OMMIT releases the loc3s ('hec3point)

DB/D' Dictionary57 Separate pro"uct along with IMS+ ta3es care of "ata&ase management.(catalog ser!ice)

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 19 of 89

IMS Class Room Session


Day *

)#$$ ;)B$%D$'< *S'N3

0*N)%'"N P)B '"#!E# SS#

9,4'TIO45

IS)T ) P$ D $T *, *4 *4P Program wor3ing storage area use" &y IMS to store+ retrie!e "ata. Segment Search %rgument. To inform IMS 7 which segment to wor3 on.

IO%) %5 SS%5

To insert new MP segment5 0. 1. 2. B. IS)T I/O area to &e prepare" P'B which in"icates DB Segment 4ame ( MP)

Programs are users to IMS. IMS always tal3s to you through program. PSB 0. .hich "ata&ase to &e wor3e" on5 MPDBD 1. .hich segment to &e wor3e" on5 2 segments 2. .hat is the operationN IS)T IMS won=t allow to perform any other operation+ or use any other DBD not specifie" here. This way you can o&tain control on the "ata&ase operation a program can perform.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (9 of 89

IMS Class Room Session

P'B

T/P HDB+4%M H MPDBD+P)O'OPTHI/%/I)D/*/*O4/*OT

Once this PSB is rea"y+ you can wor3 on it. 4ow "efine the segments of the "ata&ase. -ere there are 2 segments use" therefore S 4S * 4%M HOOOOOOOOOOO S 4S * 4%M HOOOOOOOOOOO S 4S * 4%M HOOOOOOOOOOO PSB* 4 4%M H MP%DD+$%4*H'OBO$ PS 4S *7Sensiti!e SegmentQ So &efore writing 'OBO$ program all these things nee" to prepare. 4ote5 ,se P)O'OPT H % %s many no. of P'B H 4o. Of "ata&ases /ou can also gi!e restriction at fiel" le!el that is one particular fiel" only shoul" get mo"ifie" an" not others

P'B 77777777777777 S 4S * 4%M H MP S 49$D 4%M H MP4%M 5 5 So here only MP4%M can &e mo"ifie". /ou cannot touch any other fiel" from that segment. IMS2!DBDLIB &1ds' contains DBD 6enerated! ,or e=am1le: EM.DBD IMS2!.SBLIB &1ds' contains .SB 6enerated! ,or e=am1le: EM.ADD

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (1 of 89

IMS Class Room Session

.hen you e#ecute IMS program+ IMS first loo3 for PSB therefore specify program name with PSBname. IMS will create one area &y ac:uiring memory. If there use multiple P'B statements it will create occurrences of that area. P'B P'B P'B P'B* 4

Program "oes not start e#ecution+ IMS first "oes its Jo& then program starts e#ecution &ecause ? S is not aware of P'B mas3. DBP'B Mas35 Definition for this area is "efine" &y IMS. -ere only concatenate" 3ey length will !ary

00 2 C

11

00

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (( of 89

IMS Class Room Session


In our case concatenate" 3ey will &e 01

E P 7

P! 7

SK$ ,

This entire pc& mas3 IMS puts into ac:uire" memory. MP7P'B7M%SE. DBD4%M H < MPDBD= P)O'OPTH=%= 4O7S 47S *H2 'O4'%T 4%T D7E /H01

This structure is 3nown as program communication &loc3. So first thing re:uire" for e#ecuting IMS Program5

0. 'reate PSB 1. Program e#ecute" 2. IMS creates P'B into its own area > not in program wor3 area. It is create" to inform you a&out your IMS operation. This is outsi"e the program wor3 area therefore nee"s to "efine P'B in lin3age section of 'OBO$ program. In the proce"ure "i!ision you shoul" write as5 P$OCED!$E DI:ISION !SIN; EMP-PCB-MAS& /ou are not suppose to change P'B. It is rea" only. If you try to change it. /ou will get %B 4D for storage !iolation

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (, of 89

IMS Class Room Session

' S S%"!#3E KE& 8

P!"3!# S%"!#3E KE& 8

$owest 3ey can operate on any high 3ey area. But if higher !alue 3ey area tries to change anything from low73ey area+ storage !iolation will occur > program will %B 4D. !en 'I'S operates at lower le!el. In case if you are using two P'Bs

P'B P'B

MPDBD P)O?DBD

$I4E%* S 'TIO4. A0 MP7P'B7M%SE 5 5 A0 P)O?7P'B7M%SE

This or"er must match

P)O' D,) DI(ISIO4 shoul" &e5 P)O' D,) DI(ISIO4 ,SI4* MP7P'B7M%SE P)O?7P'B7M%SE.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (4 of 89

IMS Class Room Session


%nother way of using P'B mas3 in Proce"ure Di!ision57 P)O' D,) DI(ISIO4. 4T)/ <D$I'B$T= ,SI4* MP7P'B7M%SERRR..(%M @ Stan"ar")

D<S$$C00 #ecute D9S))'AA program to e#ecute your IMS co&ol program. /ou Just can=t "irectly e#ecutes your Program. @ ' P*MHD9S))'AA. P*M4%M H MP%DD PSB4%M H MPPSBRRRRR.. It first loa"s P'B7mas3 into memory > then it will loa" your program into memory. Then it passes %""ress of P'B7mas3 to the program. 1 'N+EN%"!&=P)B= #SK> 95 DBD=N# E 95 SE3 EN%=$E+E$ 95 S%#%*S=)"DE 95 P!")="P%'"NS 95 0'$$E! 95 SE3 EN%=N# E 95 KE&=$EN3%95 N* B=SENS=SE3S 95 )"N)#%=KE&

?@98A> ?@9(A> ?@9(A> ?@94A S9@95A )" P ?@98A S9@95A )" P S9@95A )" P ?@11A

%his 2ill Be al2ays sa1e

%his 2ill .hange as per the seg1ent level

Assignment*: 0. 'reate test "ata 1. .rite DBD for MP+ P)O? 'T an" PSB in one single .%'B file. Eeep P)O'OPT H % 2. In!o3e '%IS,TI$

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (5 of 89

IMS Class Room Session

Day = Se6ment can ha;e onl% one SE> field If field is SE> and %ou are loo+in6 out for 2 ! It *ill sto1 search *hen it reaches 29! It *on?t search (e%ond that! )hereas if the field is SEARC4 field# it *ill search all the records! 3herefore slo*er 1erformance

In DBD* 4+ fiel"s "efine" using 9I $D other than S ; fiel" are S %)'- fiel"s. Only these fiel"s you can use in SS%. )ules are co"e" for segment ha!ing S ; fiel" &ut which is non7uni:ue. Still IMS nee"s to arrange it in or"er. *i!e it as (S ;+ M) This is non7uni:ue so "uplicates are allowe".

)y4e O7 CA'' 0. ,n:ualifie" '%$$ If '%$$ statement "oes not inclu"e SS% then that '%$$ is un:ualifie" '%$$. 1. ;ualifie" '%$$ If SS% is specifie" in a '%$$+ it is :ualifie" '%$$. )y4e O7 SSA >ualified SSA )ontaining seg1ent na1e 2ith so1e Cualifi.ation EDa1ple: E P @E PN" EE 1(,457A $n5ualified SSA )ontains Fust seg1ent na1e EDa1ple: 'NS!% E P

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (7 of 89

IMS Class Room Session

CA''S

18 ;E) !NI>!E <#n5ti,n C,.e: ?;! <#n5ti,ns: !se. t, -et-ie6e a segment !se. 7,- -an.,m a55ess 3*=================================================@#A 3* E PSE3 3* E PSE3 P!SE3 3* P!SE3==================================@BA 3* SK$SE3================================@EA 3* E PSE3 @E PN"G1(,457A========@-A ?

*nCualified )all Eualified )all Eualified SS#

(%) will gi!e first root occurrences. If SS%s are missing for any le!el+ then IMS assumes un:ualifie" SS% for that le!el. It is e:ui!alent to *, MPS *. IMS always starts search in hierarchical se:uence.

)eturn 'o"e5 * 5 Segment not foun" Blan35 Segment foun"

# E PSE3

B P!SE3

D E SK$SE3

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (8 of 89

IMS Class Room Session

28 ;E) NEX) (Se"#entia2 P-,5essing <#n5ti,n C,.e: ?;N ? <#n5ti,n: !se. t, -et-ie6e ne@t se"#entia2 segment

E PSE3 3 (,457( E PSE3 # 1(,457

P!SE3 D (9919( P!SE3 ) (99191 P!SE3 B (9991(

SK$SE3 0 9(6#+# SK$SE3 E 91)')S

CA'' *, *4 *4 *4 *4

SE;MEN) $E)$IE:ED % B ' D

$E)!$N CODE B$%4E B$%4E B$%4E B$%4E *E

COMMEN) MPS * (012BFD) MO( D %T $O. ) $ ( $

MO( D %T S%M $ ( $ B,T DI99 ) 4T S *M 4T MO( D %T -I*- ) $ ( $

*4 *4

9 *

B$%4E *%

4ow suppose if you want to retrie!e" s3ill7i" A0 of first employee Then you nee" to co"e following5 *, MPS * ( MP4OH012BFD) *4 SE$S *

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (8 of 89

IMS Class Room Session

O) *4 SE$S *(SE$IDHA0) But what if you want to retrie!e particular segment for all the employees. Say+ 9or each employee print payroll recor". So for this is use ;NP call. ;NP5 *et 4e#t .ithin Parent. *, or *4 call esta&lishes parentage. If want to use *4P+ first you ha!e to use *, or *4 to esta&lish parent. S5,4e ,7 ;NP5 %ll the "epen"ents of the particular parent. *, MPS * *4P SE$S * .ill retrie!e all the s3ill segments un"er that employee. .hen s3ill segment will en" for that employee+ you will get return co"e of ;E.

38 $e42a5e an. De2ete Ca22 <#n5ti,n C,.e: ?$EP' ? an. ?D'E)A <#n5ti,n: !se. t, -e42a5e an. .e2ete t1e s4e5i7ie. segment 0Q )ea" .ith -ol" is necessary &efore you wor3 on with these calls *-,+ *-4+ *-4P 1Q .hile replacing+ 3ey portion cannot &e mo"ifie" 2Q 9or "elete call "o not mo!e anything into segment area. 3-* E PSE3 @E PN"G1(,457A D$E% @here no need to spe.ify Cualifi.ationH it 2ill 2ork on old .allA 3-* E PSE3 @E PN"G1(,457A "+E IIIIIIIII>> D$E% @here it 2ill give return .ode ;D?<A

BQ Once MP segment is "elete" all the "epen"ents of this segment will get "elete".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page (9 of 89

IMS Class Room Session

FQ Some other formats you can use5 3-* 3-N E PSE3@E PN"G1(,457A P!SE3===@L @, D$E% J indi.ates )o11and )ode 0ollo2s %hree spa.es go for last P!SE3 go for first P!SE3

) P$ > D$ T must &e prece"e" &y -O$D call. Otherwise IMS will gi!e you the return co"e <D%=+ <D?=

Stat#s 5,.es y,# 5an e@4e5t .#-ing se"#entia2 4-,5essing

Stat#s C,.e Blan3

* *B

*%

*E *P

Des5-i4ti,n Blan3 in the P'B status co"e after *4 or *4P call in"icates that the call was successful Segment not foun" 'an occur with *4 &ut not with *4P call. It in"icates that you=!e trie" to retrie!e a segment+ &ut are at the en" of "ata&ase. It is li3e %T 4D con"ition raise" "uring 'OBO$ ) %D statement. .hen you reach the en" of "ata&ase with *4P call+ D$/I returns the * status co"e. .hen an un:ualifie" *4 or *4P call mo!es to upper le!el in the hierarchy to retrie!e a segment )aise" &y un:ualifie" *4 or *4P at same hierarchical le!el &ut "ifferent segment. *4P is gi!en &efore esta&lishing a parentage

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,9 of 89

IMS Class Room Session


Day 6 A442i5ati,n C,nt-,2 B2,5B -ierarchical access metho" is a general purpose routine But we "on=t want all the routines to &e run .e nee" to ha!e customiKe" !ersion of -ierarchical %ccess Metho" So to customiKe this use P)O'OPT

$est-i5t an" P-,6i.e access re:uires &uffers. %ccess Metho" cannot wor3 "irect with PSB. %'B is the com&ine" !ersion of PSB an" DBD. Buffer creation for DBD segments is "one &y use of %'B. In a mainframe+ un"er &atch mo"e i.e. D$/I en!ironment. IMS initialiKation nee"s to &e "one &efore program starts e#ecution. @ ' P*MHD9S))'AA P%)M (D$/I+RRRRRRRRRR.)

In D$/I &atch mo"e+ generation of %'B is "ynamically in!o3e". D9S))'AA loo3s PSB > ta3e correspon"ing DBD an" create the %'B &loc3 > then create P'Bs. %fter this it gi!es control to your program an" then the e#ecution starts. If this facility is a!aila&le in &atch D$/I+ then why it is not in Online6 .hy in Online+ %'B &loc3 generation is re:uire"6 Since in Online programs response time is critical therefore instea" of creating it "ynamically it is generate" first. ach program triggers %'B generation therefore in Online it is generate" first. It is a separate entity store" in %'B$IB.

In DBBA3C4 &ne*er ;ersion' in (atch en;ironment &.ARMA&DBB#B!!''# ACB should (e 6enerated in ad;ance li+e online Assem(l% lan6ua6e code routines are stored as a mem(er of SCS2!RESLIB ,ind out ho* man% mem(ers are 1resent in ACBLIB )hether man% .SB can reside in one ACBD

S#mma-y:-In D$/I In Online 7%'B creation is "ynamic (,sing D9S))'AA in ),4 ?'$)

7%'B* 4 is re:uire" (Sa!es Time) %lso in DBB (newer !ersion) 7%'B* 4 is re:uire"

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,1 of 89

IMS Class Room Session


IMS/DC Ser!ice %rchitecture

%ools

Pro.ess

!e.eption

*ser Data $ayer Business $ayer Presentation $ayer *ser *ser

#ample5 Enowle"ge7ware 'o. #perts -ome $i&rary Books anuals Periodi.als Phy !ef> Papers : : : : : P ) # aths s Deli!ery ,ser !e.eption

'all to #pert anager P ) 9orms to &e processe"

'up&oar" for Blan3 9orms #

Blan3 form 777777(II) 9ille" in form777(III) ,serS(I)

)eception slots

Deli!ery Tray 9orms to &e "eli!ere" Data $ayer Business $ayer Presentation $ayer

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,( of 89

IMS Class Room Session


)eception )esponsi&ilities5 0. Pro!i"e Blan3 forms 1. %ccept fille" in forms 2. Deli!er reply #perts are <on call= e#perts Physics an" %strophysics are high priority Jo&s Manager will ta3e "ecision &ase" on 0. Priority 1. )esources (4o. of ca&ins) 2. $oa" If it is Just one re:uest+ /ou may not call e#pert. /ou will ha!e a policy for when to call e#pert. #pert .or3 9low 0. 1. 2. B. F. Ta3e form Process reply7after7referring7li&rary Put into "eli!ery tray )epeat step 0 thru 2 until no re:uest *o -ome

IMS/DC ,- IMS/)M P3 $'B Programs -ome )ontrol !egion ' S/ DB ' S/ D PP !egion "ut Out

;manager

0S$'B

PP !egion In 0S ,ser ,ser ,ser /9O) P-/

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,, of 89

IMS Class Room Session

M9S loo3s for physics form in M9S$IB an" gi!es it to user. .ho will "esign the physics forms6 Total B forms to &e "esigne" an" 3ept in M9S$IB. ,ser will enter "ata in physics form an" presses enter. 4ow M9S will put this in ;M*). 0e nee. t, 4-,6i.e t1ese /2anB 7,-ms8 Same as CICS BMS ma4s

Managers .or3 Sheet5 $e"#i-ement Physics 'hemistry Maths %strophysics P-i,-ity 1 2 B 0 P-,g-am Phy pgm. 'he pgm. Math pgm. %stro pgm. A..-ess 777777 777777 777777 777777

0,-Bs1eet is 4-,6i.e. /y y,#8 Same as CICS PP) ta/2e ent-y

Manager will call associate" program "epen"ing on the priority gi!en. IMS is not aware of this wor3sheet. So some&o"y has to inform that there are "ifferent forms+ with associate" e#perts. Once Program is loa"e"+ it will ta3e forms from ;M*) until no more forms.

Pseu"oco"e for su&Ject matter e#pert wor3 flow5 )ecei!e 9orm Perform P-,5ess ,ntil no7more7form *o &ac3 P-,5ess8 9in" the re:uire" information Sen" form with "etails )ecei!e form

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,4 of 89

IMS Class Room Session

Day C MPO E P#DD E PN": E PN# E: #DD!ESS: KKKKKKK KKKKKKK KKKKKKK

/9O) MPO M9S will pic3 up MPO from M9S$IB an" sen" it to terminal. ,ser will enter "etails an" form goes to ;M*) when user presses 4T ). There shoul" &e i"entification form each form. So accor"ingly it gets store" in ;M*). <n= num&er of users can in!o3e same form to enter "etails. G characters transaction7i" is associate" for each screen. 'ontrol region pro!i"es this facility of system "efinition. It uses 1 macros 0. Transact 1. %pplctn %fter typing transaction i" at the terminal+ program is loa"e" into memory > starts e#ecution. 3erminolo6% CICS >uasi-reentranc% IMS Serial reusa(ilit%

If any program fails+ IMS pro!i"es transaction support to un"o all changes. 'ontrol region pro!i"es a log where IMS writes. %ll the entries li3e pgm0 start+ pgm1 start +empa"" "elt are store" into log. e1ory Disk %ape

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,5 of 89

IMS Class Room Session

.hen transaction is un"er e#ecution+ changes are put into memory. %ll re:uests go through control region. So that in case of failure control region un"o the changes. That=s how control region 3eeps trac3 of all "ata&ase changes. Program shoul" not "irectly tal3 to "ata&ase. It shoul" &e thru control region. If program 1 fails control goes &ac3 to control region. It will loo3 out for the changes in the log for program 1 an" un"o the changes. Therefore IMS pro!i"es atomicity to un"o the changes. IMS tal3s to "ata&ase on &ehalf of program Isolation is a!aila&le &y I)$M. %t the time of IMS generation+ select 5 0. IMS 'omponent Program Isolation Manager (In7&uilt) or I)$M 1. DB)' /es/4o .hile testing your program in &atch D$/I mo"e+ DB)' is 4. Because here you are wor3ing on "ummy "ata&ases or copy of "ata&ases. /ou are not wor3ing on real "ata&ases. Therefore DB)' is not re:uire" o!er here. -ere "ata&ases are use" for the creation of test "ata. If anything fails you Just ha!e to reloa" the "ata > start again. Therefore DB)' is <4= here. In real application it must &e </=.

'!$

DB!)

D$/'

)! ;M*)

' S/DB

P3 1 P3 P3 ( , 0S

,sers

%&o!e en!ironment is a normal en!ironment+ which run "uring office time (C7D) /ou run &atch program "uring off time i.e. after D pm. So "uring office time+ control region will ta3e charge of all the "ata&ase. If you try to use any "ata&ase for &atch Jo&+ you won=t get e#clusi!e control o!er it since control region is ha!ing e#clusi!e control on all the "ata&ases. Therefore you ha!e to use this "ata&ase for &atch Jo& after Dpm.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,7 of 89

IMS Class Room Session


But if online en!ironment uses "ata&ases for 1B hours+ when the &atch Jo& will run6 74ee"s to put this &atch Jo& into memory.

D$/' Memory PP pg11 PP pg1( PP pg1, PP pg14 B P pg11

)! ;mgr

In a :ueue all messages gets accumulate" > then once in a "ay or so get processe" &y &atch program. This won=t ha!e trans7i" associate" to any program. 'ontrol region won=t sche"ule for this. There are two types of BMP57 0. Transaction Oriente" BMP 1. Batch Oriente" BMP Process 0. 1. MPP5 Imme"iately BMP7Transaction5 Defer7%ccumulate(accumulate" into :ueue > processe" &y &atch pgm)7Process .hen6 0 "ay+ 0wee3+ 0 month5 "epen"s on Business nee"s BMP7Batch5 %ccumulate" &y some&o"y7file -ere e!ents are capture" &y thir" party an" gi!en to us as files

2.

Data&ases are always in share" mo"e+ therefore we ha!e to use BMP.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,8 of 89

IMS Class Room Session


IBM )e-mina2 IBM terminals are 21IA compliant. %ttention i"entifiers for this terminal type are as follows5 0. nter 1. P90 to P91B 2. P%0 to P%2 B. '$ %) %ttri&ute &yte prece"es e!ery fiel" on screen. 4MDS5 4ati!e Mo"e Data stream format. %ttri&utes+ fiel"s an" e#ten"e" "ata characteristics+ positions etc. is gi!en here. 4MDS is un"erstoo" &y terminals > it "isplays the "ata on 21IA terminal format .hile sen"ing 4MDS H My"ata T De!ice 'haracteristics .hile recei!ing My"ata H 4MDS 8 De!ice 'haracteristics T the %ID 3ey presse" So if you see De!ice 'haracteristics in common in &oth the operations. Therefore it is goo" to use common utility which will wor3 on terminal characteristics an" My"ata. This process in IMS is "one &y M9S

Screen Definitions (9iel"s > attri&utes) 0S #B) )o1pany My"ata E1pno: Na1e :

My"ata T %i" Eey

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,8 of 89

IMS Class Room Session


Day D

Data T 9ormat T De!ice 'haracteristics 1B+GA 5 Terminal type (21IA+1) 9ormat5 0. 1. 2. B. Position %ttri&ute Initial (alue $ength

Terminal

9ormat+ "e!ice characteristics an" %ID 3ey presse" this information you shoul" gi!e to IMS. A11lication .ro6rammin6 3ransaction Manual contains information a(out de;ices under :E9" cate6or% *ith full s%nta=!

Att-i/#tes: P)OT ,4P)OT -I 4O)M 4ODISP MOD 4OMOD %$P-% 4,M

4ote5 0. Eeep all the fiel"s on screen as %$P-% only. In a program you ta3e care of numeric an" "ecimal place etc. !ali"ation are "one in program only. 1. %fter pressing %ID 3ey+ terminal har"ware will sen" &ac3 only mo"ifie" fiel"s. It 3eeps trac3 of it &y one &it in attri&ute &yte+ which is MOD or 4OMOD. 2. '$ %)+ P%0 to P%2 3eys ha!e special meaning for IMS. Data is not transmitte" for these 3eys. Only IMS wor3s on these 3eys.

9ollowing is a MP%DD.M9S co"e5

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page ,9 of 89

IMS Class Room Session

P)I4T 4O* 4 If you gi!e <AA'A=+ all the fiel"s are cleare" TIT$ L%DD MP S') 4L &efore sen"ing the screen to the terminal. UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU %DD MP 9MT D ( T/P H(21IA+1)+ @ 9 %THI*4O) + @ S/SMS*HM S*1+ Only unprotecte" fiel"s @ DS'%HLAA%AL+ are cleare" @ P9EH(P9E9$D1+LA0L+LA1L+LA2L+LABL+LAFL+LADL+LAIL+LAGL+ @ LACL+L0AL+L00L+L01L+L02L+L0BL+L0FL+L0DL+L0IL+L0GL+L0CL+ @ L1AL+L10L+L11L+L12L+L1BL) DI( T/P HI4O,T DP%* ',)SO)H((G+2F))+ @ 9I$$HPT D9$D LS/4T $ MP$O/ S/ST ML+ @ POSH(1+10)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) D9$D LUUUUUUUUUUUUUUUUUUUUUUL+ @ POSH(2+10)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) D9$D L%DD MP$O/ L+ @ POSH(F+1I)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) D9$D L777777777777L+ @ POSH(D+1I)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) D9$D L MP 4O5 L+ @ POSH(G+11)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) MP4O D9$D POSH(G+2F)+ @ $T-HD+ @ %TT)H(,4P)OT+%$P-%+4O)M+MOD) D9$D L MP 4%M 5 L+ @ POSH(0A+11)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) MP4%M D9$D POSH(0A+2F)+ @ $T-H2A+ @ %TT)H(,4P)OT+%$P-%+4O)M+MOD) D9$D L MP %DD) SS5 L+ @ POSH(01+11)+ @ %TT)H(P)OT+%$P-%+-I+4OMOD) MP%DD) D9$D POSH(01+2F)+ @ $T-HBA+ @ %TT)H(,4P)OT+%$P-%+4O)M+MOD)

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 49 of 89

IMS Class Room Session


D9$D LP92 7 B%'E TO M 4, 4T ) 7 TO P)O' SSL+ POSH(11+10)+ %TT)(P)OT+%$P-%+-I+4OMOD) POSH(12+1)+ $T-HIC+ %TT)H(P)OT+%$P-%+-I+4OMOD) @ @ @ @

M S*1

D9$D

9MT 4D U %DDI MS*

M9$D M9$D M9$D

M9$D

M9$D

MS* 4D U %DDO MS*

T/P HI4P,T+ SO)H(%DD MP+I*4O) )+ 4@TH%DDO S * <M9ST)4A1L+ $T-HG (P9E9$D1+LAAL)+ $T-H1 MP4O+ $T-HD+ ?,STH)+ 9I$$H'LAL MP4%M + $T-H2A+ ?,STH)+ 9I$$H'L L MP%DD)+ $T-HBA+ ?,STH)+ 9I$$H'L L

@ @ 4T ) 3ey

@ @ @ @ @ @ @ @ @ @ @

S * M9$D

M9$D

M9$D

M9$D

T/P HO,TP,T+ @ SO)H(%DD MP+I*4O) )+ @ 4@TH%DDI .hen %TT)H/ S+ length is increase" &y 1 &ytes MP4O+ @ $T-HG+ @ %TT)H/ S MP4%M + @ $T-H21+ @ %TT)H/ S MP%DD)+ @ $T-HB1+ @ %TT)H/ S ))MS*+ @ $T-HIC

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 41 of 89

IMS Class Room Session


MS* 4D 4D

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 4( of 89

IMS Class Room Session


'OBO$ 'opy Boo3

91 'NP*%= S3> 95 'NP*%=$$ 95 'NP*%=LL 95 'NP*%=%!#N 95 'NP*%=P0KE& 95 'NP*%=N" 95 'NP*%=N# E 95 'NP*%=#DD! 91 "*%P*%= S3> 95 "*%P*%=$$ 95 "*%P*%=LL 95 "*%P*%=N"=#%%! 95 "*%P*%=N" 95 "*%P*%=N# E=#%%! 95 "*%P*%=N# E 95 "*%P*%=#DD!=#%%! 95 "*%P*%=#DD! 95 "*%P*%= ES31=#%%! 95 "*%P*%= ES31

P') P') P') P') P') P') P') P') P') P') P') P') P') P') P') P') P')

S9@9,A S9@9,A ?@98A> ?@9(A> ?@97A> ?@,9A> ?@49A> S9@9,A S9@9,A ?@9(A> ?@97A> ?@9(A> ?@,9A> ?@9(A> ?@49A> ?@9(A> ?@89A>

)" P> )" P>

)" P +#$*E M175> )" P +#$*E M9>

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 4, of 89

IMS Class Room Session


Day E

-ow DD statements for "ata&ases are gi!en6 Ta3e DD names from DBD* 4 > "ataset names (physical names) from DB%. If you want to test the D$/I program+ you allocate "ataset for yourself+ you cannot use pro"uction "ataset. Populate the "ataset from pro"uction "ataset recor"s. ,ind out data(ase/dataset# 1s(-name namin6 standards! &I' Get the list of 1roduction data(ase F corres1ondin6 datasets!&3a+e hel1 of DBA or onsite 1erson' &II' Cou *ant to test a 1ro6ram so %ou should +no* *hich datasets %ou are usin6! ,or this refer to .SBGEG for the 1ro6ram A! Get the dataset names B! $sin6 list &II' datasets as model# allocate datasets for test! &$se ,ile-Aid'! So usin6 this em1t% dataset *ill 6et allocated C! Load test data usin6 A! M3D B! Select some data se6ments from the 1roduction dataset i!e! e=tract records from 1roduction usin6 file-aid! But tests dataD )e don?t +no* *hether it co;ers all the conditions or not! If %ou modif% this test data# then it should (e u1dated else*here! It mi6ht (e usin6 secondar% inde= etc! 3herefore it is not a relia(le method of creatin6 test data! C! Re== routine for test data! DD names F dataset names are 6i;en in test HCL!

S)EP'IB DD points to IMS.) S$IB+ which contains the IMS nucleus an" re:uire" action mo"ules. It must &e authoriKe". P$OC'IB DD points to IMS.P)O'$IB+ which contains all cataloge" proce"ures an" Jo&s for IMS. S%S!D!MP DD "efines a "ump "ata set. This DD statement is optional. The following DD Statements are optional+ "epen"ing upon your particular re:uirements. D<SC)' DD contains the S T) an"/or S TO statements to specify the processing options an" ranges re:uire" at sche"uling time. The S TO (S T Options) statement pro!i"es the a&ility to set the processing options to control the e#ecution of -SSP. The S T) (S T )ange) statement is use" to restrict access to specifie" parts of a D DB.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 44 of 89

IMS Class Room Session

D<SS)A) DD "efines a "ata set "escri&ing DB call an" &uffering acti!ity "uring an applicationLs e#ecution. The reports are written when the application terminates. If you are intereste" in recei!ing //D9SST%T reports+ inclu"e a //D9SST%T DD statement in this proce"ure. %n e#ample of this statement follows5 //D9SST%T DD S/SO,TH% 9or more information on these reports+ see IMS/ S% Data&ase %"ministration *ui"e. IMS DD %"" an IMS DD statement for IMS.PSB$IB+ concatenate" with IMS.DBD$IB+ if *S%M "ata&ases are accesse" &y the &atch application. The statements are5 //IMS DD DS4HIMS.PSB$IB+DISPHS-) // DD DS4HIMS.DBD$IB+DISPHS-) The PSB for the &atch application program must &e containe" in the IMS.PSB$IB+ an" the DBDs for the *S%M "ata&ases reference" &y the PSB must &e containe" in the MS.DBD$IB. D9S S$ DD .hen the SSM parameter is specifie" (or "efaulte" to &y specification in the control region)+ the su&system li&raries+ which must &e %P9 authoriKe"+ must &e a!aila&le to this region. If ?OB$IB/ST P$IB/$I4E$IST concatenation is not authoriKe"+ you must use the D9S S$ DD statement. 9or online IMS regions+ the su&system li&rary or li&raries must &e concatenate" after the li&rary containing the IMS mo"ules (usually IMS.) S$IB). .hen multiple su&systems are connecte"+ a""itional su&system "ata sets can &e concatenate".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 45 of 89

IMS Class Room Session

%ransa.tion $og Thru= 'ontrol region D$/' )!

Data&ase 'all

PP 4o ?'$ PP Data&ase 'all

4o ?'$

B P ?'$

-ere how you get the "ataset names an" ""names6 %ll the "ata&ases information is a!aila&le with control region therefore the "" statements shoul" &e 3nown to control region for BMP programs. .e are not re:uire" to gi!e ""names > "atasets names since they are a!aila&le with IMS control region.

IMS 4-,g-am E@e5#ti,n

0. 1. 2. B.

$og on to IMS region IBM screen will &e in front of user Inform a&out Transaction7i" of M Screens MPM 4,I MP%DDI MP$ISTI

4, program MPM 4,O MP%DDO MP$ISTO

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 47 of 89

IMS Class Room Session

.hat will happen when following is type" in5 0. /9O) MPM4,O

(III) 0S$'B IMS (II) /0"! E P N*" 0S (I) 1> (> EN* #DD 'NE*'!&

1.

MPM4,O

)ontrol !egion 'hec3 for !ali" transaction i". E1gr 0S / E P N*" *nkno2n %ransid

2.

MPT)4A0 (ali" Transaction I". $$+ VV+ MPT)4A0 (total 01 &ytes) Message is create" in :ueue with length 01+ rest all will &e spaces. Program associate" with MPT)4A0 will &e starte" &y IMS an" program will "isplay a sreen.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 48 of 89

IMS Class Room Session

,ser (I Transaction I" ;ueue $$ LL

System

E P%!N91 E PP3 91

* T ) ;, ST A0 re:uest (II $$ 777777 01 VV 777777 A MPT)4A0 enu Pf1: #dd Pf(: 'nCuiry :

01 &ytes

S 4D M 4, Screen (III

If P90 is Presse"

(I:

$$ 777777 0B VV 777777 A MPT)4A0 A0 $$ LL

0B &ytes

IIIIII 91

* T ) ;, ST A0 re:uest (: $$ 777777 0B VV 777777 A 0B &ytes MPT)4A0 A0 (:I Program !ali"ates 3ey presse" if 3ey is !ali" transfer control to respecti!e program else "isplay error message on screen

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 48 of 89

IMS Class Room Session


There are four maJor actions in!ol!e" in this processing 0. 1. 2. B. get re:uest "isplay screens transfer analyKe MO( <%4%$/V = TO 4 @T7%'TIO4. P )9O)M P)O' SS7) ;, ST T-), P)O' SS7) ;, ST7 @IT ,4TI$ OT. P)O' SS7) ;, ST S 'TIO4. I9 4 @T7%'TIO4 H <%4%$/V = P )9O)M %4%$/SIS T-), %4%$/SIS7 @IT $S I9 4 @T7%'TIO4 H <T)%4S9 )= P )9O)M T)%4S9 ) T-), T)%4S9 )7 @IT $S I9 4 @T7%'TIO4 H <) P$/7B%'E= P )9O)M ) P$/7B%'E T-), ) P$/7B%'E7 @IT $S )))O (%B 4D) O4 P' *I( DI(ID 0 B/ V )O TO %B 4D P)O' SS7 @IT. @IT. %4%$/SIS S 'TIO4. 'hec3 for $$ fiel". I9 $$7I4P,T H 01 MO( SP%' S TO ))MS* MO( <) P$/7B%'E= TO 4 @T7%'TIO4 *O TO %4%$/SIS7 @IT. I9 $$7I4P,T H 0B I9 in!ali" P9 3ey MO( <I4(%$ID E /= TO ))MS* MO( <) P$/ B%'E= TO 4 @T7%'TIO4 *O TO %4%$/SIS7 @IT. I9 P9E9$D H <A0= MO( < MP%DD= TO .S7P*M74%M $S I9 P9E9$D H <A1= MO( < MP$IST= TO .S7P*M74%M $S MO( <T)%4S9 )= TO 4 @T7%'TIO4. %4%$/SIS7 @IT.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 49 of 89

IMS Class Room Session


@IT. ;et !ni"#e Ca22

'all

<'B$TD$I=

*, IO7P'B I4P,T7MS*7%) %.

%ll system ser!ice call wor3s with IO7P'B If IO7ST%T,S7'OD 7P'B H <;'= Mo!e <y= to no7more7mesg lse If IO7ST%T,S7'OD 7P'B 4OT H <;'= %4D 4OT H SP%' S '%$$ error routine n"7if n"7if

'all

<'B$TD$I=

IS)T IO7P'B O,TP,T7MS*7%) %.

'hec3 for &lan3 status co"e. Mo!e <y= to en"7of7transaction.

IO-PCB 91 '"=P)B> 95 '"P)B=$%E! P') 95 0'$$E! P') 95 '"P)B=S%#%*S=)"DE P') 95 '"P)B=6*$'#N=D#%E P') 95 '"P)B=%' E="0=D#& P') 95 '"P)B= S3=SEE P') 95 '"P)B= "D=N# E P') 95 '"P)B=*SE!='D P') A2te-nate PCB 91 %!#NS0E!=P)B> 95 %!#NS0E!=$%E! P') ?@98A> 95 0'$$E! P') ?@9(A> 95 %!#NS0E!=S%#%*S=)"DE P') ?@9(A> Developed By: Shilpa Keluskar & Suvarnalata Naik

?@98A> ?@9(A> ?@9(A> S9@98A )" P=,> S9@98A )" P=,> S9@98A )" P> ?@98A> ?@98A>

Page 59 of 89

IMS Class Room Session

PSBs shoul" ha!e a P'Bs in the following or"er5 0. 1. 2. B. IO7P'B %$T )4%T 7P'Bs DB7P'Bs *S%M7P'Bs

%n Online programs get IO7P'B automatically. Therefore BMP programs will get IO7P'B automatically. 4ote5 9or )ealia+ in .%'B file a"" following statement5 P'B T/P HTP+MODI9/H/ S PSB* 4 4%M HRRRRRRRRRRRRRRRR

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 51 of 89

IMS Class Room Session


Day 10 Se5,n.a-y In.e@ .hen DB% "esigns the "ata&ases they "esign them on the &asis of certain application nee"s. They will come up with the segments+ fiel"s+ 3ey fiel"s > the structure of the "ata&ase. -owe!er the "esigne" structure may not &e suita&le for all applications. One may nee" to !iew the "ata using "ifferent !iew. Secon"ary in"e#ing ena&les the application to "esign their own "ata structure. Secon"ary in"e#ing is a solution to the "ifferent processing re:uirements of !arious applications. It allows you to ha!e an in"e# &ase" on any fiel" in the "ata&ase+ an" not Just the 3ey fiel" in the root segment. Secon"ary in"e#es can &e use" with -IS%M+ -D%M+ an" -ID%M "ata&ases. % secon"ary in"e# is in its own separate "ata&ase an" must use (S%M as its access metho". Because a secon"ary in"e# is in its own "ata&ase+ it can &e processe" as a separate "ata&ase. Secon"ary in"e#es are in!isi&le to the application program. .hen an application program nee"s to "o processing using the secon"ary in"e#+ this fact is communicate" to IMS &y co"ing the P)O'S ;H parameter in the P'B. If an application program nee"s to "o processing using the regular processing se:uence+ P)O'S ;H is simply not co"e". If the application program nee"s to "o processing using &oth the regular processing se:uence an" the secon"ary in"e#+ the application programLs PSB must contain two P'Bs+ one with P)O'S ;H co"e" an" one without. .hen two P'Bs are use"+ it ena&les an application program to use two paths into the "ata&ase an" two se:uence fiel"s. One path an" se:uence fiel" is pro!i"e" &y the regular processing se:uence+ an" one is pro!i"e" &y the secon"ary in"e#. The secon"ary in"e# gi!es an application program &oth an alternati!e way to enter the "ata&ase an" an alternati!e way to se:uentially process "ata&ase recor"s. % final characteristic of secon"ary in"e#es is that there can &e 21 secon"ary in"e#es for a segment type an" a total of 0AAA secon"ary in"e#es for a single "ata&ase.

'oncatenate" Eey5 ,se" in -IS%M+ -D%M+ -ID%M. Pointer is a num&er+ which is use" to reference a particular segment. To get employee information for particular s3ill then you will use empno an" s3illi" as a concatenate" 3ey. If concatenate" 3ey is use" as pointer then all the 3eys in!ol!e" in that concatenate" 3ey must &e uni:ue. )B%5 %nother way of locating segment. 'an &e use" in -D%M an" -ID%M. 9or -IS%M use 'oncatenate" Eey. In -IS%M )B% is not fi#. It changes as new split ta3es place in control inter!al therefore )B% !alue changes accor"ingly therefore in -IS%M you cannot use )B% to locate a segment. .hereas in -ID%M+ the )B% remains unchange".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 5( of 89

IMS Class Room Session

IMS )e-min,2,gy Sym&olic ('oncatenate" Eey). Direct ()B%). This is more efficient &ut has restriction of not &eing use" for -IS%M. *, MP ( 4%M ; %B')

%ll search fiel"s can also &e use" to :ualify a segment &ut here performance as compare" to se:uence fiel" will &e lowere"+ &ecause it will scan all the root segment occurrences till it fin"s ename %B'. Search fiel" cannot &e use" to pro"uce a list in ascen"ing or"er of the search fiel". In (S%M the solution for this is <%lternate In"e#es=. So we nee" to "efine another in"e# on 4%M . In IMS it is referre" as Secon"ary In"e#. If there are more employee with same nameW IMS resol!es this pro&lem &y intro"ucing another SDS file. So Secon"ary in"e# is ESDS plus SDS file.

N# E

P%!

( ,

IIIIIII>

%ll other pointers pointing to that name.

In IMS all things are in terms of "ata&ase therefore you nee" to "efine secon"ary in"e# "ata&ase. In"e# "ata&ase will &e a root only "ata&ase+ which contains search fiel" an" pointer N# E P%!

If search fiel" is not uni:ue+ another "ataset gets a""e" to this "ata&ase an" together this is your secon"ary in"e# "ata&ase.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 5, of 89

IMS Class Room Session

DataBase ESDS N# E P%! 9irst Match SDS P%! P%! P%! IIII>> Secon" Match an" so on

-ere there is "elay in access therefore IMS "oes not recommen" to 3eep secon"ary in"e# as nonuni:ue. .hich is not practical. IMS pro!i"es some mechanism for ma3ing In"e# 3ey uni:ue. 0. In"e#e" fiel" can &e ma"e of (up to) F fiel"s in any or"er i.e. in"e# can &e &uilt on com&ination of multiple fiel"s. 1. /ou can a"" upto F fiel"s as su&7se:uence fiel"s. But IMS will loo3 for main in"e# fiel" only. !en programmers will see Just 4%M fiel" only. Su&7se:uence fiel"s are not !isi&le to program. IMS uses them to ma3e 3ey uni:ue an" a!oi" o!erhea" of SDS. 9or IMS N# E SuB=seC=field P%!

9or programmer

-ere "uplicates are not a!oi"e" &ut now they are store" into one "ataset therefore re"uce" o!erhea". %s a programmer you "on=t ha!e access to su&7se:uence fiel". Programmer has to ta3e care of "uplicates. 2. Inspite of using su&se:uence fiel"+ you cannot guarantee to ma3e 3ey uni:ue+ So IMS uses system relate" fiel"5 /S@ ("irect Pointer) an" /'E ('oncatenate" Eey) /S@5 IMS uses in"e# fiel" an" )B% (-D%M+-ID%M) /'E5 IMS uses in"e# fiel" an" concatenate" fiel" (-IS%M+ -D%M+ -ID%M)

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 54 of 89

IMS Class Room Session

Some Terminology in Secon"ary In"e#es5

)a-get Segment: One+ which is retrie!e" using secon"ary in"e#. S,#-5e Segment: One+ which supplies !alues for secon"ary in"e#. P,inte- Segment: One+ which stores supplie" 3ey !alue an" pointers to target segment. 9or e#ample5 Secon"ary In"e#5 4%M Source Segment5 MPS * Target Segment5 MPS * Pointer Segment5 In"e# "ata&ase segment Target an" source segment nee" not &e same. If we want to &uil" secon"ary in"e# on s3ill then create s3ill7i" secon"ary in"e#. -ere again many employees will ha!e same s3ill7i". If use" /'E Secon"ary In"e#5 SEI$$ID Source Segment5 SE$ Target Segment5 MPS * Pointer Segment5 In"e# "ata&ase segment+ which is rootonly

Skill=id

)K P%!

To employee

.ill &e of SE$ segment empi" T s3li"

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 55 of 89

IMS Class Room Session


%ssignment5 Secon"ary In"e#: Name
P)I4T 4O* 4 DBD 4%M H MP7DBD+%'' SSH(-IS%M+IS%M) D%T%S T DD0HP)IM +O(9$.HO( )9$O.+D (I' H22FA S *M 4%M H MP+P%) 4THA+B/T SHID 9I $D 4%M H( MP4O+S ;+,)B/T SHD+ST%)TH0+T/P H' 9I $D 4%M H MP4%M +B/T SH2A+ST%)THI+T/P H' 9I $D 4%M H MP%D)+B/T SHBA+ST%)TH2I+T/P H' 9I $D 4%M H/'E0+B/T SHD $'-I$D 4%M H(4%M S *+4%M DBD)+POI4T )HI4D @ @D9$D 4%M H@4%M +S *M 4TH MP+S)'-H MP4%M +S,BS ;H/'E0 S *M 4%M HP%/)O$$+P%) 4TH MP+B/T SH01 9I $D 4%M H(P)////MM+S ;+,)+B/T SHD+ST%)TH0+T/P H' 9I $D 4%M HP%/%MT+B/T SHD+ST%)THI+T/P H' S *M 4%M HSEI$$+P%) 4TH MP+B/T SH2F 9I $D 4%M H(SEI$$ID+S ;+,)+B/T SH2+ST%)TH0+T/P H' 9I $D 4%M HSEI$$4%M +B/T SH2A+ST%)THB+T/P H' 9I $D 4%M H @P/)S+B/T SH1+ST%)TH2B+T/P H' DBD* 4 9I4ISDBD 4%M H4%M DBD+%'' SSH(-IS%M+IS%M) 4ame D%T%S T DD0HP)IM +O(9$.HO( )9$O.+D (I' H22FA 4ameH2A+4o.HD S *M 4%M H4%M S *+P%) 4THA+B/T SH2D If /S@ then &ytesH2B+ 2ATB 9I $D 4%M H(S '4%M +S ;+,)+B/T SH2D+ST%)TH0+T/P H' $'-I$D 4%M H( MP+ MP7DBD)+I4D @H@4%M +POI4T )HS4*$ )B% DBD* 4 9I4IS4D

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 57 of 89

IMS Class Room Session


Secon"ary In"e#: Name3 SBi22-Name
P)I4T 4O* 4 DBD 4%M H MP7DBD+%'' SSH(-IS%M+IS%M) D%T%S T DD0HP)IM +O(9$.HO( )9$O.+D (I' H22FA S *M 4%M H MP+P%) 4THA+B/T SHID 9I $D 4%M H( MP4O+S ;+,)B/T SHD+ST%)TH0+T/P H' 9I $D 4%M H MP4%M +B/T SH2A+ST%)THI+T/P H' 9I $D 4%M H MP%D)+B/T SHBA+ST%)TH2I+T/P H' 9I $D 4%M H/'E0+B/T SHD 9I $D 4%M H/'E1+B/T SHC+ST%)TH0 $'-I$D 4%M H(4%M S *+4%M DBD)+POI4T )HI4D @ @D9$D 4%M H@4%M +S *M 4TH MP+S)'-H MP4%M +S,BS ;H/'E0 $'-I$D 4%M H(SEI$$S *+SEI$$DBD)+POI4T )HI4D @ @D9$D 4%M H@SEI$$+S *M 4THSEI$$+S)'-HSEI$$4%M +S,BS ;H/'E1 S *M 4%M HP%/)O$$+P%) 4TH MP+B/T SH01 9I $D 4%M H(P)////MM+S ;+,)+B/T SHD+ST%)TH0+T/P H' 9I $D 4%M HP%/%MT+B/T SHD+ST%)THI+T/P H' S *M 4%M HSEI$$+P%) 4TH MP+B/T SH2F 9I $D 4%M H(SEI$$ID+S ;+,)+B/T SH2+ST%)TH0+T/P H' 9I $D 4%M HSEI$$4%M +B/T SH2A+ST%)THB+T/P H' 9I $D 4%M H @P/)S+B/T SH1+ST%)TH2B+T/P H' DBD* 4 9I4ISDBD 4%M HSEI$$DBD+%'' SSH(-IS%M+IS%M) D%T%S T DD0HP)IM +O(9$.HO( )9$O.+D (I' H22FA S *M 4%M HSEI$$S *+P%) 4THA+B/T SH2C 9I $D 4%M H(S 'SEI$$+S ;+,)+B/T SH2C+ST%)TH0+T/P H' $'-I$D 4%M H(SEI$$+ MP7DBD)+I4D @H@SEI$$+POI4T )HS4*$ DBD* 4 9I4IS4D

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 58 of 89

IMS Class Room Session


-ow to inform IMS a&out Secon"ary In"e#6 $'-I$D @D9$D

$'-I$D esta&lishes relationship &etween segments of two physically separate "ata&ases. $'-I$D statement comes un"er target segment an" it shoul" &e imme"iately followe" &y @D9$D statement.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 58 of 89

IMS Class Room Session


Day 11 Summary5 0. Secon"ary In"e#5 Or"er other than segments se:uence fiel". 1. 4ee" to ha!e a separate "ata&ase (In"e# "ata&ase). This will only ha!e root only segment.

Sour.e

%arget Pointer

On which in"e# is re:uire"

9rom any source segment+ you can select 0 to F fiel"s. 2. I"entify 0. Source Segment 1. Target Segment 2. Pointer (/ou ha!e to &uil" this segment. It is a separate "ata&ase) If MP4%M is a secon"ary in"e#5 Source Segment5 MPS * Target Segment5 MPS * If SEI$$7ID is a secon"ary in"e#5 Source Segment5 SE$S * Target Segment5 MPS * B. $'-I$D > @D9$D statements are to &e co"e" un"er target segment.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 59 of 89

IMS Class Room Session

F. If "uplicates names are present then IMS re:uires another SDS "ataset to store those pointers. ESDS SDS #B) 998 915 9(9 9,5 945

This re:uires high o!erhea". So the solution for this is use to Su& Se:uence fiel". Pic3 up some !alue from same segment an" put it in ESDS "ataset. But still in"e# will &e on 4%M . But now 4%M T fiel" is uni:ue. Programmer will still refer to 4%M + &ut IMS &uil"s the in"e# on 4%M T fiel". So for IMS "uplicates are not there. D. Sometimes there won=t &e any fiel" which ma3es in"e# uni:ue then IMS gi!es other option of /'E an" /S@ (these are system relate" fiel"s) 9I $D 4%M H/'E0 ST%)TH0 B/T SHD @D9$D RRRRRRRRRRRRRRR.S,BS ;H/'E0

)efers to concatenate" 3ey. -ere it is MP4O so D characters. This fiel" is not store" as a part of your segment. This fiel" is store" in In"e# "ata&ase. /S@ re:uires B &ytes &ecause it wor3s with )B%. This is use" with -D%M an" -ID%M &ut not -IS%M. .hereas use /'E with all. 9I $D 4%M H/S@0 ST%)TH0 (here B/T S are not re:uire" since it is always B &ytes) I. If In"e#e" "ata&ase is -IS%M then in In"e# "ata&ase POI4T ) must &e S/MBO$I' G. If In"e#e" "ata&ase is -ID%M then in In"e# "ata&ase POI4T ) may &e S/MBO$I' or S4*$ C. -ow to ma3e use of this In"e#6

4ormal .ay of %ccess ( MP4O) PSB P'B T/P HDB+ 4%M H MPDBD+P)O'OPTH% S *M S *M PSB* 4 PSB4%M HRR..+ $%4*,%* HRRR.

,sing Secon"ary In"e# ( MP4%M ) PSB P'B T/P HDB+ 4%M H MPDBD+ P)O'OPTH%+ P)O'S ;H4%M DBD S *M S *M PSB* 4 PSB4%M HRR..+ $%4*,%* HRRR.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 79 of 89

IMS Class Room Session

0A. /ou can co"e n num&er of P'B "epen"ing on your access re:uirement 00. ,se I4DI' S to access "ata&ase in normal se:uence an" faster access to segments. +,9 t1e Se5,n.a-y In.e@ Is Maintaine. .hen a source segment is inserte"+ "elete"+ or replace" in the "ata&ase+ IMS 3eeps the in"e# current. IMS "oes this whether or not the application program performing the up"ate uses the secon"ary in"e#. The way in which IMS maintains the in"e# "epen"s on the operation &eing performe". )egar"less of the operation+ IMS always &egins in"e# maintenance &y &uil"ing a pointer segment from information in the source segment that is &eing inserte"+ "elete"+ or replace". (This pointer segment is &uilt &ut not yet put in the secon"ary in"e# "ata&ase.) .hen a source segment is inserte"+ D$/I "etermines whether the pointer segment nee"s to &e suppresse". If the pointer segment nee"s to &e suppresse"+ it is not put in the secon"ary in"e#. If the pointer segment "oes not nee" to &e suppresse"+ it is put in the secon"ary in"e#. .hen a source segment is "elete"+ IMS "etermines whether the pointer segment is one that was suppresse". If so+ IMS "oes not "o any in"e# maintenance. If the segment is one that was suppresse"+ there shoul" not &e a correspon"ing pointer segment in the in"e# to "elete. If the pointer segment is not one that was suppresse"+ IMS fin"s the matching pointer segment in the in"e# an" "eletes it. ,nless the segment contains a pointer to the SDS "ata set+ which can occur with a non7uni:ue secon"ary in"e#+ the logical recor" containing the "elete" pointer segment in a ESDS "ata set is erase". .hen a source segment is replace"+ the pointer segment in the in"e# might or might not &e affecte". The pointer segment in the in"e# might nee" to &e replace"+ or it might nee" to &e "elete". %fter replacement or "eletion+ a new pointer segment is inserte". On the other han"+ the pointer segment might nee" no changes. IMS "etermines what nee"s to &e "one &y comparing the pointer segment it &uilt (the new one) with the matching pointer segment in the secon"ary in"e# (the ol" one). If &oth the new an" the ol" pointer segments nee" to &e suppresse"+ IMS "oes not "o anything (no pointer segment e#ists in the in"e#). If the new pointer segment nee"s to &e suppresse" &ut the ol" one "oes not+ then the ol" pointer segment is "elete" from the in"e#. If the new pointer segment "oes not nee" to &e suppresse" &ut the ol" pointer segment is suppresse"+ then the new pointer segment is inserte" into the secon"ary in"e#.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 71 of 89

IMS Class Room Session

If neither the new or the ol" segment nee"s to &e suppresse" an"5

If there is no change to the ol" pointer segment+ IMS "oes not "o anything. If the non3ey "ata portion in the new pointer segment is "ifferent from the ol" one+ the ol" pointer segment is replace". ,ser "ata in the in"e# pointer segment is preser!e" when the pointer segment is replace". If the 3ey portion in the new pointer segment is "ifferent from the ol" one+ the ol" pointer segment is "elete" an" the new pointer segment is inserte". ,ser "ata is not preser!e" when the in"e# pointer segment is "elete" an" a new one inserte".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 7( of 89

IMS Class Room Session

IMS/DC )-ans7e- C,nt-,2 t, ,t1e- 4-,g-am To transfer control to another program use5 %lternate P'B '-4* 'all IS)T 'all

P'B T/P HTP+ MODI9/H/ S 0. Set alternate P'B to re:uire" "estination i.e. transaction co"e of the program. 1. Insert a message using alternate P'B. 1 1 NS=DES% P') ?@98A> SN%= S3> 95 SN%=$$ 95 SN%=LL 95 0'$$E! P') S9@9,A )" P +#$*E ;M5<> P') S9@9,A )" P +#$*E LE!"S> P') ? +#$*E -'3-=+#$*ES>

@ essage length .annot Be less than 5 .hara.tersA

%!#NS0E! SE)%'"N> "+E ; 0S%!N9(< %" NS=DES%> )#$$ ;)B$%D$'< *S'N3 D$'=)-N3 #$%=P)B NS=DES%> #lternate P)B is generated By ' S to .hange the .ontent of this area> Ne are suppose to use this .all> &ou .annot dire.tly assign value to #lternate=$%E! field of alternate P)B to 0S%!N9( %hen you issueH )#$$ ;)B$%D$'< *S'N3 D$'='S!% #$%=P)B SN%= S3 %his 1essage is Fust for syntaD .o1pletion

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 7, of 89

IMS Class Room Session

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 74 of 89

IMS Class Room Session


normally '$ %) 3ey is use" to return control &ac3 to IMS therefore programmatically you nee" not return to IMS (In Menu program). Tips5 0. ,se '$ %) 3ey for non7con!ersational programs 1. 'on!ersational program can return control &ac3 to IMS programmatically.

P-,g-am 1 0. MPT)4A0 (Define" in realims.ims)

$$ ( 01

LL (

E P%!N91 8

Program will recei!e this message now you are suppose to sen" M 4, screen 1. /9O) MPM 4,O

$$ (

LL (

E P%!N91 8

?? (

0B

So Menu Program will recei!e 1 types of messages. One will &e 12 &ytes length an" other will &e 1* &ytes length

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 75 of 89

IMS Class Room Session


P-,g-am 2

0. MPT)4A1 1. /9O) MP%DDO

Must &e reJecte"

It will recei!e F &ytes length message from M 4, program Sen" %"" Screen+ user will a"" "ata an" will press specifie" %ID 3ey to sa!e "ata. Program will recei!e input message of CD characters. $$ ( LL ( E P%!N9( 8 ?? ( N" 7 N# E #DD! ,9 49

So this program "eals with 1 messages+ F characters an" CD characters

P-,g-am 3 Program 0 will transfer = &ytes to program 2. Ta3e first fi!e employees into wor3ing storage then reply &ac3. If P9I is presse"5

$$ (

LL (

E P%!N9, 8

?? (

.hich in"icates program 2 to program 2+ 1* &ytes get transferre"

-ow to get last employee num&er of pre!ious screen to "isplay ne#t fi!e recor"s6 There are two possi&ilities5 0. $$ ( LL ( E P%!N9, 8 98 ( E PN" 7

1. Store employee7num&er some where &efore reply &ac3. Then afterwar"s co7 relate with terminal user an" use it.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 77 of 89

IMS Class Room Session

So+ 0. 'reate one "ata&ase (-D%M) which will &e root only

$%E!

E PN"

1. 'reate one fiel" on screen+ 3eep it as hi""en fiel"+ store start an" stop !alues to it.

$$

LL

E P%!N9,

98

9991

9995IIIIIIII

4ote 5 'reation of list on screen DO F D9$D 5 5 4D 2. Store this in memory ($i3e commarea in 'I'S)

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 78 of 89

IMS Class Room Session


Day 12 C#-s,- 4,siti,ning an. Dynami5 Att-i/#te M,.i7i5ati,n /ou can change the attri&utes of any fiel" &efore sen"ing it to user. This can &e "one "ynamically in the program as per the re:uirement. Otherwise the original attri&utes will &e in effect. The attri&ute setting an" cursor positioning is "one using 1 &ytes attri&ute fiel". Dynamic 'ursor Positioning57 A 0 1 2 B F D I

Bits A an" 0 are use for cursor positioning5 AA 5 Positioning not re:uire" 00 5 Position cursor on this fiel"

Bits 1 to I are always Keros. AAAAAAAAA 5 # <AA= 00AAAAAAA 5 # <'A= So if !ali"ation of fiel" fails Mo!e <'A= to attri&ute &yte of the fiel" to position cursor on that fiel".

Dynamic %ttri&ute Setting57

Bit A 5 %lways 0 Bit 0 5 A or 0 (use always 0) Bit 1 5 Protection %ttri&ute. A7,nprotecte"+ 07Protecte" Bit 2 5 Shift %ttri&ute. A7%lphanumeric Shift+ 074umeric Shift Bit B an" F 5 Intensity %ttri&ute. AA74ormal+ A074o Display+ 0A7Bright+ 007Bright Bit D 5 $ight Pen Detection. Shoul" always &e Keros Bit I 5 Mo"ifie" "ata tag. A7MD9 O99+ 07MDT O4

9or e#ample5 To position the cursor on fiel" an" ma3ing it &right A 0 0 0 1 A 2 A B A F A D A I A A 0 0 0 1 A 2 A B 0 F 0 D A I 0

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 78 of 89

IMS Class Room Session


@ <' A= Output message format5 @ <' D=

91 "*%P*%= S3> 95 $$ III 95 LL III> 95 #%%!1# P') ?@91A> 95 #%%!1B P') ?@91A> 95 0'E$D1 P') ?@=A> 95 #%%!(# P') ?@91A> 95 #%%!(B P') ?@91A> 95 0'E$D( P') ?@=A> : "+E ?<)9< %" #%%!1#> "+E ?<)D< %" #%%!1B> A2te-nate PCB

There are two types of %lternate P'B 0. Mo"ifia&le P)B %&PEG%PH "D'0&G&ES

%lternate P'Bs are also use" to sen" messages to other terminals (for &usiness nee"s) 9or such case use this type. %n" issue 0. '%$$ '-4* $T )MA0 1. '%$$ IS)T 2. ,se P,)* call. This will force the message to go to that terminal 1. 9i#e" P)B %&PEG%PH $%E! GE P%!N9( P)B %&PEG%PH $%E! GE P%!N9,

-ere there is no nee" of '-4* call &ecause "estination is alrea"y specifie".

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 79 of 89

IMS Class Room Session


Some Important Points5 0. D$/I call gets translate" to (S%M "ataset internally 1. -D%M re:uires 0 SDS file. (IMSA.P)OD. MPDB) 2. Program is accessing MPDBD

)#$$ ;)B$%D$'< *S'N3 D$'=!EP$ DB=P)B SE3=#!E# SS#

This call goes to control region. Data&ase is 3nown &y D&7P'B. In this DBD mention D%T%S T H DD4%M In a startup ?'$ you specify the "" statement for D$/I "ata&ase. This is the way of IMS to inform control region a&out "atasets. .hate!er is running un"er IMS/D'+ "oes not re:uire any DD statement that is how all online programs+ which are MPP+ accesses "ata&ases. %lso for BMP programs DD names are not re:uire".

B. Instea" of allocating all the "atasets in a"!ance which increases the o!erhea" of system+ another way is5 D9SMD% macro statements5 Dynamic allocation on "eman" D0S D# DDII>>E PDBI>>DSNGIIIII> : : : 9or 2AA "ata&ases + you=ll get 2AA D9SMD% mem&ers. .hen they are translate" they are 3ept into one li&rary. This li&rary must &e concatenate" to your ) S$IB. Initially "ata&ase is not allocate". .hen program starts e#ecution an" it ma3es call to that "ata&ase+ IMS loo3s it into this li&rary an" allocates space. 9or each "ata&ase there will &e a separate PDS mem&er. .hich will ha!e DD an" "ataset name.

F. .hy we run programs in BMP6 .e cannot gi!e e#clusi!e control to "ata&ase. .e want other programs to share the "ata&ase therefore in pro"uction most of the programs are BMP programs. If they are D$/I they must run "uring nighttime+ when online system is off. In D$/I + "ata sharing in not a!aila&le. /ou r Jo& is "irectly running un"er M(S+ gains e#clusi!e control on "ata&ases.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 89 of 89

IMS Class Room Session

D. 'oncurrency5 Many users using "ata&ases simultaneously 7%'ID property of transaction I. MPP online programs5 ach message is a transaction. .hen program fetches ne#t message+ pre!ious transaction is complete" an" resources are release". In a shared s%stem it is necessar% to release a loc+ as soon as 1ossi(le 0nline transaction should not ta+e lon6 time

G. BMP Batch programs5 IMS assumes Start of the program an" n" of the program as one transaction. If you are up"ating payroll at en" of month+ which is a BMP transaction. So until this program finishes+ all the in!ol!e" segments will not &e a!aila&le which is not a welcome situation therefore some mechanism+ which shoul" release the resources in &etween (otherwise "ata won=t &e a!aila&le to other program+ might get IIIerror) since &atch program is hol"ing those resources. To resol!e this+ some position in &etween is re:uire". There are 1 types of &rea3s5 a. Brea3 it &y time &. Brea3 it &y num&er of input recor"s processe" )1e 9ay t, /-eaB is #se ,7 C1e5B4,int 5a22. IMS pro!i"es this facility. .hate!er is loc3e" up to that chec3point call is release" for other programs to use.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 81 of 89

IMS Class Room Session


Day 13 <-e"#ent C1e5B4,ints 0. 'oncurrent ,sage Of Data

-ow to fin" out whether any other concurrent user is using that resource or a segment6 Ma3e use of $og (System $og) %nalyKe PSB+ how many programs are using the "ata&ase you are going to up"ate. If you foun" that P0+ PI+ PFD+ P2F programs also uses the "ata&ases you are using+ ne#t fin" out The usage or fre:uency of the program going to run. If they are running fre:uently then you ha!e to gi!e fre:uent chec3points. If the fre:uency is low+ you may not gi!e chec3points after e!ery transaction

1. Determine fre:uency (4ot for %M @) 2. %)'5 %pplication )estart 'ontrol. It=s a utility to "ynamically change the chec3points. B. 'hec3point after e!ery transaction.

%nother reason for chec3point5 0. )estart5 If program a&en"s+ you shoul" start from the transaction+ which was not committe". 1. )eco!ery5 If "is3 "ri!e fails+ then you ha!e a "ata&ase &ac3up+ ta3e log "ataset+ from log get the up"ates an" up"ate the &ac3e" up "ata&ase an" &ring it to current position where the failure occurre". Therefore ta3e image copy of e!ery "ata&ase "aily+ hourly+ wee3ly etc. So that you can ta3e a latest copy of it an" then apply all the changes from log for that "ata&ase to the image copy. This is forwar" reco!ery. 4ow you ha!e to restart the program from the point where the %B 4D occurre" in the last e#ecution. +,9 4-,g-am 9i22 .e5i.e 7-,m 91i51 4,int t, sta-tF (for e#ample in the pre!ious e#ecution 2CCAAA recor"s were processe" so now it shoul" start from BAAAAAth recor") !ery chec3point will ha!e chec3point i"entifier. -ow to get uni:ue 'hec3point7i"6 9irst time run a normal run without %B 4D. /ou will get ? S message for last transaction+ which will ha!e some message num&er. 9rom where you will get chec3point i"6 (?OB$O*) ? S

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8( of 89

IMS Class Room Session


Store other "etails when you are ta3ing chec3point /ou nee" to store !aria&les+ which were change" in the last e#ecution "uring last chec3point. %fter restart+ you nee" to supply this "etail along with chec3point7i". %lso store 3ey information along with chec3point7i". 9or files you shoul" ha!e num&er of recor"s rea" "uring last e#ecution. I.e. count of num&er of recor"s processe"+ So with this count you can restart from ne#t recor" in a file (Input file)

0.

.hen you are running program as a BMP+ if %B 4D occurs then IMS &ac3s out the changes you ha!e ma"e up to the pre!ious chec3point. 1. .hen you are running program as a D$/I+ this "oes not happens automatically+ you ha!e to &ac3e" out using some utility(Batch Bac3out ,tility). /ou ha!e to gi!e the chec3point7 i" to which you want to &ac3e" out for restart. (options in ?'$)

$O* IMS/D' uses O$DS (Online $og "ataset). It contains system relate" information an" "ata&ase (IMS) relate" information. It is implemente" in 2 stages5 0. Memory Buffer 1. Dis3 Dataset (there are 2 i"entical "atasets. .hen this gets full+ it is mo!e" on to Tape) 2. Tape Memory &uffer an" "is3 "atasets are .%DS (.rite %hea" Datasets+ smaller siKe+ faster "e!ices) DB)' software rea"s O$DS from Tape %gain Tape is "i!i"e" into 1 types 0. System $og "ataset (S$DS) 1. Data&ase reco!ery $og ()$DS) In a""ition to O$DS+ IMS also maintains )DS()estart Dataset). This is nothing &ut IMS chec3points to restart IMS in case of IMS failure. These are not our program chec3points.

999 A(end-deadloc+ a(end! ,rom s%stem lo6 ta+e 1rint of =? 9? re1ort to +no* *hich other concurrent 1ro6rams are usin6 data(ase the one *hich %our 1ro6ram is usin6 Chec+1oint fre5uenc% needs to (e increased

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8, of 89

IMS Class Room Session


C1e5B4,int I.enti7ie It is of G characters in IMS. 9irst B characters will &e program7i". $ast B characters will &e a num&er

9irst B characters will &e program i"5 92FA or 92FF $ast B characters will &e num&er up to CCCC But in this case if CCCC limit is reache" it resets to Kero. So here now 1 recor"s can ha!e "uplicate chec3point. Then which one will IMS use the first one or last one6 So for this also inclu"e time7stamp information into chec3point7i". 9ormat for which is5 IIDDD--MMDSSST II5 )egion I" DDD--MMDSSST5 %ctual time in "ays+ hours+ minutes+ secon"s+ an" 0Ath of secon". Or IMS chec3s log &ac3war"+ so always it will ta3e the latest one.

IMS ta+es care of IMS data(ases onl%! IMS Lo6 *ill not su11ort an%thin6# *hich is not IMS su11orted!

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 84 of 89

IMS Class Room Session

;SAM <i2es IMS cannot han"le other se:uential file for reco!ery. That is IMS "oes not support other files chec3point. 'OBO$ support for chec3point is ) ),4 clause in S $ 'T statement. M(S pro!i"es chec3point facility for all files. Therefore se:uential file ha!e to use M(S chec3points. %n" IMS files will use IMS chec3points. Both nee" to &e i"entifie" &y one single chec3point mechanism. So how to resol!e this6 Some how we nee" to ma3e se:uential file as IMS "ata&ase. So here se:uential file is wrappe" as "ata&ase. 4ow IMS will un"erstan" this se:uential file as a IMS "ata&ase. This type of "ata&ase is 3nown as *S%M (*eneraliKe" Se:uential %ccess Metho") "ata&ase. It is a wrapper for your input or output se:uential file

If %ou ta+e directl% se5uential file# as it is then %ou *ill not a(le to use IMS chec+1oints therefore con;ert this file to GSAM data(ase! Go* IMS *ill *or+ on it! 3his file *ill (e treated as an IMS data(ase

DBD "efinition DBD N# EG%!#NDBDH #))ESSG@3S# HBS# A D#%#SE% DD1G%!#N'NH !E)0 G0H !E)"!DG89 DBD3EN 0'N'SEND

PSB "efinition P)B %&PEGDBHN# EGE PDBD P)B %&PEG3S# HN# EG%!#NDBD PSB3EN END

GSAM data(ase cannot (e used (% M.. 1ro6rams GSAM data(ase can onl% (e 1rocessed (% BM. and DL/I 1ro6rams

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 85 of 89

IMS Class Room Session


Day 1*

9our possi&le !alues gi!en to *S%M5 A55ess $ * 'S Meaning $oa" *et $oa" Se:uential. 9or e!ery write "is3 IO won=t ta3e place. )ecor"s get store" into &uffer. .hen &uffer gets full+ recor"s are written to "ataset *et Se:uential. .hile rea"ing "ata+ group of recor"s gets written into &uffer. .hene!er user as3s for particular recor"+ it is gi!en from &uffer. $ema-B .rite to "ata&ase )ea" "ata&ase .rite to "ata&ase. %M @ stan"ar". ,se" to impro!e performance &y re"ucing IO time.

;S

)ea" "ata&ase. %M @ stan"ar". ,se" to impro!e performance &y re"ucing IO time.

$ea.ing ;SAM in $an.,m M,.e ,sing )ecor" Search %rgument+ you can rea" the *S%M file ran"omly. )ecor" Search %rgument ()S%)5 )ecor" Search %rgument is ma"e up of two fiel"s5 91 3S# =!S#> 95 N"!D1 95 N"!D(

P') S9@95A )" P> P') S9@95A )" P>

Declare this area in wor3ing storage of the program. .hen this area is specifie" with *4 call. %""ress associate" with recor" gets store in this area()S%). $i3e this you can get all the recor"s a""ress. 'reate an array for storing all )S% !alues. Then in the same program you can rea" recor" ran"omly using )S%. Simple *4 call5 (-ere you won=t get )S% information) )#$$ ;)B$%D$'< *S'N3 D$'=3N 3S# =P)B '"=#!E#

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 87 of 89

IMS Class Room Session

(ariation On *4 call5 )#$$ ;)B$%D$'< *S'N3 D$'=3N 3S# =P)B '"=#!E# 3S# =!S# -ere you will get the !alue associate" with recor". This will &e a i"entifier for that recor". /ou can create an array of all )S% !alues 91 !S#=%#B$E> 95 3S# =!S# "))*!S (99 %' ES> : :

In the same program now you can rea" *S%M file ran"omly &y issuing *, call5 )#$$ ;)B$%D$'< *S'N3 D$'=3* 3S# =P)B '"=#!E# 3S# =!S# /ou can use *S%M7)S% with IS)T call. This is optional. .hen recor" gets written+ *S%M7 )S% will ha!e some !alue+ .hich you can use to retrie!e the same recor". )9, s4e5ia2 5a22s #se. 9it1 ;SAM *S%M "ata&ases are opene" IMS or you can open e#plicitly &y issuing following calls5

)#$$ ;)B$%D$'< *S'N3 D$'="PEN 3S# =P)B

)#$$ ;)B$%D$'< *S'N3 D$'=)$SE 3S# =P)B

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 88 of 89

IMS Class Room Session


S5-at51 Pa. A-ea (SPA : -i""en fiel"+ which is use" to store page num&er an" Start+ Stop !alue may not &e sufficient in case if the num&er of pages increases. So the solution is create -D%M "ata&ase+ which will &e root7only to store page num&er+ start73ey an" stop73ey !alue. Before sen"ing employee listing to user store all these "etails in this "ata&ase. %ll user of this program will use the same -D%M "ata&ase therefore ma3e $T )M7ID as a part of its recor". So now -D%M "ata&ase recor" segment will &e5 $%E! P#3E S%#!%=KE& END=KE&

.hen P92 3ey is presse" from your terminal+ i.e. go &ac3 to M 4,+ "elete the recor" associate" with your $T )M7ID. .hen user an" program are interacting with each other+ IC character hi""en fiel" or -D%M "ata&ase can &e use". %nother way is Scratch Pa" %rea (SP%) siKe5 21IDA &ytes5 This area is use" when programs interact with each other an" they nee" to pass "ata to each other. Scratch Pa" %rea5 IMS facility for session management use" &etween programs. %lso in single program. Definition of SP% shoul" &e such that it shoul" ta3e care of all communication iterations.

Pg11

Pg1(

Pg1,

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 88 of 89

IMS Class Room Session

P-,g-am Pgm0 Pgm1 Pgm2

Ca22e. By Transaction I" Transaction I" T "etails Pgm0 Pgm0

Ca22s Pgm1+ Pgm2 Pgm0 Pgm0

Program1 an" Program2 shoul" not &e allowe" to start &y typing transaction7i" of the program. To 3eep trac3 of this you shoul" store calle" programs transaction i". This is a general re:uirement. In a""ition for program 2 you nee" to sa!e page "etails an" then at top you nee" to a"" IMS relate" fiel"s. So SP% "eclaration will loo3 li3e this5 91 SP#=#!E#> 95 SP#=$$ P') S9@94A )" P> 95 SP#=LL1 P') S9@94A )" P> 95 SP#=LL( P') S9@94A )" P> 95 SP#=%!#NS#)%'"N=)"DE P') ?@98A> 95 N"!K=#!E#> 19 )#$$'N3=P3 P') ?@98A> 95 P3 ,=S#+E> 19 S)!"$$='N0" "))*!S 5 %' ES> 15 S)!"$$=P#3E P') 9@91A> 15 S)!"$$=S%#!% P') ?@97A> 15 S)!"$$=END P') ?@97A> 95 0'$$E! P') ?@1,A> %ll the 2 programs are going to use this 0AA &ytes SP% area. )ea"ing SP%5 9irst *, call will retrie!e the SP% followe" &y *4 call+ which retrie!es the message. )#$$ ;)B$%D$'< D$'=3* '"=P)B SP#=#!E# .hen nothing is sen"+ you will get <;'= status co"e. So chec3 for this status co"e. %fter this issue following to retrie!e messages. This will &e in loop until en"7of7message which is status co"e <;D= )#$$ ;)B$%D$'< D$'=3N '"=P)B S3=#!E#

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 89 of 89

IMS Class Room Session

.riting SP%5

)#$$ ;)B$%D$'< *S'N3 D$'='S!% '"=P)B SP#=#!E#> )#$$ ;)B$%D$'< *S'N3 D$'='S!% '"=P)B "*%P*%= ES3>

Transferring control5

)#$$ ;)B$%D$'< *S'N3 D$'=)-N3 #$%=P)B NS=DES% )#$$ ;)B$'D$'< *S'N3 D$'='S!% #$%=P)B SP#=#!E# )#$$ ;)B$%D$'< *S'N3 D$'='S!% #$%=P)B SN%= S3

andatory

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 89 of 89

IMS Class Room Session

+,9 SPA 0,-BsF

Menu EN* P01: #DD P0(: $'S% )$E#!:E?'%

Em1lo%ee Addition #DD E P N">: N# E: #DD!: P0, %"

Em1lo%ee Listin6 E P $'S% N" N# E #DD! ===== ========= ======= ===== ========= ======== P08=*P P08=D"NN P0,= EN*

EN*IIIII

Pgm5PgmAA0 Trans7i"5 MP)4A0

Pgm5PgmAA1 Trans7i"5 MPT)4A1

Pgm5PgmAA2 Trans7i"5 MPT)4A2

,ser must start this system with M 4, 0. By typing transaction i" MPT)4A0 1. /9O) M 4,O If user starts with /9O) %DDO+ then how to stop user to start pgmAA1 "irectly6

Solution 05 (By using switch message) 'hec3 for message length. If it is F+ it=s a !ali" start. But how to chec3 for calling program name so mo"ifie" swt7msg will &e5 $$ LL %!#NS#)%'"N 'D P0KE&

Transaction i" of the calling program 'reate one &lan3 fiel" on %DD screen. .hen pgmAA0 starts pgmAA1 store calling program=s transaction co"e into this "ar3 fiel". So now pgmAA1 can chec3 for transaction co"e of pgmAA0 in this "ar3 fiel" to chec3 for a !ali" start. If pgmAA1 is start &y typing /9O) %DDO then this fiel" will &e &lan3. $i3e this you can chec3 for the correct start of the program

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 81 of 89

IMS Class Room Session


Solution 15 (By using (S%M "ataset) (S%M 3s"s "ataset will ha!e following fiel"s5 0. ,ni:ue $T )M 1. 'alling program=s transaction i"

E P%!N91 $$VV MPT)4A0 (01 &ytes message) : : :

EN*

9rom IO7P'B get the $T )M an" loo3 into (S%M "ataset. 9irst time you won=t fin" it so write it into the "ataset. Display &lan3 M 4, screen. 4ow control goes to M 4, program. ,ser enters 0st option so control goes to pgmAA1. Before transferring control to pgmAA1 change the calling program=s transaction co"e to MPT)4A0 in (S%M "ataset. So now pgmAA1 can chec3 for this transaction co"e to see whether it=s a !ali" start or not. Same for the $IST program.

Menu Program5 3E%= SS#3E> 3E%=0!" =+S# > 3E%= S3> !EP$&=B#)K> !EP$='S!%=+S# < 'S!%= S3 %!#NS0E! !EP$='N%"=+S# 'S!%=#$%=DES%

Solution 25 %ll these things can &e pro!i"e" &y Scratch Pa" %rea+ facility pro!i"e" &y IMS. Our re:uirement of storage 9or M4 , an" %DD program5 G &ytes 9or $IST program5 G &ytes T 0AA &ytes In a""ition 0B &ytes will &e for5 SP%7$$ SP%7VV0 SP%7 VV1 SP%7T)%4

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8( of 89

IMS Class Room Session


1 1 1 G

91 SP#=#!E#> 95 SP#=$$ P') S9@94A )" P> 95 SP#=LL1 P') S9@94A )" P> 95 SP#=LL( P') S9@94A )" P> 95 SP#=%!#NS#)%'"N=)"DE P') ?@98A> 95 N"!K=#!E#> 19 )#$$'N3=P3 P') ?@98A> 95 P3 ,=S#+E> 19 S)!"$$='N0" "))*!S 5 %' ES> 15 S)!"$$=P#3E P') 9@91A> 15 S)!"$$=S%#!% P') ?@97A> 15 S)!"$$=END P') ?@97A> 95 0'$$E! P') ?@1,A>

0or ' S> &ou should not )hange this area>

Each terminal *ill ha;e a S.A!

E P%!N91

The content of this SP% will &e all &inary Keros. IMS loo3s at your message first since it is for the first time IMS creates this area+ puts transaction7i" o!er here. 'alling program will &e &lan3. .hich is accepta&le con"ition since it is a starting program. Ma3e it as a MPT)4A0. Suppose it is not a &inary Keros that in"icates pgmAA1 or pgmAA2 must ha!e calle" the M 4, program. So all these are !ali" !alues for pgmAA0 to start P-,g-am PgmAA0 :a2#es t, /e 51e5Be. Binary Keros MPT)4A0 MPT)4A1 MPT)4A2 Binary Keros MPT)4A0 MPT)4A1 Binary Veros MPT)4A0 MPT)4A2 $ema-B 9irst start 'alling itself 'alle" &y pgmAA1 'alle" &y pgmAA2 )aise an error 'alle" &y pgmAA0 'alling itself )aise an error 'alle" &y pgmAA0 'alling itself

PgmAA1

PgmAA2

B% 1ressin6 CLEAR +e% S.A associated *ith that terminal *ill (e deleted!

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 8, of 89

IMS Class Room Session

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 84 of 89

IMS Class Room Session

.hen SP% is create" first time &y IMS+ IMS pulls out the transaction co"e from the message an" puts it into SP% transaction co"e. That is if the message is5 $$ ( SP% will &e LL ( %!#NS=)"DE 8 P0KE& (

$$ (

LL1 (

LL( (

%!#NS=)"DE 8IIIIIIIIIIII>

Then message will shorten to5 $$ 1( LL ( P0KE& (

/ou ha!e to ta3e care of this situation. (Message length D). So for this rea" SP%+ ta3e transaction7co"e put it into message. So now message is &ac3 to 01 characters length. )1e-e is a 4-,/2em i7 t-ansa5ti,n 5,.e is 2ess t1an D 51a-a5te-s . The thing is IMS parsing for transaction co"e stops only after G characters or when &lan3 is encountere". That=s the reason of ta3ing care for 3eeping transaction7i" G characters long. If you 3eep transaction co"e G characters long only chec3 for D characters length nee" to &e "one after writing SP% area.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 85 of 89

IMS Class Room Session

Some e#amples of transaction co"e less than G characters5 In4#t Message Message A7te- 9-iting t-ansa5ti,n 5,.e t, SPA $$ 1 LL 1 9 1 /ou ha!e to ta3e care of this C character length message 1 $ema-B /ou ha!e to ta3e care of this D character length message

$$ LL E 1 1

P %!N 9 1 9 1

Transactionco"e pf3ey G 1

$$ 1 1 B $$ LL E 1 9 1 1

LL 1 2

9 1 1

P%

/ou ha!e to ta3e care of this I character length message 1 1 D $$ LL E 1 9 1 1 $$ 1 LL 0 1 9 1

P %!N

.ro6rams *ith S.A are con;ersational 1ro6rams .ro6rams *ithout S.A are non con;ersational 1ro6rams

.hen mo!ing &ac3 to IMS from any screen that is pressing P9 2 to e#it+ write following steps in the associate" section5 0. insert spaces to transaction co"e of SP% 1. insert that spa to IMS+ using IO P'B

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 87 of 89

IMS Class Room Session


Day 1= 'hec3 point Synta#5 )#$$ ;)B$%D$'< *S'N3 D$'=)-KP '"=P)B '"=#!E#=$EN )KP%='D=#!E# #!E#1=$EN #!E#1 : : #!E#8=$EN #!E#8

.hen this call gets e#ecute" 0. 1. 2. B. F. )estart5 )estart will "o the repositioning of the "ata&ase+ it will 3eep the memory content i"entical as of pre!ious run fail. So if chec3point is gi!en when c3ptrH0I+ nee"s to restart from 9%2FAA0I. Program is re:uire" to wor3 in two mo"es5 0. 4ormal )un 1. )estart )un Therefore nee"s to communicate with program to inform whether it=s a normal run or restart run IMS creates recor"s with chec3point i"entification. It will also contain repositioning information %ll this will &e attache" with chec3point i"entification. %ll this information will go into log %ll the up"ates to "ata&ase since the last chec3point will &e ma"e permanent

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 88 of 89

IMS Class Room Session

Synta#5 )#$$ ;)B$%D$'< D$'=?!S% '"=P)B '"=#!E#=$EN ?!S%=#!E# #!E#1=$EN #!E#1 : : #!E#8=$EN #!E#8

It is same as chec3point call e#cept here 'EPT7ID7%) % that is @)ST7%) % will &e 01 &ytes A0 @)ST7%) %. AF 'EPT7ID AF 9I$$ )

PI' @(AG) (%$, SP%' S. PI' @(AB) (%$, SP%' S.

InitialiKation with spaces is must @)ST call is written as a first call in your program. Program shoul" "etermine the mo"e of run &y chec3ing the 'EPT7ID fiel" of @)ST7%) %. If it is &lan3. It in"icates a 4ormal run. If it contains the chec3point7i" then it is a restart run. Therefore it must to put (%$, SP%' S at the time of "eclaration. @)ST call will rea" log &ac3war"s+ mo!es all area &ac3 to program wor3 area. %lso repositions the "ata&ase if it is a restart run.

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 88 of 89

IMS Class Room Session


P-,g-amming ti4s 7,- 4-,g-am #sing 51e5B4,int an. -esta-t 2,gi58 'all @)ST 'hec3 for restart7i" If spaces 4ormal run lse Mo!e restart7area to wor3ing7storage7area n"7if Process

If want to ta3e chec3point after FAA up"ates5 Process Some up"ate acti!ities Increment up"ate counter If up"ate counter H FAA '%$$ <'B$TD$I= ,SI4* D$I7'-EP 5 chec3 for &lan3 status co"e an" SE status co"e SE status co"e is raise" when chec3point is ta3en &efore setting gi!en in % S. That is if in % S the entry is gi!en as IAA+ then % S will not honore" this chec3point. It will automatically ta3e the chec3point after IAA up"ates. 4ow this can &e o!erri""en thru ?'$ &y gi!ing P%' '-P H no parameter. TSO BM'%)' or BM'% S will allow you to "elete all the pre!ious chec3points To terminate program after F chec3points mention following in ?'$5 //%)'S/SI4 DD U P%' '-EPH4 T)M%9T )'EPHF

I 9)D )5 System $og. 'urrent up"ates are maintaine" o!er here. This is use" for 4ormal run .hen 'hec3point is gi!en an" program a&en"s+ I 9)D ) is mo!e" into IMS$O*). IMS uses IMS$O*) to restart. So for restart I 9)D ) &ecomes IMS$O*) an" I 9)D ) will &e use" for the current run. 9or normal run IMS$O*) is not re:uire". Only nee" to specify I 9)D ) This is only for D$/I Jo&s. 9or BMP I 9)D ) is not re:uire". It is "one &y control region (IMS startup an" shut"own)

Developed By: Shilpa Keluskar & Suvarnalata Naik

Page 89 of 89

You might also like