Imsdb Cour Mat

53
1 IMS/DB Overview

description

xzcvxzcvxzcv

Transcript of Imsdb Cour Mat

1IMS/DBOverview2CONTENTSIntroduction2 HrsHierarchical Database & Terms 2 HrsIMS DB components 4 HrsIMS DB program coding 4 HrsIMS DB Functions2 HrsIMS Status codes2 HrsIMS Processing Modes2 Hrs3IntroductionIMS DB IMS DB Information Management System - DataBase Used for creating and managing the physical storage and retrieval of data which is organized using the hierarchical data structure. I! DB is the part of the IB"s software product I!#$! %Information anagement !ystem# $irtual !torage&. I!#$! is having two components 'IMS/DB' Used to create and manage the data(ases.IMS/DC' Used to handle the online transaction processing.4ierarc!ica" Data#ase $ Terms)he data relationship in I!#DB is Hierarchical.ierarc!ica" Data#ase ierarc!ica" Data#ase' It"s a )ree structure. *elationship of data is %redefined (y its structure. +rogram Traverses the structure to access the data. !o all the access is through the predefined paths. Its ma,or advantage is speed of access as path is predefined. Disadvantage is the reduced fle-i(ility inherent in a pre-defined structure and its comple-ity of design.5Hierarchical Database&'(C'S.//0U1)&'(MENT)'TEC'S'D*'NCECE+,E&'(CE+BI--IN./EES6Termino"ogy Termino"ogy 0 0Segment '!mallest unit of data an application can retrieve from a data(ase2 contains one or more fields of data.)oot' )he entry point to the data(ase. 1o parent.&arent' !egment with dependent segments.C!i"d' Dependent segment of parent Twin' ultiple occurrences of a dependent segment1ey ' Uni3ue identifier of a segmentConcatenated 1ey ' )he concatenation of all the 4eys of the parents with the 4ey ofthe segment.Data#ase )ecord ' 0ne root with all of its children.Searc! /ie"d ' .ny field defined in the data(ase definition.7 !e3uential processing se3uence of an I! data(ase is )op-to-Bottom2 5ront-to-Bac4 and 6eft-to-*ight. .n I! data(ase consists of some num(er of data(ase records. )he !ize of the data(ase is limited only (y the constraints of $!. and D.!D. . ma-imum of 78 levels are allowed. I! allows up to 288 different segment types in a single data(ase. I! 4eeps trac4 of its place in the data(ase after every call. !o it is important to 4eep data(ase position in mind. I! always moves forward2 never (ac4ward.8IMS DB Com%onentsCom%onents of an IMS System Com%onents of an IMS System '&&-IC'TION &rogram ' )he user modules written in .ssem(ler2 /o(ol2 +6#7 D'T'B'SE ' )he data accessed (y one or more application. D-/I Modu"es ' )he modules which interface (etween the $! access modules and the application program. .ll access to I! data(ases is through this module. !o every time a data(ase is read or updated the D6#I interface must (e called. D-/I Contro" B"oc2s ' )he e-ecuta(le modules which define the data(ases and the application program"s view.9MVS ACCESS MODULESAPPLICATION PROGRAMDL/I MODULESAPPL. CONTROL BLOCKSDBDLIBPSBLIBDATA BASESMVSDBDPCB(In PSB)PCBMASK10 IMS Database Terminology IMS Database Terminology : : DBD( Database Definition) Defines the phsi!"# st$%!t%$e &f the '"t"("se. PCB(Program Commnication Bloc!) Defines the "pp#i!"ti&n )ie* &f the '"t"("se. PSB( Program S"ecification Bloc!) C&nt"ins "## the PCBs f&$ " spe!ifi! p$&+$",. #CB( #""lication Control Bloc!)An Inte$n"# C&nt$ B#&!- !&nt"inin+ DBD "n' PSB inf&$,"ti&n.11D'T'B'SE DE/INITION 3DBD4 D'T'B'SE DE/INITION 3DBD4 )he DBD contains the data(ase name and defines the actual tree structure. )he Information given in the DBD includes ' Data#ase name Segment name 1ey fie"d names5 "engt!s and "ocations Searc! fie"d names5 "engt!s and "ocations IMS and M*S access met!ods DD names 3-ogica" name for datasets4 DBDs are assem(led and resides in DBD6IBs. )he process of assem(ling is called DBD9:1.12E.",p#e &f DBD s&%$!e/TIT$% SS%MB$% '( DBD)#M%*'+T#B$DB & ,DS)#M%*C#PSMISC-T#M.#-DBD$IB ,/'$*DM#S01 P.I)T)'2%) DBD)#M%*'+T#B$DB3#CC%SS*(HD#M3/S#M)3.M)#M%*('+TB04.M353674)3 P#SS8D*)'3 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,D#T#S%T 2.'+P )+MB%. 5 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, DS2445 D#T#S%T DD5*'+T#B$D43D%/IC%*9904SI:%*(;4T%S*73T>P%*C,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, S%2M%)T )+MB%. 54 , ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,S%2M)#M%*'8TM.S%23 P#.%)T*(('8TB70.T3S)2$))3 B>T%S*51743 PT.*()'T8I)3333) DBD2%) (I)ISH %)D 14&)O.)'M COMM,NIC'TION B-OC1 3&CB4 &)O.)'M COMM,NIC'TION B-OC1 3&CB4)he +/B is the program"s view of a data(ase. It defines the data(ases to (e accessed and the scope of the program"s access. It defines the segments which are availa(le to the program. !o if a +/B does not contain one or more of thesegments in a data(ase2 it means the program is ;not sensitive" to these segments. !o only the segments defined in +/B will (e accessed and these are called as sensitive segments. )he +/B also states what type of activities are allowed on respective segments ' add2 update2 delete or read.15 )he processing options allowed in a +/B are ' I ' )o add#insert a segment.*' )o change#replace a segment. D' )o remove#delete a segment. 9' )o read#get a segment. .' .ll functions e-cept load 6' )o initialize%6oad& data(ase 6!' 6oad the data(ase (ut data(ase must (e in 4ey se3.. 90 ' *ead only. !o to read a segment2 even if another program is updating it. ultiple of the options can (e defined as in 9I2 meaning that the program can get and#or insert segments.16 )he processing option can (e coded at the data(ase level so will (e applica(le for all the sensitive segments or it can (e defined at the segment level.IO6&CB IO6&CBIt is also called as )+-+/B. It is used in online transactions to process messages to#from the terminal and in (atch programs to ta4e chec4points.17&)O.)'M S&ECI/IC'TION B-OC1 3&SB4 &)O.)'M S&ECI/IC'TION B-OC1 3&SB4 . +!B is the set of all +/Bs that a program is going to use. )he program can access only data(ases which are defined in the +!Bs and can perform only those operations which are defined under +rocopt. +!Bs are assem(led and resides in +!B6IBs. )he process of assem(ling is called +!B9:1.18E.",p#e &f PSB s&%$!e/TIT$% SS%MB$% '( PSB)#M%*@()T57 & ,DS)#M%*C#PSMISC-T#M.#-PSB$IB ,/'$*DM#S75 ,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,PCB )+MB%. 7 2S#M )+MB%. 1 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, PCBT>P%*2S#M3)#M%*CSI?$'#D3P.'C'PT*$PSB2%) PSB)#M%*@()T573$#)2*#SS%M3 I'#SI:%*7513CMP#T*>%S %)D22'&&-IC'TION CONT)O- B-OC1 3'CB4 '&&-IC'TION CONT)O- B-OC1 3'CB4 the application program returns control to I! when finished (y issuing a 90B./?.ENT)( 7D-IT&-I8,SIN. IO6&CB-O'N6&CB&'(6&CB925 +/Bsare passed (y I! to the application program in the same order they are listed in the +!B. )he I0-+/B must (e listed first. 5or I! programs that also uses DB22 the entry statement is not specified. Instead the +/Bs are coded in the +rocedure Division statement.&)OCED,)E DI*ISION ,SIN. IO6&CB-O'N6&CB&'(6&CB926Communication wit! IMS Communication wit! IMS .ccess to an I! data(ase is gained through the Data 6anguageInterface2 commonly 4nown as D6I. )he D6I interface may (e invo4ed in one of two ways ' By ma4ing a call to the IB supplied program /B6)D6I @ passing an +/B By invo4ing the :A:/-D6I /I/! interface @ passing a +/B27&-ITD-Ica"" &-ITD-Ica"" 0 0C'-- 7&-ITD-I8 ,SIN.&')M6CO,NT/,NCTION&CBIO6')E'SS'9 &arm6count tells how many parameter follow. )his is a 4-(yte (inary field defined as!B%C& /0+./unction )ells D6I what type of call to ,"-e.ContC--28 &CB tells I! what data(ase to process and has return information from I!. IO6')E' tells I! where to place the data %for retrievals& and where to find the data %for updates&. SS' 3Segment Searc! 'rgument4 steer I! to correct segment (y supplying details such as segment name and 4ey values.29&CB $ &CB6M'S1 &CB $ &CB6M'S1 )he +/B descri(es the results of each call made to I!. )here should (e a one to one relationship (etween the +/Bs defined in the +!B and the +/Bs defined in the program. )he +/Bs are listed on the :1)*= statement and then defined in the 6I1?.9: !:/)I01 in the form of +/B-.!?. 0ne +/B-.!? for each +/B. :ach +/B-.!? is an D7 level record in the lin4age section. the application program never moves anything to it.34IO6')E'S IO6')E'S )he I0-.*:. passed to the I! is the storage location for the segment to (e processed. It"s a two-way communication. 5or retrieval calls2 the I! places the segment retrieved in the I0-.*:.. 5or update calls2 the program must place the update segment in the I0-.*:. and I! will use it to update the data(ase. )he I0-.*:. length should (e more enough to hold the longest segment used in the program2 otherwise I! will overlay the su(se3uent storage after the I0-.*:..35SE.MENT SE')C ').,MENT 3SS'4 SE.MENT SE')C ').,MENT 3SS'4 !!. allow the application program to define to I! the type of data(ase access re3uired. )here are two-types of calls to I! ' +,'-I/IED C'-- ' )he application pgm provides an!!. telling I! what segment to access ,N+,'-I/IED C'-- ')he application pgm does not provide an !!.. I! willdetermine what segment to process.36 5or Hualified calls2 there are two types of !!.s ' ,N+,'-I/IED SS' ' 0nly the segment name is provided +,'-I/IED SS' ')he segment name2 4ey value and other information is provided (y the application.37 ,N+,'-I/IED SS'+0! D:!/*I+)I017-C !:9:1) 1.:B B6.1?E8 -+gm tried to replace#delete a segment that had not(een held. 7II8 -+gm tried to insert a segment that is already e-ist.7'>8 - )he !!. is coded incorrectly.51IMS &rocessing ModesI! +rocessing can (e done thru three different modes 'D-/I -It"s a pure (atch processing and data(ase will (e mentioned in the form of DD statement. i.e. )he data(ases will (e used in when they are not up. BM&- 7Batc! Message &rocessing8. In B+ mode the application run in con,unction with an I! control region. .n $! started tas4 controls all online and B+ programs. .lthough these ,o(s are run thru (atch mode (ut they use to run on data(ase directly. i.e. B+ ,o(s uses online data(ases. B+ ,o(s can (e hourly2 daily2 wee4ly2 monthly etc.52MPP DEMessage Processing Program F In MPP ,&'e the "pp#i!"ti&n $%n is " &n#ine"pp#i!"ti&n *hi!h %p'"tes/en:%i$e '"t"("se in p%$e &n#ine ,&'e. A## the t$"ns"!ti&ns ,"'e ( )"$i&%s te$,in"#s "!!%,%#"te' in the f&$, &f ,ess"+es in " ,ess"+e :%e%e "n' then the IMS s!he'%#"$ p$&!ess "## th&se ,ess"+es "+"inst &n#ine '"t"("ses th$% &n#ine p$&+$",s. A## MPP $e:%est "$e h"n'#e' th$% the IMS &n#ine $e+i&n.53SUMMARY)he course is starting with the introduction of I! terminology and covering all areas essential to start writing a I! DB program.)he topics covered in the course are Intro to I! DB components2 +rogramming techni3ues2 $arious functions and status codes in I! and finally a (rief a(out the processing mode availa(le in the I! world. )his course is definitely a good start to sail through the I! ocean and to e-plore its power and comple-ities.