TATA INFOTECH LTD.

Information Management System Hand Out
TABLE OF CONTENTS

1.

WHAT IS IMS? ................................................................................................................................... 1 1.1. HIERARCHICAL DATA BASE .............................................................................................................. 1

2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17.

GENERAL CONCEPTS IN IMS ...................................................................................................... 2 ARCHITECTURE OF IMS ............................................................................................................... 6 WHAT IS A DBD? .............................................................................................................................. 7 WHAT IS A PSB? ............................................................................................................................... 8 WHAT IS AN ACB? ......................................................................................................................... 10 WHAT IS DL/I? ................................................................................................................................ 10 IMS PROCESSING .......................................................................................................................... 11 DL/I DATABASE ORGANIZATION ............................................................................................. 14 ENTRY AND GOBACK STATEMENT ........................................................................................ 21 IMS PROCESSING .......................................................................................................................... 23 WHAT IS A SSA? ............................................................................................................................. 23 DL/I CALLS ...................................................................................................................................... 24 UNSUCCESSFUL CALLS ............................................................................................................... 32 COMMAND CODES ........................................................................................................................ 33 DL/I STATUS CODES ..................................................................................................................... 34 DL/I ACCESS METHODS .............................................................................................................. 37

17.1. HSAM ....................................................................................................................................... 37 17.1.1. Defining HSAM ..................................................................................................................... 37 17.1.2. Stored Segment Occurrence .................................................................................................. 38 17.2. HISAM ...................................................................................................................................... 38 17.2.1. Data storage using KSDS-ESDS: ...................................................................................... 38 17.2.2. Stored Segment Occurrence .................................................................................................. 39 17.2.3. Stored Segment Occurrence .................................................................................................. 41 17.3. HDAM ....................................................................................................................................... 44 17.3.1. Data Storage using ESDS/OSAM ......................................................................................... 44 17.3.2. Defining HDAM .................................................................................................................... 46 17.3.3. Stored Segment Occurrence .................................................................................................. 46 17.4. HIDAM ..................................................................................................................................... 47 17.4.1. Defining HIDAM .................................................................................................................. 47 18. SECONDARY INDEXING .............................................................................................................. 48 SEGMENTS IN SECONDARY INDEXING ......................................................................................... 48 SECONDARY DATA STRUCTURE ................................................................................................. 49 POINTERS IN SECONDARY INDEXING .......................................................................................... 50

18.1. 18.2. 18.3.

IIMSHD/VER 0.2 .

For Internal Use Only

TATA INFOTECH LTD.
19. 20.

Information Management System Hand Out

MULTIPLE DATASET GROUP .................................................................................................... 52 WHAT IS A LOGICAL RELATIONSHIP? .................................................................................. 53 TYPES OF LOGICAL RELATIONSHIPS ........................................................................................... 54 DEFINITIONS............................................................................................................................... 57 RULES IN LOGICAL RELATIONS................................................................................................... 65

20.1. 20.2. 20.3. 21.

DATA COMMUNICATION AND MESSAGE FORMAT SERVICE ........................................ 65

21.1. WHAT IS A LOGICAL TERMINAL? ................................................................................................ 66 21.2. MESSAGE PROCESSING IN IMS ................................................................................................... 66 PROCESSING A JOB IN IMS DB/DC ENVIRONMENT .................................................................................. 67 21.4. INPUT MESSAGE AREA ............................................................................................................... 70 21.5. OUTPUT MESSAGE AREA ........................................................................................................... 71 21.6. MESSAGE FORMAT SERVICE AND ITS CONTROL BLOCKS ............................................................ 72 CODING OF MFS STATEMENTS ................................................................................................................... 1 21.8. CODING OF DEVICE FORMAT STATEMENTS ................................................................................. 74 21.9. CODING MESSAGE DESCRIPTOR CONTROL STATEMENTS ........................................................... 79 21.10. DYNAMIC CHANGING OF ATTRIBUTES AND CURSOR POSITION CONTROL .................................. 81

IIMSHD/VER 0.2 .

For Internal Use Only

TATA INFOTECH LTD.

Information Management System Hand Out

1. What is IMS?
 IMS is an acronym that stands for Information Management System.  A software product for creating and managing the physical storage and retrieval of data that is organized using hierarchical data structure. 1.1. Hierarchical Data Base       A hierarchical data base consists of collection of elements called as segments. Segments are connected to each other through links. It is similar to an upside down tree structure. The top of hierarchy forms the root. A segment may relate downwards to one or more sub-ordinate segments called as child segments. A segment may relate to only one segment above it called as parent segment.

COURSE (Root)

CLASS (Parent/Child)

INSTRUCTOR (Child)

STUDENT (Child)

Fig.1.0. Hierarchical Structure

IIMSHD/VER 1.0

For Internal Use Only

Page 1 of 84

TATA INFOTECH LTD.

Information Management System Hand Out

2. General Concepts in IMS
Segment:  Each grouping of data.  Basic element of the data structure.  Consists of one or more related fields.  Can be compared with file record.  Unit of I/O.  It is an entity and cannot be broken.  Can contain  Key Field or Sequence Field: A field within a segment used for searching, indexing and sequencing purposes. Only one key per segment is allowed and should be the first field in the segment. It may or may not be unique.  Search Field: A field within a segment that is a non-key field but can be used for search operations.  Data Field: A field within a segment that contains data related to the segment. Data in this field cannot be used for search operations

In Fig. 1.0. COURSE, CLASS, INSTRUCTOR, STUDENT are segments. Segment Type:  Layout of segment within hierarchical structure.  Can be compared with record description.  Maximum 255 per data base record. Segment Occurrence:  Consists of a set of field occurrences within a segment.  Can be compared with a record occurrence in a flat file system.  Can have key field called as sequence field.  A particular segment type can have any number of segment occurrences.  Fig 2.0. shows the segment occurrences.

IIMSHD/VER 1.0

For Internal Use Only

Page 2 of 84

 A child segment cannot have more than one parent. 2.  Only one root per data base record. Refer Fig.1. Root Segment:  Highest level segment in data base structure. Refer Fig. Dependent Segments:  All segments under a particular segment are dependent segments. Refer Fig. Only Child Segment:  A dependent which does not have any dependents. Refer Fig.1. Parent Segment:  A dependent segment which has one or more dependent segments is called as a parent segment.  A root may have any number of child segments.TATA INFOTECH LTD.2.1. IIMSHD/VER 1.2.0 For Internal Use Only Page 3 of 84 . Refer Fig.  Any segment other than root segment is called as dependent segment.  Root segment is at level 01.1.2. Child Segment:  A segment that is directly dependent on some other segment is called child segment. Only Parent Segment:  A segment which does not have any parent.2.1.0. Information Management System Hand Out COURSE2 COURSE1 CLASS1 Segment Occurrence INSTRUCTOR1 INSTRUCTOR2 STUDENT2 STUDENT1 Twin Segments Fig.  The root is the parent-only segment.2.

Path:  Series of continuous segment occurrences starting from root to any dependent segment.TATA INFOTECH LTD.1. The roots being at level one. Refer Fig. Twin Segment:  Multiple occurrences of a particular child segment under a common parent segment. Refer Fig.1. IIMSHD/VER 1.  Root always starts with STC = 01.1. Refer Fig.  The path starting from the root and ending at the last level is called complete path.1. 2. This value is called STC. 2. Information Management System Hand Out Parent/Child Segment:  A dependent. 2. STC = 01 COURSE (Level-01) STC = 02 PRE-REQ (Level-02) STC = 03 CLASS (Level-02) Parent/Child Root /Only Parent Sibling STC = 04 INSTR (Level-03) STC = 05 STUDENT (Level-03) Only Child & Siblings Fig.  These values are used by the operating system access methods for the retrieval of data. Segment Type Code (STC):  Each Segment is assigned a value ranging from 1 to 255 according to hierarchic sequence. There can be maximum 15 levels. Refer Fig 2.1.0 For Internal Use Only Page 4 of 84 .0. 2. Sibling:  Child segment types under one parent segment type. Level:  This indicates the depth of tree from root. which has dependents. 2. Refer to fig. can be a parent/child segment.

2. 2. COURSE1 CLASS1 INSTRUCTOR2 INSTRUCTOR1 STUDENT2 STUDENT1 Twin Segments Fig.3. Refer Fig.3.TATA INFOTECH LTD. 2. Concatenated Key IIMSHD/VER 1. Information Management System Hand Out Data Base Record:  Each occurrence of root segment with all its sub-ordinate segments makes a single data base record. Data Base Record Concatenated Key:  Sequence field of each segment within hierarchical path beginning with root segment sequence field.2.2. Refer Fig. 2.0 For Internal Use Only CRS1CLS1STU1 Page 5 of 84 . COURSE1 CRS1 Concatenated Key CRS1PRE1 PREQ1 CLASS1 CRS1CLS1 STUDENT1 Fig.  Is positioned from left to right.

. Information Management System Hand Out 3. The host language Data language/I (DL/I) acts as an interface between the application program and the operating system...0. Logical Database D B D D B D D B D .. The Program Communication Block (PCB) describes a logical view of the database as seen by the application program.TATA INFOTECH LTD. These views are clubbed together to form a Program Specification Block (PSB). Architecture of IMS Host Language + DL/I PSB P C B P C B .0.. An application program can have more than one view..3. Architecture of IMS Fig. shows the architecture of IMS.0 For Internal Use Only Page 6 of 84 . The physical data structure is called as Data Base Descriptor (DBD). The operating system access methods used for IMS are:  Virtual Storage Access Method (VSAM) IIMSHD/VER 1.... Physical Database Fig 3.

 Assembly Macros are expanded with the help of Macro Library.4.  Search fields (optional). IIMSHD/VER 1.0.  Indexed Sequential Access Method (ISAM)  Overflow Sequential Access Method (OSAM) Information Management System Hand Out 4. What is a DBD?  Means Data Base Description.  The DBA initiates a process called DBDGEN (Data base generator) to describe physical structure of database. A DBD contains:  Segment Types. DBDGEN Definition.  Used to describe the complete structure of database (physical database). Assembler Macro DBDGEN Programs DBD Library Macro Library Fig.  Field in each segment.TATA INFOTECH LTD. Refer Fig.0. Defining a DBD:  Source form of DBD written in assembler macro is input to DBDGEN program.0 For Internal Use Only Page 7 of 84 .  Parent Child relations.4.  Load Module is stored in DBD library and retrieved when required by IMS.

load only etc..  Field level sensitivity If the data view includes only certain fields within a segment it is said to have field level sensitivity. retrieve only..  There is only one PSB in a given application program.  Each view is defined in a PCB...  This control block specifies the information regarding different views i. DBDGEN Statements: DBD NAME=TRGDBD DATASET DD1=IN..START=4. Dataset name and location.SEQ. IIMSHD/VER 1.TYPE=C . start position and type.BYTES=3.START=1.DEVICE=3380 SEGM NAME=COURSE.. the databases (one or more) a program can access.TATA INFOTECH LTD.  PCB has two types of sensitivity :  Segment level sensitivity If an entire segment is included in the view it is said to have segment level sensitivity.. the data elements the program can “see” in those databases. size.. parent and size. and the processing the program can do..PARENT=0.).  Set of all PCBs is included in the PSB.BYTES=256 FIELD NAME=(COURSE#.. What is a PSB?  Means Program Specification Block.TYPE=C FIELD NAME=TITLE. 5.0 For Internal Use Only Page 8 of 84 .BYTES=33.. Segment name..e..  An application program may have more than one view (logical data structure). Information Management System Hand Out Essentials for defining the structure:     Data base name.  PCB also defines how the application program is allowed to process the segments (update..  The PCB defines which of the segments in the database the program can access. What is a PCB?  Means Program Communication Block. DBDGEN FINISH END.U). Field names.

5. Assembler Macro PSBGEN Programs PSB Library Macro Library Fig. PSBGEN Statements: TYPE=DB.0.  Assembly Macros are expanded with the help of Macro Library. PSBGEN Definition.  Load Module is stored in PSB library and retrieved when required by IMS. 5.TATA INFOTECH LTD. Defining a PSB:  Source form of PSB written in assembler macro is input to PSBGEN program. IIMSHD/VER 1. Refer Fig.0 For Internal Use Only Page 9 of 84 PCB .  Sensitive fields.0.  Sensitive Segments. PROCOPT=A SENSEG NAME=STREAM SENFLD NAME=STRNO .DBDNAME=TRGPDBD.  Concatenated Key length. Information Management System Hand Out A PCB contains:  DBD Name.  Processing Options (PROCOPT).KEYLEN=15.

. 7.  It transfers information to and from database.  Serves as an interface between the data base and application program i. DLET ISRT IIMSHD/VER 1. What is DL/I?  Stands for Data Language /I.  Used to pre-build the database with DBDs and PSBs.Unique) GN ( Get-Next) GNP (Get-Next-Within-Parent) REPL Description To obtain a unique occurrence of a segment within a database. SENFLD : Sensitive field 6. To delete an occurrence of segment in database.  Allows application program to manipulate database. To insert an occurrence of segment in database. DL/I Functions: Calls GU (Get. To obtain the next occurrence of a segment within a database.TATA INFOTECH LTD.  It is the data manipulation language (DML) for IMS.  Subroutine called by application program that is host language (COBOL). SENSEG : Sensitive Segment.0 For Internal Use Only Page 10 of 84 .  Used for faster access.  Set of IMS modules that exist external to the application program. PSBGEN NAME=INLOAD. Retrieves child segments under a parent To replace an occurrence of a segment in database.e.LANG=COBOL END Information Management System Hand Out PCB : Program Communication Block PROCOPT : Program processing options. What is an ACB?  Means Application Control block.

0. Information Management System Hand Out 8.8. IMS Processing BATCH Processing BATCH/MESSAGE ON-LINE MESSAGE Processing Processing Fig.TATA INFOTECH LTD.8.)  Batch Processing  Online Message processing  Batch Message processing IMS Batch Processing: JCL IMS Controller Application Program DATA SET DL/I DBD Lib PSB Lib IIMSHD/VER 1.0.0 For Internal Use Only DATA BASE Page 11 of 84 . Types of IMS Processing IMS processing is of the following types: (Refer Fig.

0 For Internal Use Only Page 12 of 84 .1. IMS Batch Processing Information Management System Hand Out IIMSHD/VER 1.TATA INFOTECH LTD.8. Fig.

 No data communication services or terminals are used.2 For Internal Use Only Page 13 of 84 . Can Access Message Queue and cannot access OS/VS data sets.2.  Input is pre-planned.8. Data communication services or terminals are used. Used for interactive processing. which are stored in message queues. Output can be seen at the terminal screen. Data Base Access is online.  Application Program is scheduled by JCL. To process the transaction application program is invoked.  Can access DL/I database as well as OS/VS data sets. Data Communication Calls are made in order to send and receive data on to the screens and Database calls are made to retrieve and store data on to database.2.TATA Information Management System Hand Out INFOTECH LTD.8. Refer fig. DATA BASE IMS On-line Message Processing          Called as Message Processing Program (MPP).1.8. Refer fig.  Data base access is offline. IIMSHD/VER 0. Transactions are entered at the terminal. IMS Online Message Processing: T E R M I N A L MVS Address Space (VTAM) Communication Controller Queue Manager Message Queues DL/I DBD Lib PSB Lib Fig.

Hand Out IMS Batch Message Processing  Combination of Batch and Online Processing.  Can access online databases in Batch mode.0. DL/I Database organization DL/I DATA BASE ORGANISATION Hierarchical Sequential Hierarchical Direct HSAM HISAM HDAM HIDAM Fig.2 For Internal Use Only Page 14 of 84 .0.  Can access both OS/VS datasets and DL/I database  Can access Message Queues. Access Methods Access Methods (Refer Fig.  BMP programs are scheduled by JCL.9.) HSAM -> Hierarchical Sequential Access Method HISAM-> Hierarchical Indexed Sequential Access Method HDAM -> Hierarchical Direct Access Method HIDAM-> Hierarchical Indexed Direct Access Method IIMSHD/VER 0. 9.  To invoke Application program through JCL‟s the transaction-Id is passed as a PARM parameter.TATA Information Management System INFOTECH LTD.9.

2. Understanding a DBD  DBD statement  Data set Statement  Segment Statement  Field Statement Consider the following Database Structure.2 For Internal Use Only Page 15 of 84 . Virtual Storage Access Method (VSAM). Overflow sequential Access Method (OSAM).9. Indexed Sequential Access method (ISAM). Information Management System Hand Out DL/I Databases are internally stored on Operating System data sets. 9. IIMSHD/VER 0. SUPPSEG ITEM SEG LOCSEG Fig. DL/I data base access methods     Sequential access method (SAM).TATA INFOTECH LTD. DL/I uses Access Methods like: HSAM HISAM ISAM/ OSAM or VSAM HDAM HIDAM ISAM/ OSAM or VSAM SAM OSAM or VSAM Fig.1.

TYPE=C NAME=COLOR.TYPE=C NAME=SSTATE.TATA INFOTECH LTD.U).TYPE=C NAME=SADDR.  DL/I access method HISAM.BYTES=2.BYTES=20.START=6. It includes:  Name of the database INPDBD.TYPE=C NAME=PARTSEG. RECORD=(128.SEQ.BYTES=5.SEQ.START=4.  It should be the first statement in database definition.START=42.DEVICE=3380.START=1.BYTES=95 NAME=(SNO.BYTES=4. The DBD is as follows: PRINT DBD DATASET SEGM FIELD FIELD FIELD FIELD FIELD SEGM FIELD FIELD FIELD FIELD SEGM FIELD FIELD FIELD DBDGEN FINISH END Information Management System Hand Out NOGEN NAME= INPDBD.BYTES=4.START=36.VSAM) DD1=PRIMEDS.BYTES=30.BYTES=6.BYTES=45 NAME=(PNO.OSAM ) VSAM] (HIDAM [ .START=34. (All names are limited to 1-8 characters).PARENT=0.BYTES=3.TYPE=P NAME=LOCSEG.BYTES=30.PARENT=PARTSEG. ACCESS=(HSAM) (HISAM [ .SEQ.PARENT=SUPPSEG.U).TYPE=C NAME=WEIGHT.TYPE= C NAME=SNAME.TYPE= C NAME=PNAME.128) NAME=SUPPSEG.START=64.START=84.BYTES=30. Format: DBD NAME=dbdname.BYTES=30.ISAM )  for index in HIDAM VSAM] IIMSHD/VER 0.START=34.OSAM ) VSAM] (INDEX [ .TYPE=C NAME=SCITY.START=1.BYTES=3.ISAM ) VSAM ] (HDAM [ . OVFLW= OVFLWDS.TYPE=C NAME=QTY.ACCESS=(HISAM.TYPE=C DBD Statement  Defines the database.START=1.BYTES=37 NAME=(LOCCOD.TYPE= C NAME=LDES.2 For Internal Use Only Page 16 of 84 .U).START=4.  Underlying OS Access Method VSAM.

lrec2) Example of DATASET statement: For HSAM DATASET DD1= ddname1 .DEVICE=device .  DEVICE=3380. Information Management System Hand Out DATASET Statement  Defines the Operating System Data set(s) used to store the database.OVFLW=ddname3 . Overflow data set (VSAM ESDS)  RECORD=(128.DEVICE=device . RECORD=(lrec1.DD2=ddname2 .DEVICE=device IIMSHD/VER 0.DEVICE=device For HIDAM DATASET DD1=ddname1 . Eg: HISAM requires 2 data sets  PRIMEDS.DEVICE=device . primary data set (VSAM KSDS)  OVRFLWDS . RECORD=(lrec1.TATA INFOTECH LTD.2 For Internal Use Only Page 17 of 84 .  Data Definition names DD1 and DD2 are required to identify the data sets at execution time.128) specifies the logical record length of primary and overflow data set respectively.lrec2) For HDAM DATASET DD1=ddname1 .lrec2) For HISAM DATASET DD1=ddname1 . RECORD=(lrec1.DD2=ddname2 . specifies the unit Format: DATASET DD1=ddname1 .OVLFLW=ddname3 .

BYTES=bytes.  Default for SEQ is U (unique) unless M (multiple) is specified.  Sequence of SEGM statement reflects the hierarchical structure of the database. It specifies:  Name  Length  Type  Starting position of field  Specification of sequence field is optional.U/M]). FIELD statement:  Defines the format of field within the segment.TATA INFOTECH LTD.  Sequence field should be defined as the first field in the segment. START=start position. Information Management System Hand Out SEGM statement:  SEGM statement defines the segment type and inter segment relationship. Format: FIELD NAME=(fldname[.SEQ][. PARENT=segname2 indicates that the current segment (segname1) is a child of segname2.2 For Internal Use Only Page 18 of 84 .0 or Segname2]) BYTES=max bytes PARENT=0 indicates that the segment is root segment. TYPE=[C/X/P] IIMSHD/VER 0. PARENT=( [ . The order will be taken from  Top to Bottom  Left to Right Format: SEGM NAME=segname1.

the PCB for the DBD is PRINT PCB SENSEG SENSEG SENSEG PSBGEN END Information Management System Hand Out NOGEN TYPE=DB. The different PROCOPTs are:  G Get operation  IInsert  RReplace  DDelete  AAll (GIRD)  L or LSInitial Load  KKey sensitivity  OOnly  P For path calls Note: PROCOPT can have four options at the most. PSBGEN Statement  Assigns a name to the PSB.LANG=COBOL PCB Statement:  Defines the DBD name.DBDNAME=INPDBD. Understanding PCB:  PCB statement  SENSEG Statement Referring to fig.9.  LANG parameter specifies the host language.2 For Internal Use Only Page 19 of 84 .  DBDNAME=INPDBD specifies the underlying physical database to which the PCB corresponds to. IIMSHD/VER 0. the key length and the processing options.2.KEYLENGTH=11. PROCOPT=LS NAME=SUPPSEG NAME=PARTSEG.TATA INFOTECH LTD. SENSEG Statement  It defines the segment to be included in the PCB.PARENT=SUPPSEG NAME=LOCSEG.PARENT=PARTSEG PSBNAME=INLOAD.  KEYLENGTH=11 specifies the length of the longest concatenated key. which is going to use the PSB.  PROCOPT parameter specifies the type of operations user will be permitted to perform on the segment.  TYPE=DB specifies that the PCB is for database and not for data communication (TYPE=TP).

COMP. 05 PCB-DBD-NAME 05 PCB-SEG-LEVEL 05 PCB-STATUS-CODE 05 PCB-PROC-OPTION 05 FILLER 05 PCB-SEG-NAME 05 PCB-KEY-LENGTH 05 05 PCB-NUM-SEN-SEG 05 PCB-KEY-FB-AREA PIC X(8)... IIMSHD/VER 0..these are called PCB masks.9.. PIC S9(5) COMP.TATA INFOTECH LTD. PCB-SEG-LEVEL:  Contains the level of segment just processed.. Format: 01 PCB-MASK-1.] PCBs should be defined in the linkage section of COBOL program . This area is called as PCBMASK. PCB-DBD-NAME:  Contains the name of the DBD being processed. PIC XX. Information Management System Hand Out Definition of PCBMASK: Specifies address of each PCB in PSB. PIC X(11). DL/I APPLICATION PROGRAM ENTRY ‘DLITCBL’ USING PCB-name1 [PCB-name2 . PCB Mask  For each PCB in the PSB an area with certain predefined fields is declared in the linkage section of the COBOL program.2 For Internal Use Only Page 20 of 84 .3. PIC XX... PIC S9(5) COMP. Fig. PIC X(4). PIC X(8). PIC S9(5)..

PCB-KEY-FB-AREA:  Contains the fully concatenated key . Entry and Goback Statement ENTRY „CBLTDLI‟ DL/I GO BACK APPLICATION PROGRAM Fig. PCB-PROC-OPTION:  Contains the processing options defined at the time of creation of PCB. Note: All the data items defined in the PCBMASK are of a fixed length except for the PCB-KEY-FB-AREA.2 For Internal Use Only Page 21 of 84 . 10. PCB-KEY-LENGTH:  Contains the length of the concatenated key until the last successful call. PCB-SEG-NAME:  Contains the name of the segment that has been just processed.0. Its length will correspond to the length of longest possible concatenated key. PCB-NUM-SEN-SEG:  Gives the number of sensitive segments defined in the PCB macro. Information Management System Hand Out PCB-STATUS-CODE:  Tells whether DL/I call was successful or failed. If it is blank the call was successful.TATA INFOTECH LTD. Entry and Go Back Statement IIMSHD/VER 0.10.

Note: STOPRUN should not be coded.)  Used to terminate the Application Program and transfer control to IMS. Eg: GU (Get Unique) Note: COBOL does not support Literal on CALL Statement segment-io-area is the name of the working-storage section field into which DL/I will return the retrieved data and from which DL/I will get the data for write. Format: ENTRY „DLITCBL‟ USING pcb-name1 [pcb-name2………] GOBACK Statement (Refer fig.0.  Coded in the Procedure Division.  Should be the first statement in Procedure Division. DL/I Call Statement  This statement is used to transfer control from the application program to the DL/I interface.0.)  Used to initiate communication between DL/I and Application Program and facilitate use of IMS Resources. Information Management System Hand Out Entry Statement (Refer fig. This function has to be specified in the working-storage section.2 For Internal Use Only Page 22 of 84 .10. Format: GOBACK. Format: CALL „CBLTDLI‟ USING dli-function pcb-mask segment-io-area [ssa‟s ] dl/i function is used to specify the operation to be performed on the database. IIMSHD/VER 0.TATA INFOTECH LTD.  Should be the last statement coded in Procedure Division. update operations.10.

 Identify a specific occurrence of a segment type.  The GN and GNP DL/I functions are used to retrieve data.2 For Internal Use Only Page 23 of 84 .  Random Processing.  Only one read call (GU/GN) gets the required record.  It is an area in the WORKING-STORAGE SECTION used to identify the segment that the program wants to access. IIMSHD/VER 0.  The segment name and sequence field.  There can be 1-15 SSAs in a DL/I call. What is a SSA?  Stands for Segment Search Argument. Sequential Processing:  Data is read in a hierarchic sequence.  The SSAs must appear in hierarchical order of segment types.TATA INFOTECH LTD. SSA Contains:  The segment name. IMS Processing There are two types of IMS processing:  Sequential Processing. Information Management System Hand Out ssa is the segment search argument.  It can be used to:  Identify any occurrence of a segment type. Types of SSAs  Unqualified  searches for a specific segment type only. It is used to specify the search criteria. Random Processing:  Access to database records is random.  Qualified  searches for a specific segment occurrence of a specific segment type. 11.  The segment name and search field. 12.  To get the nth segment all the „n-1‟ segments have to be read. This is a variable in the working-storage section used to hold either the sequence field or the search field but not the data field.  It always follows the I/O area parameter.

05 Q-SSA-SEGMENT-NAME 05 FILLER 05 KEY-NAME 05 OPERATOR 05 KEY-VALUE 05 FILLER PIC X(8) VALUE „SUPPSEG „. PIC X VALUE „ ‟.2 For Internal Use Only Page 24 of 84 . value of sequence/search field depends on actual size of the field (variable). Information Management System Hand Out Unqualified SSA  Specifies the segment name only. The blank in the 9th position distinguishes an unqualified SSA from a Qualified SSA. 05 U-SSA-SEGMENT-NAME 05 FILLER PIC X(8). Note: Segment name is padded with spaces whenever it is less than 8 characters. PIC X(8) VALUE „SNO „. DL/I Calls  Retrieve from database  GU (Get Unique)  GN (Get Next)  GNP (Get Next Within Parent)  Hold Calls  GHU (Get hold Unique)  GHN(Get hold next)  GHNP(Get hold next within parent) IIMSHD/VER 0. Format: 01 UNQUALIFIED-SSA. PIC XX VALUE „=‟. Format: 01 QUALIFIED-SSA. PIC X VALUE „(„. PIC X(3) VALUE „111‟. Note: Segment name is padded with spaces whenever it is less than 8 characters. PIC X VALUE „)‟.TATA INFOTECH LTD. 13.  Call made using unqualified SSA will access the database to retrieve the segment from the current position. Qualified SSA  It supplies the DL/I call with either a sequence field value or search field value in addition to the segment name.

Eg: In fig. IIMSHD/VER 0.2 For Internal Use Only Page 25 of 84 .13.  Used in case of random processing. Data base structure GU (Get Unique):  Used to retrieve a unique segment.  Used to establish position in the database.  Used to reset the position in database.0. The types of GU calls are:  GU without SSA:  Retrieves the first occurrence of the root segment.13.  Is independent of the position established by the previous calls.0.  Insert Call  ISRT(Insert into Database )  Update Call  REPL(Replace a record in database)  DLET(Delete a record form database) Information Management System Hand Out COURSE CLASS STUDENT Fig.  Retrieves the first occurrence of the segment satisfying the condition even if issued in a loop. Format: CALL „CBLTDLI‟ USING DLI-GU PCB-MASK IO-AREA. GU call retrieves first occurrence of COURSE.TATA INFOTECH LTD.

 A complete set of SSAs to retrieve a segment includes uniquely identified SSAs one for each segment.0. Format: CALL „CBLTDLI‟ USING DLI-GU PCB-MASK IO-AREA QSSA. 13. In fig.2 For Internal Use Only Page 26 of 84 . Information Management System Hand Out  GU with unqualified SSA:  Retrieves the first segment occurrence in the database that meets the criteria.TATA INFOTECH LTD.13.  The segment retrieved will be the one specified at the lowest level SSA. issuing this call will retrieve the first occurrence of CLASS under the first occurrence of COURSE. Eg: Consider USSA is COURSE CLASS In fig. Format: CALL „CBLTDLI‟ USING DLI-GU PCB-MASK IO-AREA USSA. Eg: Consider that QSSA is COURSE (CRSNO = IMS) CLASS (EDCTR = ED01) STUDENT (STUNO = 001). issuing the call with above SSA will retrieve the student details whose number is 001 under CLASS ED01 attending COURSE IMS. IIMSHD/VER 0.  GU with qualified SSA:  Retrieves the first segment occurrence in the database that meets the criteria.  Processing is based on unique fields and unique values.  The segment retrieved will be the one specified at the lowest level SSA.0.

2 For Internal Use Only Page 27 of 84 .13..0.  The segment retrieved will be the one specified at the lowest level SSA.  Is dependent of the position established by the previous calls.TATA Information Management System INFOTECH LTD. Eg: In fig.  GN with qualified SSA: IIMSHD/VER 0.13.  GN without SSA if issued in a loop retrieves the entire database. Format: CALL „CBLTDLI‟ USING DLI-GN PCB-MASK IO-AREA.  When issued in a loop retrieves the entire database.0.  Used in case of sequential processing. Hand Out GN (Get Next):  Retrieves the next segment meeting the criteria from the currently established position. GN call retrieves next occurrence of COURSE from the current position. Types of GN calls are:  GN without SSA:  Retrieves the next occurrence of the segment that meets the criteria from the current position. issuing this call will retrieve the next occurrence of CLASS under the COURSE where the current position is established.  GN with unqualified SSA:  Retrieves the next segment occurrence in the database that meets the criteria from the current position. Format: CALL „CBLTDLI‟ USING DLI-GN PCB-MASK IO-AREA USSA. Eg: Consider USSA is COURSE CLASS In fig.

then all the students under ED001 are retrieved.  A complete set of SSAs to retrieve a segment includes uniquely identified SSAs one for each segment.2 For Internal Use Only Page 28 of 84 .  Parentage can be established by issuing a GU or a GN call.TATA Information Management System INFOTECH LTD.  GNP with qualified SSA in a loop retrieves all the duplicates just like a GN with a fully qualified SSA.  Delete and Replace calls do not affect parentage.  Establishing new parentage by issuing GU or GN can change parentage.0.  It searches only segment occurrence within a common parent.  Parentage has to be established before using GNP.0.  The segment retrieved will be the one specified at the lowest level SSA. GNP (Get-Next-Within-Parent):  Used to sequentially access dependent segments of an established parent segment.13. if the parentage is established at CLASS where CLASS=ED001 and a unqualified GNP call is issued .  After establishment of parentage the GNP call can be issued to retrieve all dependent segments.e.  This is same as GU issued with a fully qualified SSA.  Processing is based on unique fields and unique values. Hand Out  Retrieves the next segment occurrence in the database that meets the criteria from the current position. Format: CALL „CBLTDLI‟ USING DLI-GNP PCB-MASK IO-AREA [USSA/QSSA] Eg: In fig. used to retrieve duplicate segment occurrences. issuing the call with above SSA will retrieve the student details whose number is 001 under CLASS ED01 attending COURSE IMS.  Used when sequence field is not unique i. IIMSHD/VER 0. Format: CALL „CBLTDLI‟ USING DLI-GN PCB-MASK IO-AREA QSSA. Eg: Consider the QSSA as COURSE (CRSNO = IMS) CLASS (EDCTR = ED01) STUDENT (STUNO = 001) In fig13.  Insertion at higher level or same level as parentage will destroy the parentage.

REPL and DEL Format: RULE = position Position can take the values: FIRST:  For insert the segment occurrence must be inserted at the first.  For delete the segment occurrence at the current position.  For delete the first segment occurrence must be deleted.  To load a new database. FIRST overrides HERE. ISRT (Insert):  Used to  Add a data to an existing database. GN and GNP respectively. LAST:  For insert the segment occurrence must be inserted at the last. ‘RULE’ Option for ISRT.  For replace the last segment occurrence must be replaced. GHN and GHNP functions like GU. These calls are issued to hold the segments retrieve by the call. is to be be replaced. These calls are used prior to „DLET‟ or „REPL‟ call.  For delete the last segment occurrence must be deleted.  For replace the first segment occurrence must be replaced.  The data to be inserted is moved to the IO-AREA. LAST cannot be overridden. Inserting data to a existing Segment:  A fully qualified SSA has to be given in order to establish the position where in the segment to be inserted and an unqualified SSA for the segment being inserted.TATA INFOTECH LTD.2 For Internal Use Only Page 29 of 84 . must be deleted. Note: LAST is the default rule. LAST overrides FIRST and HERE. HERE:  For insert the segment occurrence must be inserted just after the current position. IIMSHD/VER 0. Information Management System Hand Out Hold Calls: GHU.  For replace the segment occurrence at the current position.  An unqualified SSA is given to the segment to be inserted.

2 For Internal Use Only Page 30 of 84 . if ISRT call is issued with the above SSA a new database record for COURSE is inserted.  The new data must be moved to IO-AREA before replace call is issued. Initial loading of database: In this case only unqualified SSA is specified and the data to be inserted is placed in the IO-AREA.13. REPL (Replace a segment occurrence):  Used to replace an existing segment occurrence. Format: CALL „CBLTDLI‟ USING DLI-ISRT PCBMASK IO-AREA USSA.  No SSA must be given along with a REPL call (except path call).  The length of segment cannot be changed and the value of sequence field cannot be changed. In fig. if data is to be inserted in STUDENT for an already existing COURSE and CLASS the SSAs will be QSSA1 is COURSE (CRSNO = IMS) CLASS (EDCTR = ED001) USSA1 is STUDENT With the above SSAs when an insert call is issued the data present in IO_AREA will be inserted as a new student for IMS course for ED001 class. Eg: USSA is COURSE.TATA INFOTECH LTD.  Before REPL is issued.  When path call is issued along with GHU and a particular segment data is not to be changed then command code „N‟ must be issued along with the SSA for that particular segment. IIMSHD/VER 0.0. Format: CALL „CBLTDLI‟ USING DLI-ISRT PCB-MASK IO-AREA QSSA1 USSA1.13. GHN or GHNP must be issued in order to hold the segment occurrence to be replaced. a GHU.0. Information Management System Hand Out Eg: In fig.

 When a segment occurrence is deleted then all the subordinate occurrences of that segment will also be deleted. Information Management System Hand Out Format: CALL „CBLTDLI‟ USING DLI-REPL PCB-MASK IO-AREA . a GHU. GHN or GHNP must be issued in order to hold the segment occurrence to be deleted.  No SSA must be given along with a DLET call (except path call). (Refer fig. an unqualified SSA for the segment to be deleted can be given along with DLET call.  In case if the previous call was a path call.) DLET (Delete a segment occurrence):  Used to delete an existing segment occurrence. Format: CALL „CBLTDLI‟ USING DLI-DLET PCB-MASK IO-AREA [USSA].13. Here USSA is COURSE. Eg: CALL „CBLTDLI‟ DLI-GHU PCB-MASK IO-AREA USSA.2 For Internal Use Only Page 31 of 84 . IIMSHD/VER 0.TATA INFOTECH LTD. Eg: CALL „CBLTDLI‟ USING DLI-GHU PCB-MASK IO-AREA USSA. After this call is issued the first course data will be replaced with the new data that is in the IO-AREA.0.  Before DLET is issued. CALL „CBLTDLI‟ DLI-REPL PCB-MASK IO-AREA.

CALL „CBLTDLI‟ USING DLI-DLET PCB-MASK IO-AREA.0. Consider the call GU A(AKEY=A1) B(BKEY=B1) C(CKEY=C3) D1 F1 GN What is the Output? Ans: D1 IIMSHD/VER 0.13. 14. Information Management System Hand Out After this call is issued the first course and it‟s corresponding dependents data will be deleted (Refer fig. Here USSA is COURSE.0. Refer fig.2 For Internal Use Only Page 32 of 84 .TATA INFOTECH LTD.) 14. 14.0.Unsuccessful Calls What happens when a call fails? A1 B3 B2 B1 E1 C2 C1 Fig.

PIC X VALUE „*‟. the COURSE occurrence with key C3 is not available.Command Codes Specified along with the SSA. The Key feedback area contains values up to the step till where the call is successful.2 For Internal Use Only Page 33 of 84 . 01 QUALIFIED-SSA. So the GU call fails.  In case of successful REPL call the previously established position is maintained. 15. Hence when the call GN fails the data stored in Key feedback area is A1B1C1C2. PIC X.  In case of successful DLET call the position is established at the point where the segment is deleted.  In case of successful ISRT call the current position is just after the segment inserted.  Reduces the number of calls required. IIMSHD/VER 0. in case of successful calls. Command codes can be used in  Qualified Calls  Unqualified Calls Format: For unqualified SSA WORKING-STORAGE SECTION.  In case of unsuccessful GU and GN the current position is established just after the segment examined to satisfy the criteria.  Reduce the number of SSAs required. 05 U-SSA-SEG-NAME 05 FILLER 05 U-SSA-COMD-CODE 05 FILLER PIC X(8).0. Note:  In case of GU and GN the current position is established just after the segment retrieved. So the current position established is at segment occurrence C2.TATA Information Management System INFOTECH LTD. Now the next call given is GN. So the next segment occurrence following it is D1. Hand Out As seen in fig14. 01 UNQUALIFIED-SSA. For qualified SSA WORKING-STORAGE SECTION. PIC X VALUE „ „. Hence the output is D1. This is used to  Enhance functionality of SSA.

PIC X(8) VALUE „COURSE „. GN and GNP calls. PIC X(8). PIC X VALUE „)‟. PIC X(2) VALUE „= ‟.TATA INFOTECH LTD. PIC X VALUE „*‟.2 For Internal Use Only Page 34 of 84 . DL/I Status Codes These are the status codes returned as a result of the call issued against standard DL/I databases. Note: F command code can be used with GN and GNP calls. PROCOPT= P should be defined in PCB before using D command Code. 05 SSA-SEG-NAME 05 FILLER 05 SSA-COMD-CODE 05 FILLER 05 SRCH-FLD-NAME 05 FILLER 05 SRCH-VALUE 05 FILLER Information Management System Hand Out PIC X(8). PIC X. Command Code C D F L N P Q U V - Meaning Use concatenated key for segment Path Call Retrieve the first occurrence of the segment under its parent Retrieve the last occurrence of the segment under its parent No replace for the segment for a path replace call Establish parentage at this level (above the lowest level segment returned by the call) Enqueue the segment Hold position for subsequent retrieval on this segment Hold position for subsequent retrieval on this segment and those above it The null command code has the same effect as no command code at all. 16. PIC X VALUE „(„. Using it with GU call is meaningless since GU always retrieves the first segment occurrence meeting the criteria L command code can be used with GU. IIMSHD/VER 0.

TATA INFOTECH LTD. Status Code AB AC AD AH AI AJ AK AM AO AT AU DA DJ DX GA GB GD GE GK GP II IX LB LC LD LE DL/I Call All All get calls & ISRT All ISRT All All All get calls & ISRT All All DLET,ISRT,R EPL All DLET, REPL DLET, REPL DLET Unqualified GN & GNP GN ISRT All get calls and ISRT Unqualified GN & GNP GNP ISRT ISRT ISRT ISRT ISRT ISRT Description

Information Management System Hand Out

Call did not specify a segment IO area Call included an SSA with an hierarchical error Function code field specified for the call contains an incorrect value. Call requires at least one SSA Error occurred when trying to open database data set. Invalid SSA Field you name on qualified SSA is incorrect. Processing options for call given not specified in PCB Call caused a physical I/O error The I/O Area the call specified is to large SSA specified in call exceeded maximum length allowed in PSB Sequence field has been changed Call wasn‟t immediately preceded by a successful get hold call The call violated a delete rule for segment A higher level segment was retrieved during sequential retrieval (expected condition) End of data base during sequential retrieval Position lost before the call could be completed. A segment occurrence meeting the specified condition wasn‟t found A segment of different type but at same hierarchical level was retrieved (expected condition) Proper parentage isn‟t in effect Segment already exists in database The call violated an insert rule for the segment Segment already exists in database Input data is not in hierarchical sequence One or more segment segments in path to the segment being loaded The sequence of segment types at the same level isn‟t same as that specified in DBD Description Call caused a physical I/O error on secondary index

Status Code NO

DL/I Call DLET,REPL,I SRT

IIMSHD/VER 0.2

For Internal Use Only

Page 35 of 84

TATA INFOTECH LTD. RX V1 bb(spaces) A3 A5 QC QD QE QF QH RX XA

Information Management System Hand Out Call violated a replace rule for a segment Variable length segment longer than maximum segment size specified The call was executed normally Program tried to send a message to a modifiable PCB but no destination associated with it. Program specified a MOD name for a segment other than the first in output message No input message are present for the program No segments are present for the current input message The Program issued a GN call before message GU call The message segment is 5 chars long or less The destination of output message is undefined The call violated a replace rule for a segment The program has already responded to the originating terminal, but it is trying to pass the SPA to another program The Program has already passed the SPA to another program but trying to send output message to the originating terminal The Program sent a message whose ZZ field has value other than binary zeros The logical terminal involved in a conversation is not defined properly to IMS An IO error occurred while IMS was Accessing the SPA The first output message of a conversational program was not the SPA SPA is invalid because the first six bytes were altered by the program The program tried to perform a message switch to a non conversational program The program tried to perform a message switch by passing SPA to it more then once Th program tried to perform a message switch to a transaction that is not defined. A system or I-O error The SPA the program tried to insert is larger then the value specified in PSB

ISRT DLET, REPL,ISRT All ISRT ISRT Message GU Message GN Message GN Message GU, ISRT Message ISRT Database ISRT Message ISRT

XB

Message ISRT

XC XF X1 X2 X3 & X7 X4 X5 X6 X8 X9

Message ISRT Message ISRT Message GU,ISRT Message ISRT Message ISRT Message ISRT Message ISRT Message ISRT Message ISRT Message ISRT

IIMSHD/VER 0.2

For Internal Use Only

Page 36 of 84

TATA INFOTECH LTD.

Information Management System Hand Out

17. DL/I Access Methods
The different Access methods are:  HSAM -> Hierarchical Sequential Access Method  HISAM-> Hierarchical Indexed Sequential Access Method  HDAM -> Hierarchical Direct Access Method  HIDAM-> Hierarchical Indexed Direct Access Method 17.1. HSAM  Is stored on a tape or DASD as a sequential data set.  Here the segments of a database record are related by physical adjacency.  Used for sequential processing only i.e. entire database is searched sequentially for a segment.  GN, GU,GNP calls can be processed.  No capability for REPL and DLET calls.  Any modification on existing database is done by creating a new version of database.  Sequence Key need not be defined for the dependents, when defined for the root the database records should be stored in ascending value of key.

17.1.1. Defining HSAM

10 1617 72 DBD NAME=SAMHSAM,ACCESS=HSAM DATASET DD1=SAMHSAM1,DD2=SAMHSAMO,DEVICE=3380, X RECORD=(512,512)

ACCESS=HSAM specifies that DL/I access method HSAM should be used DD1=SAMHSAMI,DD2=SAMHSAMO SAMHSAMI is used for input operations (GN, GU,GNP) SAMHSAMO is used to contain new version of database after replace or delete RECORD=(512,512) is the record length of SAMHSAMI, SAMHSAMO respectively HSAM does not have capability of  Multiple data set groups*  logical relations*  Secondary Indexing* Note: „*‟ will be discussed later.

IIMSHD/VER 0.2

For Internal Use Only

Page 37 of 84

TATA INFOTECH LTD.
17.1.2. Stored Segment Occurrence

Information Management System Hand Out

S T C

D B

SEGMENT DATA
Fig.17.0.

 Segment Type Code (STC): This is the first byte in the segment. The value ranging from 1-255.  Delete Byte: It is of one byte. When set used to indicate that the segment occurrence is marked for deletion. Not used in case of HSAM.  Segment Data: The actual data of the segment. 17.2. HISAM  Requires two data sets  Primary  Overflow  Gives indexed access to root segment data stored in primary data set.  Gives sequential access to the dependents. (may be stored in Primary/Overflow dataset).  Capability for REPL and DLET calls.  Used primarily for sequential processing. HISAM using Key Sequential Data Set (KSDS) as Primary Data set and Entry Sequential Data Set (ESDS) as overflow data set
17.2.1. Data storage using KSDS-ESDS:

INDEX SET Dependent data SEQUENCE SET CONTROL AREA CONTROL INTERVAL (CI) KSDS Dataset Fig. 17.1. Note: - - - - -> indicates NDP ESDS Dataset 00

IIMSHD/VER 0.2

For Internal Use Only

Page 38 of 84

 The pointer from a root in KSDS to corresponding dependents in ESDS .  The entries in index set correspond to the number of sequence set. the link between two records in ESDS is called as next dependent pointer(NDP).  Each database record starts at the beginning of logical record in primary dataset. Information Management System Hand Out As shown in the fig.2.2.  The data is stored in control Area. KSDS is divided into Index component and Data component  The index component contains the index set and sequence set. In fig.17.17.  Insertion. Hence the space is not reusable. 17.  In case of deletion of a segment occurrence in KSDS the deletion is physically done and the space becomes reusable. NDP stands for next dependent pointer that occupies four bytes and contains the Relative Byte Address (RBA) of the record containing next dependent segment.  An entry in sequence set corresponds to the highest value of the root segment entered in CI. IIMSHD/VER 0.1.2. Physical deletion does not take place.  NDP occupies four bytes and contains the Relative Byte Address (RBA) of next dependent segment in ESDS.  The Root along with some of the dependents is stored in KSDS and the remaining dependents are stored in ESDS.2.  Number of sequence sets will be equal to the number of control areas. Replace and Deletion can be performed for segments in both datasets. Stored Segment Occurrence S T C D B N D P SEGMENT DATA Fig.TATA INFOTECH LTD.  Control Area is divided in to number of Control Intervals (CI). 17.  Number of entries in sequence set will be equal to number of CI in a control area.2 For Internal Use Only Page 39 of 84 .  NDP will have value zeros if it is in the last segment occurrence of a particular database record.  Deletion in case of ESDS dataset is done by setting the delete byte in that segment occurrence.

2 For Internal Use Only Page 40 of 84 .  Next dependent segment is placed at the front of the record.  RBA of the new ESDS record is placed in the NDP position of the previous ESDS record.TATA INFOTECH LTD.  Root Segment is placed at the front of the record.  If the KSDS is filled before all the dependent segments are loaded  A new ESDS record is created. Information Management System Hand Out Insertion  Each time a root Segment is entered a new KSDS record is created.  As many subordinate segments as will fit in the record are placed after the root.3. HISAM using Indexed Sequential Data Set (ISDS) as Primary Dataset and Operating System Access Method (OSAM) as overflow dataset.  RBA of the ESDS is placed in the next dependent pointer position of the root. IIMSHD/VER 0.17.  If ESDS record is filled before all dependent segments have been loaded  A new ESDS record is created. Data storage in ISAM-OSAM HISAM ISAM/OSAM ISAM dataset + OSAM dataset Fig.

It is used to contain the pointer to a root in OSAM dataset. NDP stands for next dependent pointer. which occupies four bytes and contains the Relative Byte Address (RBA) of next dependent segment. Here the NDP exists at the end of all stored segments in the record.4.TATA Information Management System INFOTECH LTD. Here ISAM is divided into logical records.  The Index contains entry for each logical record in ISDS. In fig 17. Hand Out  Here no control Intervals/ control areas are there.4. ROP stands for Root Overflow Pointer. Stored Segment Occurrence Segment Prefix Root Overflow Pointer Segment Data Next Dependent Pointer Fig. 17.2 For Internal Use Only Page 41 of 84 .3. Here address is of 3 bytes.2.5 New Root Inserted OSAM IIMSHD/VER 0.17. inserted after initial load. 17. Data storage in ISAM / OSAM CRS1 CRS3 CRS4 Dependent Data CRS1 Dependent Data ROP CRS3 CRS4 . . . CRS2 ISAM Fig.

2 For Internal Use Only Page 42 of 84 .5.TATA Information Management System INFOTECH LTD.CR2 and CR3 have been initially inserted and now we want to insert course with sequence key CR4. Two COURSES with sequence key CR1 and CR3 have been initially inserted and now we want to insert course with sequence key CR2.5. The index is updated accordingly.  For all Subsequent segments a new OSAM record is created and next dependent pointer of previous record is set accordingly. Note: Here index once created during initial loading is not updated. after the previously entered record) Here a new record is created in ISAM and the data is filled accordingly as when initially loaded. A new record is created in ISAM. The root along with some dependents depending on the size of record are filled in that record and the subsequent segments are inserted in OSAM.  The root along with some of the dependents is stored in ISAM dataset and the subsequent segments are stored are stored in OSAM dataset. A new record is created in OSAM and COURSE with sequence key CR2 is stored in it along with its dependents. IIMSHD/VER 0. Eg: In fig. 17. each root segment is stored in an ISAM record. Eg: In Fig.  RBA of OSAM record is placed in dependent pointer of ISAM record. Deletion in case of ISAM-OSAM  Deletion of a segment is accomplished by setting the flag in Delete byte. Now the ROP of COURSE with sequence key CR3 points to COURSE with sequence key CR2.  Here space after deletion is not reusable.  As many subordinate segments as will fit in the record are placed after the root.  Case(ii)  The root segment occurrence is to be inserted at the end of the database( i. The links are maintained through ROP.e. The ROP is adjusted accordingly so that proper link is maintained. COURSES with sequence key CR1.(both for the data stored in ISAM as well as OSAM). Here the root segment along with its dependents gets inserted in OSAM data set.  If the insertion of a root segment occurrence is done after the initial loading then  Case (i)  The root segment is being inserted in between two previously entered root segment occurrences. Hand Out  While loading the database initially.17.

. its position is fixed.OVFLW=HISAMOV DEVICE=3380.128) ACCESS=(HISAM. Here each direct pointer which is stored in the segment‟s prefix points directly to another segment occurrence. VSAM is used RECORD=(128.  When a segment is deleted from a HD data base the space is immediately available to store another segment.  Here the relationships among segments do not rely on their physical positions. Hierarchical Direct (HD) databases  Use Hierarchical Direct Access Method.2 For Internal Use Only Page 43 of 84 . . Instead segments are related to one another by pointer values stored in them.128) is the length of HISAMPR. i.e. Child & Twin Pointers There are four kinds of child/Twin Pointers. RECORD=(128. IIMSHD/VER 0.OVFLW=HISAMOV HISAMPR is the primary dataset(KSDS) HISAMOV is the overflow dataset(ESDS) be used.VSAM) DATASET DD1=HISAMPR.  The pointer values are four-byte relative addresses (RBAs).VSAM) specifies DL/I access method HISAM should as underlying access method.HISAMOV respectively. whether that segment is at the beginning of a record or not.  After a segment has been inserted into a HD database. it isn‟t moved when some other segments are added as in HISAM database.ACCESS=(HISAM.TATA INFOTECH LTD. DD1=HISAMPR. Defining a HISAM DBD NAME=SAHISAM. Information Management System Hand Out HISAM has capability of  Multiple dataset groups*  logical relations*  Secondary Indexing* Note: „*‟ will be discussed later.

If a parent segment has more than one directly dependent segment types.2 For Internal Use Only Page 44 of 84 .  Physical Child Last (PCL) Pointer  This points to the last occurrence of the specified segment type subordinate to a given parent segment occurrence .TATA Information Management System INFOTECH LTD. there is one PCF pointer for each.  Physical Twin Backward (PTB) Pointer  This pointer chains to the previous twin segment occurrence. 17. Used for primarily direct processing. HDAM     Provides Direct (randomized) access to the root.6. IIMSHD/VER 0. Data Storage using ESDS/OSAM Logical Record Root Addressable Area Overflow Area ESAM/ OSAM Fig.  Physical Twin Forward (PTF) Pointer This pointer chains to the next twin segment occurrence. Provides Direct (pointer) access to the dependents. Hand Out  Physical Child First (PCF) Pointer This pointer is a part of the prefix of parent segment and its value contains the RBA of the first child occurrence of the related child segment subordinate to the parent segment.3. 17. Implemented using either ESDS or OSAM. This pointer is optional.

Randomizing Module: This is a program that uses a technique similar to hashing function and generates the random address used to store the records. Information Management System Hand Out ESDS/ OSAM dataset are divided into two areas:  Root Addressable Area:  Overflow Area. Root segments that randomize to the same RBN and RAP are called synonyms. rbn: specifies number of RBNs to be used for root addressable area. Then if adequate space is available in the CI. RAP points to the occurrences of root segments . IIMSHD/VER 0. They are chained through twin pointers.TATA INFOTECH LTD. Bytes: number of bytes of a database record to be stored along with root segment occurence. Anchor pt.17. DL/I creates one/more root anchor points (RAPs). DL/I adds the segment to the control interval and stores its RBA in the RAP. And if enough space isn‟t available in the CI for the root segment.) In each control interval in the root addressable area. A RAP is a four-byte field that contains an RBA.2 For Internal Use Only Page 45 of 84 . The following parameters have to be given as the input for randomizing module. Maximum number of RAPs that can be defined in a CI is 255. Bytes) Name: is the name of the module we are using for random generation. RMname = (Name. When a root segment is inserted in HDAM database the HDAM randomizing module that‟s being used calculates two values:  The CI that should contain the segment  The RAP within the CI that should point to it. Anchor pt: specifies the number of RAPs required.6. Dl/I stores it in a nearby CI that has enough free space. rbn. (Refer fig.

....2 For Internal Use Only Page 46 of 84 .17..VSAM).DEVICE=3380 SEGM NAME=COURSE.ACCESS=(HDAM...POINTER=TWINBWD FIELD . . RMNAME=(DFSHDC10.... SNGL means PCF should be generated DBLE means PCF and PCL should be generated. Defining HDAM Information Management System Hand Out DBD NAME=SAHDAM.3.3. SNGL or DBLE) 0 means the segment is root else if ‘segment name’ given means that segment is the parent of the segment being defined.DBLE))....PARENT=((COURSE..7.. .. POINTER=TWINBWD POINTER=TWIN means PTF should be generated =TWINBWD means PTF and PTB should be generated =NOTWIN means no twin allowed i..2. 17. SEGM NAME=PREREQ..10) DATASET DD1=SAHDAM1.1.. Segment Data Fig.e.. PARENT=(0 or segment name.. . Stored Segment Occurrence STC DB PTF PTB PCF PCL ..TATA INFOTECH LTD.. 17... IIMSHD/VER 0. neither PTF nor PTB generated..

direct access.  Index database is HISAM database & HISAM rules apply to it.  The segments in the main database are chained through  Child pointers (PCF. POINTER=TWINBWD IIMSHD/VER 0.  It consists of two databases namely  Main database.DEVICE=3380 SEGM NAME=COURSE.ACCESS=(HIDAM.1.e.VSAM). .IDXDBD).  Index database can use either ISAM or VSAM. HIDAM Information Management System Hand Out  Provides indexed access to the root segment. .PARENT=((COURSE.TATA INFOTECH LTD. PCL).RMNAME=(.  Access to the root segment is via index database.  Subordinate segments are accessed via twin/child pointers.SEQ).POINTER=TWINBWD LCHILD NAME=(IDXSEG.  Provides pointer access to the subordinate segments i. PTB).DBLE)).POINTER=INDEX FIELD NAME=(CRSNO.  Root segments & subordinate segments are stored in the OSAM or ESDS dataset.  Index database is used to index the database records stored in the main database  Index contains only one segment (root only). 17. SEGM NAME=PREREQ.) DATASET DD1=SAHIDAM.  Index segment prefix contains the pointers to database records.2 For Internal Use Only Page 47 of 84 . Defining HIDAM Main database DBD NAME=SAHDAM.  Index database. 17.  Each of the databases is defined through their own DBDGEN.4.4.BYTES=……… . .  Twin pointers (PTF...

. Secondary Indexing COURSE CLASS INSTRUCTOR STUDENT Fig. IMS being a hierarchical database supports only one to many relationships.18.0. In order to facilitate the access of a parent through its child secondary indexing is used. BYTES=……….VSAM).SEQ).BYTES=……… DBDGEN FINISH END. 18. 18.INDEX=CRSNO FIELD NAME=(CRSNO. Eg: In fig. a query like all the students in a particular class can be obtained but a query like “Find details of a CLASS given the STUDENT details” cannot be answered.2 For Internal Use Only Page 48 of 84 . Index Database Information Management System Hand Out DBD NAME=IDXDBD. DATASET DD1=IDXDS.DEVICE=3380 SEGM NAME=IDXSEG.0.EDUDBD).ACCESS=(INDEX. Segments in secondary indexing IIMSHD/VER 0. LCHILD NAME=(COURSE. 18.1. DL/I maintains an alternate sequence by storing pointers to segments of indexed database in a separate index database.TATA INFOTECH LTD.

If target segment is not specified then the source itself becomes the target segment. It contains the key field (indexed field) and points to the segment that is to be retrieved. The data structure shown in fig. Should be at the same level or at lower level as target segment.  Pointer segment contains two main elements:  Prefix element: The prefix element of pointer segment contains a pointer to the target segment.It is present in the main database. becomes: CLASS IIMSHD/VER 0. Secondary Data Structure When a secondary index is created the hierarchical tree structure changes.  Data element: The data element contains the key value on which index is built.  Source Segment: Contains field or fields that the pointer segment uses as key field. source segment should be dependent of target segment.0. Target segment can be at any of the 15 levels.  Others segments are not included. In case if source and target segments are different.TATA Information Management System INFOTECH LTD.  Ancestors of target segment will become the dependents to the target segment. Each time a new entry is made in source segment the corresponding entry is duplicated in index database. The rearranged tree structure is called as secondary data structure.8. Hand Out  Pointer Segment: Is present in the indexed database. Pointer segment points to the target segment.2.2 COURSE For Internal Use Only STUDENT Page 49 of 84 .  Original dependants of target segment are moved to the right. in the reverse order. Properties of secondary data structure  The target segment becomes the root. 18. Target Segment: Is the one which is retrieved .

Information Management System Hand Out Fig.2.U). Pointers in secondary indexing  Direct Pointer: Here the relative byte address (RBA) of target segment is stored in prefix of the pointer segment.18.TYPE=C IIMSHD/VER 0.TYPE=C FIELD NAME=CRSNAME.PARENT=COURSE.1.U). 18. as in HISAM the records are continuously moving.1.SEQ. This can be used only in HD databases and cannot be used in HISAM.18. the key field is physically stored.TATA INFOTECH LTD.START=1.BYTES=10 FIELD NAME=(CLSNO.BYTES=4.  Symbolic Pointer: Here the sequence key field of the source segment is duplicated in data portion i.0.e.3.TYPE=C SEGM NAME=CLASS.BYTES=10 FIELD NAME=(CRSNO. Pointer segment for Direct Pointer: S T C D B P T F P T B RBA of target segment Segment data. Secondary Data Structure Note: In fig.SEQ.3.18.BYTES=3.2 For Internal Use Only Page 50 of 84 . which results in constant changing RBA. Segment data.START=1. Pointer segment for Symbolic Pointer: S T C D B P T F P T B Key field of the Target segment Fig.ACCESS=HDAM DATASET DD1=COURSE. This is generally used in case of HISAM database. a secondary index from to INSTRUCTOR cannot be created as STUDENT is not a dependent of INSTRUCTOR.18. DBDGEN requirements for secondary indexing: (Refer fig. 18.START=7.PARENT=0.) Main DBD PRINT NOGEN DBD NAME=EDUDBD.DEVICE=3380 SEGM NAME=COURSE. Fig.BYTES=3.

BYTES=10 FIELD NAME=(STUNO.IDXDBD).TATA Information Management System INFOTECH LTD.SEQ. PARENT=CLASS PCB for secondary index view PCB TYPE=DB.BYTES=4.TYPE=C DBDGEN FINISH END Index DBD PRINT NOGEN DBD NAME=INDEXDBD.DEVICE=3380 SEGM NAME=IDXSEG.SEQ.TYPE=C DBDGEN FINISH END PSBGEN requirements for secondary indexing: PCB for normal view PCB TYPE=DB.DBDNAME=EDUDBD.POINTER=INDX FIELD NAME=(STUNO. PARENT=0 SENSEG NAME=COURSE. PARENT=CLASS SENSEG NAME=INSTRT.BYTES=3.BYTES=4.SRCH=STUNO.TYPE=C SEGM NAME=INSTRT. Hand Out LCHILD NAME=(IDXSEG.SEQ. PARENT=COURSE SENSEG NAME=STUDENT.ACCESS=INDEX DATASET DD1=IDX1.START=1.PROCOPT=A PROCSEQ=IDXDBD SENSEG NAME=CLASS.KEYLEN=9.PARENT=CLASS.TYPE=C SEGM NAME=STUDENT.BYTES=3 LCHILD NAME=(IDXSEG.PROCOPT=A SENSEG NAME=COURSE.PARENT=CLASS.KEYLEN=9.U).DBDNAME=EDUDBD.START=1.IDXDBD).TYPE=C FIELD NAME=STUNAME.POINTER=INDX XDFLD NAME=XSTUNO.U).PARENT=0.BYTES=3.LANG=COBOL END IIMSHD/VER 0.START=7.2 For Internal Use Only Page 51 of 84 .BYTES=4.START=7. PARENT=CLASS PSBGEN NAME=EDUPSB.BYTES=3.BYTES=10 FIELD NAME=(INSNO. PARENT=0 SENSEG NAME=CLASS.U).START=7.START=1. PARENT=CLASS SENSEG NAME=STUDENT.TYPE=C FIELD NAME=INSNAME.SEGMENT=STUDENT FIELD NAME=CLSNAME.

 SRCH: This specifies the fields from the source segment that are used to build Indexed field. The root essentially being stored in the primary dataset group. The maximum number of fields that can be given in SRCH is 5. LCHILD macro declared in the index segment of index DBD relates pointer segment to the target segment.  XDFLD: This macro supplies a field name that is used to access the database via the secondary key. the multiple PCBs are coded with different PROCSEQ values.  PROCSEQ: For secondary index PCB view PROCSEQ parameter is specified on the PCB macro. In HD databases. code the field name starting with /SX. Multiple Dataset Group The hierarchical tree structure can be stored in more than one dataset group. Eg: In the Main DBD the macro LCHILD relates CLASS segment to the pointer segment IDXSEG in the secondary index database IDXDBD. When this kind of field is coded IMS generates a unique 4 byte RBA of source segment and puts it in the subsequent field of the pointer segment. Even if 5 fields together do not make the search unique then SUBSEQ (subsequent) fields can be added. This indicates the new processing sequence and the processing is done based on the secondary index view. IIMSHD/VER 0. For the system field no start must be coded as /SX field does not occupy any storage. There will be one primary dataset group and there can be multiple (maximum 9) secondary dataset groups. In case when indexed field is not unique (i. The value of PROCSEQ is the DBD name of the secondary index database. there are duplicate values in indexed field) the search field may be made unique by adding another field in search criteria. Search keys can be made unique using system defined fields. The name of the field can go upto 8 characters including /SX.TATA INFOTECH LTD. If the same program needs to access more than one secondary indexed database. Information Management System Hand Out Some of the terms related to secondary indexing:  LCHILD: This macro relates a target segment to its associated secondary index database.2 For Internal Use Only Page 52 of 84 .e. Subsequent fields are not given during actual search. In absence of this parameter the processing is done in usual hierarchic sequence.

2 For Internal Use Only Page 53 of 84 CUSTOMER . The basis for logical relation ship is called logical child segment. CLASS is the physical parent and CUSTOMER is the logical parent. Logical relations are established for:  Accessing a segment in another database: During data conflicts between segments. In case of HISAM split can occur only at the second level i. The logical child has two parents: one physical parent and one logical parent. These two segments may reside in separate physical databases. STUDENT is the logical child. at immediate child of root. In case of HD databases split can occur at any level below root provided the parent and child segments at split point are connected through child pointers and twin segments in child are connected through twin pointers .TATA Information Management System INFOTECH LTD.20.0. Note: indicates logical relationship.20.0. COURSE CUSTOMER CLASS INSTRUCTOR STUDENT Fig. It can be used for HISAM and HD databases. What is a logical relationship? A logical relationship is the link between two segments that are otherwise unrelated.0. the segment causing conflict can be kept in a separate database and a logical relation ship can be established. In fig. Hand Out Used to increase the efficiency of search and retrieval of data.20. Eg: In fig. CUSTOMER segment cannot be put under any segment because this leads to many to many relationships. In order to avoid this conflict CUSTOMER is put in a separate database and a logical relationship between CUSTOMER and STUDENT is established. to provide access from child to parent without disturbing the existing parent child relationship this technique IIMSHD/VER 0.e.  Inverting parent child relationship: In an hierarchical tree.

1. Hand Out is used.2 For Internal Use Only Page 54 of 84 .1. using this the same report can be generated very easily.  Logical relation is established using logical parent pointer (LP). Logical parent pointer is of two types: IIMSHD/VER 0. Consider fig. for all the occurrences of that child segment type. INSTRUCTOR (Parent) COURSE CLASS (Parent) CLASS (Dummy) INSTRUCTOR (Dummy) STUDENT Fig. Logical parent‟s data can be accessed from logical child but vice versa is not allowed.0.20. if a report has to be generated instructor wise i.  One logical child can have one logical parent and one physical parent. Note: indicates logical relationship In fig.20.e.20. In this case the parent must be the original segment and the logical child may be dummy segment. Types of Logical Relationships  Unidirectional logical relationship:  The relationship is from logical child to logical parent.TATA Information Management System INFOTECH LTD. classes handled by the instructor it is not possible directly.

M). S T C D B P T F P T B Logical Parent Pointer Segment data.SEQ. This pointer is used when the parent resides in HISAM database..BYTES=3.VSAM).2 For Internal Use Only Page 55 of 84 .) DBD for customer data base PRINT NOGEN DBD NAME=CUSTDBD. the relative byte address of logical parent is stored in logical child in its pointer area.20.POINTER=TWINBWD FIELD NAME=(CUSTNO.TYPE=C DBDGEN IIMSHD/VER 0. DBDGEN requirements for unidirectional logical relationship in HDAM database: (Refer fig.START=4. (LP) RBA of the logical parent Fig 20. RMNAME=(….BYTES=7.ACCESS=(HDAM. Information Management System Hand Out 1) Symbolic Pointer: In this the logical parent concatenated key (LPCK) is physically stored as the first field of logical child.2.EDUDBD) FIELD NAME=CUSTNAME. This is used when parent resides in HD databases. PARENT=0. S T C D B P T F P T B Logical Parent Pointer Segment data. BYTES=11. (LP) LPCK of the logical parent Fig 20.START=1.0.) DATASET DD1=CUST.TYPE=C LCHILD NAME=(STUDENT.DEVICE=3380 SEGM NAME=CUSTOMER.3.TATA INFOTECH LTD. 2) Direct Pointer: In this.

START=4.PARENT=COURSE.START=1.(CUSTOMER.TYPE=C SEGM NAME=INSTRT.D.TYPE=C FIELD NAME=CRSNAME.SOURCE=(COURSE.BYTES=3. POINTER=(LPARNT.BYTES=6. ) DATASET DD1=COURSE.START=1.BYTES=7. BYTES=11.BYTES=7.U).TATA INFOTECH LTD.START=4.2 For Internal Use Only Page 56 of 84 .D.EDUDBD) DBDGEN FINISH END IIMSHD/VER 0.BYTES=10 FIELD NAME=(CLSNO.BYTES=3.TYPE=C SEGM NAME=STUDENT.PARENT=CLASS.EDUDBD) SEGM NAME=STUCUST.START=7.BYTES=10 FIELD NAME=(INSNO.SEQ.P.CUSTDBD)) SEGM NAME=INSTRT.PARENT=0.ACCESS=LOGICAL DATASET LOGICAL SEGM NAME=COURSE.SOURCE=(CLASS.BYTES=4.EDUDBD) SEGM NAME=CLASS.D.ACCESS=(HDAM.EDUDBD).U).DEVICE=3380 SEGM NAME=COURSE.START=4. RMNAME= (….TWINBWD). SOURCE=(INSTRT.TYPE=C FIELD NAME=CLSNAME.TYPE=C DBDGEN FINISH END DBD indicating logical relation PRINT NOGEN DBD NAME=LOGDBD.PARENT=CLASS.BYTES=10 FIELD NAME=(CRSNO. SOURCE=((STUDENT.CUSTDBD)).D.TYPE=C FIELD NAME=INSNAME.U).PARENT=0.START=4.LAST) FIELD NAME=(CUSTNO.RULE=(LLL.TYPE=C FIELD NAME=STUNAME. PARENT=((CLASS). FINISH END Information Management System Hand Out DBD for COURSE database PRINT NOGEN DBD NAME=EDUDBD.SEQ.TYPE=C FIELD NAME=STUNO.BYTES=3.SEQ.BYTES=7.BYTES=3.PARENT=CLASS.START=1.SEQ.(CUSTOMER.TYPE=C SEGM NAME=CLASS.PARENT=COURSE.START=1.VSAM).M).D.

PARENT=0 SENSEG NAME=CLASS. dbd name of logical parent)).DBDNAME=CUSTDBD.PARENT=COURSE SENSEG NAME=STUDENT.2 For Internal Use Only Page 57 of 84 .PARENT=0 SENSEG NAME=CLASS.DBDNAME=LOGDBD.KEYLEN=9.PARENT=CLASS SENSEG NAME=INSTRT.KEYLEN=9.  Specifies whether direct pointer is used or symbolic pointer is used.TATA INFOTECH LTD.PARENT=COURSE SENSEG NAME=STUCUST. PSBGEN requirements for logical relationship (Refer fig.20. Format: PARENT ((physical parent name). Information Management System Hand Out Note: In case of HIDAM the DBDs will remain same but only addition is a LCHILD statement after the segment definition and the sequence field definition indicating the index and in index data base the corresponding LCHILD must be specified.0.PARENT=CLASS SENSEG NAME=INSTRT.DBDNAME=EDUDBD. (logical parent name.PARENT=CLASS PSBGEN PSBNAME=LOGPSB. P/V.LANG=COBOL END Definitions  PARENT  Operand specified for the logical child segment.PROCOPT=A SENSEG NAME=CUSTOMER.PARENT=CLASS PCB TYPE=DB.KEYLEN=3. V Virtual If the parameter is ‘P’ in the declaration along with the logical parent name it means that the logical parent concatenated key is stored as first field in the logical IIMSHD/VER 0.) Normal View PRINT NOGEN PCB TYPE=DB.PROCOPT=A SENSEG NAME=COURSE. PPhysical.PARENT=0 Logical View PCB TYPE=DB.PROCOPT=A SENSEG NAME=COURSE.

Format: SOURCE=(segment name.  Bi-directional physically paired logical relationship:  The relation ship is two ways: from logical child to logical parent and vice versa. D Data value. Hand Out child i.20. D/K. IIMSHD/VER 0.e. (logical parent segment name. If ‘V’ is specified then logical parent’s key is used to generate the relative byte address of the logical parent and the key of logical parent is not stored i.e. Layout of Concatenated Segment: Logical Child LPCK Intersection data Logical Parent LPK Fig. In order to facilitate access in either direction bidirectional logical relationship should be used.2 For Internal Use Only Page 58 of 84 .  Logical Twins: are the occurrences of a logical child segment type that are all subordinates to a single occurrence of the logical parent segment type. D/K. If K is specified only key value of that segment is moved into I-O area and if D is specified the entire data is moved into I-O area. dbd name) For the concatenated segment. Logical Parent data  DATASET LOGICAL indicates that the database exists virtually and is not physically stored. dbd name) for normal segments. dbd name). K Key value. direct pointer is used. SOURCE=((logical child segment name. This value K or D is specified in order to control the data that is coming into the I-O area.  SOURCE  Is used to represent a concatenated segment.TATA Information Management System INFOTECH LTD. D/K.4. symbolic pointer is used. Note: In case of uni-directional logical relationship access from logical parent to logical child is not allowed.

BYTES=3.20. RMNAME= (….BIRDDBD)).BYTES=7.TYPE=C FIELD NAME=REMARKS. Hand Out  In this case the logical child is duplicated in both the databases.BIRDDBD). BYTES=35.ACCESS=(HDAM.(BIRD.VSAM).  When logical child is accessed from its physical parent the path is said to be a physical path.START=1. AREA BIRD SIGHTA SIGHTB Physically paired Fig.5.P.PARENT=((AREA). BYTES=10.TATA Information Management System INFOTECH LTD.BYTES=8.M).) DBD for AREA database PRINT NOGEN DBD NAME=AREADBD.TYPE=C DBDGEN FINISH END DBD for BIRD database IIMSHD/VER 0.START=1.TYPE=C LCHILD NAME=(SIGHTB.20.POINTER=TWINBWD FIELD NAME=(AREANO.5.SEQ.2 For Internal Use Only Page 59 of 84 .) DATASET DD1=AREA1.POINTER=(TWINBWD.START=13.BYTES=3.START=4.U).TYPE=C SEGM NAME=SIGHTA. DBDGEN requirements for Bi-directional logical relationship (Refer fig.DEVICE=3380 SEGM NAME=AREA.SEQ.PAIRED=SIGHTA FIELD NAME=AREANAME.LPARNT.TYPE=C FIELD NAME=DATE.BYTES=22.START=4.PAIRED) FIELD NAME=(BIRDNO.OVFLW=AREA2.

M).AREADBD)).D.(BIRD.PARENT=AREA.BYTES=3. BYTES=35.START=4.U).PARENT=(( BIRD).PAIRED) FIELD NAME=(AREANO.START=1.BYTES=8.TYPE=C DBDGEN FINISH END DBD indicating logical relation of SIGHTA with BIRD PRINT NOGEN DBD NAME=LOGDBD1.PARENT=0.D.VSAM). SOURCE=((SIGHTB.AREADBD).TYPE=C FIELD NAME=REMARKS.SEQ.PAIRED=SIGHTB FIELD NAME= BIRDNAME.BYTES=7.AREADBD)) DBDGEN FINISH END Logical View1 AREA IIMSHD/VER 0.POINTER=TWINBWD FIELD NAME=( BIRDNO. RMNAME= (….BYTES=22.BIRDDBD)) DBDGEN FINISH END DBD indicating logical relation of SIGHTB with AREA PRINT NOGEN DBD NAME=LOGDBD2.PARENT=BIRD.AREADBD) SEGM NAME=SIBIRD.2 SIBIRD Internal Use Only For SIGHTA BIRD Page 60 of 84 .OVFLW=BIRD2. SOURCE=((SIGHTA.LPARNT.TYPE=C SEGM NAME=SIGHTB.DBLE).D. BYTES=10.(AREA.BYTES=3.START=13.PARENT=(0.ACCESS=(HDAM.BIRDDBD) SEGM NAME=SIAREA.SOURCE=(BIRD.TYPE=C FIELD NAME=DATE.D.DEVICE=3380 SEGM NAME=BIRD.D.ACCESS=LOGICAL DATASET LOGICAL SEGM NAME=BIRD.START=4.TYPE=C LCHILD NAME=(SIGHTA.PARENT=0.ACCESS=LOGICAL DATASET LOGICAL SEGM NAME=AREA.D.AREADBD).BIRDDBD). Hand Out PRINT NOGEN DBD NAME=BIRDDBD.START=1. ) DATASET DD1=BIRD1.POINTER=(TWINBWD.SEQ.SOURCE=(AREA.P.(AREA.TATA Information Management System INFOTECH LTD.

KEYLEN=12.DBDNAME=LOGDBD1. Fig.TATA INFOTECH LTD.7.PROCOPT=A NAME=BIRD.PROCOPT=A SENSEG NAME=AREA. Information Management System Hand Out Note: SIBIRD is the concatenated segment of SIGHTA and BIRD segments.6.LANG=COBOL IIMSHD/VER 0.) PCB SENSEG SENSEG PSBGEN END TYPE=DB. PSBGEN requirements for logical relationship Logical View1 (Refer fig .PARENT=AREA Logical View2 (Refer fig.7.PARENT=BIRD PSBNAME=LOGPSB.DBDNAME=LOGDBD2.) PCB TYPE=DB.PARENT=0 SENSEG NAME=SIBIRD.PARENT=0 NAME=SIAREA.KEYLEN=12. Note: SIAREA is the concatenated segment of SIGHTB and AREA Segments.20.20.20.20. Logical View2 BIRD SIAREA SIGHTB AREA Fig.2 For Internal Use Only Page 61 of 84 .6.

Information Management System Hand Out  Bi-directional virtually paired logical relationship:  The relation ship is same as bi-directional physically paired bi-directional logical relation ship but in this case the logical child is not duplicated but accessed from the original database.BYTES=3. BYTES=10. AREA BIRD SIGHTA (Original) SIGHTB (Dummy) Virtually paired Fig.OVFLW=AREA2.PAIRED) FIELD NAME=(BIRDNO.M).TATA INFOTECH LTD.TYPE=C FIELD NAME=AREANAME.  When logical child is accessed from its physical parent the path is said to be physical path.VSAM).8.START=1.TYPE=C DBDGEN FINISH IIMSHD/VER 0.SEQ.P.TYPE=C SEGM NAME=SIGHTA.2 For Internal Use Only Page 62 of 84 .(BIRD.  When logical child is accessed from its logical parent the path is said to be logical path.U).ACCESS=(HDAM.PARENT=((AREA).BYTES=22.LPARNT.BIRDDBD)). BYTES=35.START=1.BYTES=8. RMNAME= (….BYTES=7. DBDGEN requirements for Bi-directional logical relationship: DBD for AREA database PRINT NOGEN DBD NAME=AREADBD.20.SEQ.POINTER=TWINBWD FIELD NAME=(AREANO.TYPE=C FIELD NAME=DATE.START=4.START=13.BYTES=3.DBLE).) DATASET DD1=AREA1.POINTER=(LTWINBWD.TYPE=C FIELD NAME=REMARKS.PARENT=(0.DEVICE=3380 SEGM NAME=AREA.START=4.

BYTES=35.TYPE=C FIELD NAME=DATE.SOURCE=(AREA.ACCESS=LOGICAL DATASET LOGICAL SEGM NAME=AREA.START=4. IIMSHD/VER 0.PAIRED=SIGHTB.AREADBD).START=1.DBLE).(BIRD.SOURCE=(BIRD.SEQ.PARENT= BIRD. RMNAME= (….OVFLW=BIRD2.AREADBD) SEGM NAME=SIAREA.U).TYPE=C FIELD NAME=REMARKS.TYPE=C LCHILD NAME=(SIGHTA.PARENT=(0.D. SOURCE=((SIGHTA.BYTES=22.PARENT=0.START=1.D.M).START=13.2 For Internal Use Only Page 63 of 84 .ACCESS=(HDAM.BIRDDBD)) DBDGEN FINISH END DBD indicating Logical Relationship between SIGHTB and AREA PRINT NOGEN DBD NAME=LOGDBD2.PARENT=BIRD.TYPE=C SEGM NAME=SIGHTB.AREADBD).BYTES=7.ACCESS=LOGICAL DATASET LOGICAL SEGM NAME=BIRD. BYTES=10.D.PARENT=AREA. ) DATASET DD1=BIRD1.POINTER=TWINBWD FIELD NAME=( BIRDNO.SEQ. END DBD for BIRD database Information Management System Hand Out PRINT NOGEN DBD NAME=BIRDDBD.DEVICE=3380 SEGM NAME=BIRD.BYTES=3.AREADBD) FIELD NAME=(AREANO.PARENT=0.POINTER=PAIRED.BIRDDBD) SEGM NAME=SIBIRD. SOURCE=(SIGHTA.TYPE=C DBDGEN FINISH END DBD indicating Logical Relationship between SIGHTA and BIRD PRINT NOGEN DBD NAME=LOGDBD1.BYTES=3.D.BYTES=8.TATA INFOTECH LTD.V.VSAM).START=4.PTR=DBLE FIELD NAME= BIRDNAME.

20.DBDNAME=LOGDBD1. DBDGEN FINISH END Information Management System Hand Out SOURCE=((SIGHTB.PARENT=AREA Logical View2 (Refer fig. This pointer is optional.7.  Logical Twin Backward (LTB) Pointer  This pointer chains to the previous logical twin segment occurrence.KEYLEN=12.PARENT=0 SENSEG NAME=SIBIRD.D.  Logical Twin Forward (LTF) Pointer This pointer chains to the next logical twin segment occurrence.) PCB TYPE=DB.PARENT=BIRD PSBGEN PSBNAME=LOGPSB. This pointer is optional.) PCB TYPE=DB.  Physical Parent (PP) Pointer  Used to allow the physical parent of a logical child to be retrieved when the access is via the logical parent.20. IIMSHD/VER 0.2 For Internal Use Only Page 64 of 84 .(AREA.BIRDDBD).LANG=COBOL END Some of the pointers related to bi-directional logical relationships  Logical Child First (LCF) Pointer This pointer is a part of the prefix of logical parent segment and its value contains the RBA of the first logical child occurrence of the related child segment subordinate to the logical parent segment. Logical View1 (Refer fig.PARENT=0 SENSEG NAME=SIAREA.PROCOPT=A SENSEG NAME=AREA.TATA INFOTECH LTD.AREADBD)) PSBGEN requirements for logical relationship.D.6.  Logical Child Last (LCL) Pointer  This points to the last occurrence of the specified segment type subordinate to a given logical parent segment occurrence.DBDNAME=LOGDBD2.PROCOPT=A SENSEG NAME=BIRD.KEYLEN=12.

2 For Internal Use Only Page 65 of 84 .TATA INFOTECH LTD. IM Terminal OM Fig.  A segment cannot be defined both as logical parent and logical child  Rules of physical parent:  Physical parent of a logicl child cannot be a logical child. Information Management System Hand Out  Logical Parent (LP) Pointer  Used to allow access to logical parent through the logical child. DATA COMMUNICATION AND MESSAGE FORMAT SERVICE The data communication in IMS is similar to a batch program that is extended by a network and connected to a terminal.  Logical child cannot be defined at root level.0.21. Rules in Logical relations  Rules of logical child :  A logical child can have one physical parent and one logical parent. IMS DC Program Process DL/I database IIMSHD/VER 0. This helps in online processing.  A logical child cannot have a physical child defined at next level which is again a logical child.  Rules of logical parent:  Logical parent can be defined at any level including the root  Logical parent can have any number of logical children.

2 For Internal Use Only Page 66 of 84 . The first eight bytes in a transaction are called as the transaction code.  The program loops through this cycle once for each input message. It has  An input message that is entered by a terminal user. The application program corresponding to this trans-id is executed. OM  Output Message. Message Processing in IMS There are two types of messages in IMS  Input Messages  Output Messages  Input Message Types: 1.21. Because IMS uses LTERM names for message processing it is possible for the IMS operator to reassign logical terminals to different physical devices if some terminals are out of service. Terminal to terminal message switch 3. shows the elements of a typical DC program.0. IMS commands (command switch) IMS uses first eight bytes of the input message to identify the message‟s type: If the first eight characters name an application program IMS knows that the message is a transaction. and the user uses the logical terminal names.  Th program ends or expires when there are no more input messages. Information Management System Hand Out Fig.  DC program does the processing depending upon the input message and generates an output message.TATA INFOTECH LTD. Physical terminal can have more than one LTERM name. IIMSHD/VER 0. 2. physical terminal is give different names referred to as logical terminal names (LTERM).  The output message is sent to the terminal that originated the input message. Transaction (Program switch). Note: IM  Input Message (Transaction). What is a logical terminal? In order to obtain device independence.

For Internal Use Only MFS . 2.All the transaction ids are kept in queue.IMS does the action according to the specified command following the „/‟. If it is none of the three message types then the message is discarded from the queue. The corresponding application program is executed and the results of all the calls made on database are put in the output message queue. 2. If the 8 bytes correspond to a defined LTERM name then message switch is performed else checks for a command switch. 1. 3.2 DC DL/I Common Services Scheduling Others Page 67 of 84 BMP Region. Staged processing is done by IMS. The first 8 bytes are matched with the transaction ids defined in transaction reference table (TRT).  Input message processing: A queue is maintained in IMS . it is mapped to the LTERM table. From the output message queue the data is sent to the terminal that originated the input message. If no matching trans-id is found. The terminal users enter the input messages.  Output messages Processing: In case of a program switch: 1. IMS receives all the messages and puts them in input message queue. If the first character is „/‟ IMS knows that it is a IMS command . 4. The program expires as the processing is over and output is put into output message queue. Processing a job in IMS DB/DC Environment IMS control Region MPP Region V T A M IIMSHD/VER 0. The message followed by the terminal id is sent to the specified logical terminal. Hand Out If the first eight characters name an terminal (LTERM name) IMS knows that the message is a terminal to terminal message switch. 5.TATA Information Management System INFOTECH LTD. 3. If a matching trans-id exists then corresponding to that trans-id the application program is loaded.

 In order to retrieve the data depending upon the query placed by user. and the control is passed onto the application program. Master Terminal Information Management System Hand Out Fig. IIMSHD/VER 0.21. User Terminal Format lib Load Lib MQ Log File DL/I databa se  After the edited input message.e.2 For Internal Use Only Page 68 of 84 .  The program issues a send command (ISRT) to send the output to the requesting terminal.TATA INFOTECH LTD.  The data from the user is accepted into IO area called Input Message Area (IMA) defined in working storage section.  If there is an entry of the referenced trans-id in TRT.  At the end of application program when a GOBACK is encountered the application program expires.  The application program initiates the session by issuing a „Receive‟ (GU) call against the terminal.  IMS picks the data from the output queue and sends it to the terminal that originated the input message.21. the program is loaded from the load library as in fig. IMS starts scheduling.  DL/I process the query and retrieves the data from data base. has been queued in the input message queue. beginning with the transaction code.1.  IMS reads the first 8 bytes and matches them with the trans-ids defined in the TRT.  If there is no matching entry then the message is deleted from the queue.1. the corresponding program is moved into the dependant region i. The output is put into the output message queue. and puts it in the output message area (OMA) defined in the working storage section and the control is passed to application program. the query and control are passed to DL/I.

05 IO-PCB-LTERM 05 FILLER 05 IO-PCB-STATUS-CODE 05 IO-PCB-DATE 05 IO-PCB-TIME 05 IO-PCB-MSG-SEQ-NUM 05 IO-PCB-MOD-NAME 05 IO-PCB-USER-ID PIC X(8).TATA INFOTECH LTD. PIC XX. OUTPUT-MESG-AREA is the output message area. PIC X(8).  ISRT  issued to insert a segment in the output message. PIC S9(5) COMP. Format of GU call in DC CALL „CBLTDLI‟ USING DLI-GU IO-PCB-MASK INPUT-MESG-AREA. PIC S9(7) COMP-3. IIMSHD/VER 0. DL/I function in a DC Call: Information Management System Hand Out The DL/I calls that are generally used in DC are:  GU  issued to retrieve the first segment of an input message. PIC X(8). PCB MASK in a DC call: Format of IO-PCB-MASK: 01 IO-PCB-MASK. Format of ISRT call in DC CALL „CBLTDLI‟ USING DLI-ISRT IO-PCB-MASK OUTPUT-MESG-AREA. Note: INPUT-MESG-AREA is the input message area. These are discussed in detailed in the later part of this session. PIC S9(6)V9 COMP-3. Format of GN call in DC CALL „CBLTDLI‟ USING DLI-GN IO-PCB-MASK INPUT-MESG-AREA. PIC XX.2 For Internal Use Only Page 69 of 84 .  GN  issued to retrieve subsequent segments if an input message contains multiple segments.

depends on the kind of security checking in effect. IOPCB-DATE and IO-PCB-TIME together provide time stamp for identification of input message. It is of the format HHMMSS. (MOD is discussed in the later session. IO-PCB-TIME:  Contains the time of arrival of the message. IO-PCB-STATUS-CODE:  Contains the status code returned after the DC call is processed. Its contents depend on :  Whether or not RACF security manager is installed. FILLER:  Used by IMS. contains a serial number assigned to input message by IMS. Note: RACF means resource access control facility. This is maintained.TATA Information Management System INFOTECH LTD.2 For Internal Use Only Page 70 of 84 .  If installed . IO-PCB-MOD-NAME:  Contains the name of Message Format Service message definition (called as Message Output Descriptor MOD) currently in use.) IO-PCB-USER-ID:  Contains security information. Input Message Area Format of input message area LL 2 bytes IIMSHD/VER 0. The number is stored as binary value. Hand Out IO-PCB-LTERM:  Contains the eight-byte LTERM name of the terminal that sent the current input message. IO-PCB-DATE:  Contains the date of arrival of the message. It is of the format YYDDD. when an ISRT is issued IMS routes the output message depending upon the LTERM name. IO-PCB-MSG-SEQ-NUM:  This is a four byte field.

2. 05 . This is automatically populated by IMS.21. Output Message Area Format of output message area LL ZZ 2 bytes 2 Bytes IIMSHD/VER 0.21.. ZZ 2 Bytes TRANS-ID 8 Bytes Information Management System Hand Out Other Variables Fig. the length of input message segment including LL and ZZ fields.  This is declared in WORKING-STORAGE SECTION of the COBOL program.  After the transaction is the actual data fields are declared.2 Other Variables For Internal Use Only Page 71 of 84 . 05 . indicates the format of input message area...2... Each filed occupies 2 bytes. Fig.  The input message area starts with LL field followed by ZZ field.TATA INFOTECH LTD.. COMP. 05 LL PIC S9(3) 05 ZZ PIC S9(3) 05 TRANS-ID PIC X(8). Structure of Input Message Area: 01 INPUT-MESG-AREA..  The ZZ field is for IMS internal usage purpose. COMP. 05 .  The LL field contains.  Followed by ZZ is the 8-byte transaction id... in a binary format.

Each field occupies 2 bytes.21. the length of output message segment including LL and ZZ fields. 05 ... Device Input Format (DIF) Terminal Device Output Format (DOF) For Internal Use Only Message Output Descriptor (MOD) Page 72 of 84 Message Input Descriptor (MID) Application Program IIMSHD/VER 0.. COMP VALUE ZEROS..TATA INFOTECH LTD.... Information Management System Hand Out Fig.  The output message area starts with LL field followed by ZZ field.  Whenever data has to be sent to terminal it must be placed in output message area. Note: Value of “xx” must be the total length of all the data fields plus 4 bytes (for LL and ZZ fields).2 . in a binary format..21. 05 .  This is declared in WORKING-STORAGE SECTION of the COBOL program.. Structure of Output Message Area 01 OUTPUT-MESG-AREA.  The LL field contains.3.3..  After the ZZ field actual data fields are declared. 05 LL PIC S9(3) 05 ZZ PIC S9(3) 05 . The user must specify the value of LL field and ZZ must be initialized to zeros. Message Format Service and its control Blocks Message format service (MFS) is an IMS facility that is used to format the screens in DC environment. COMP VALUE xx. Fig. Indicates the format of output message area.

TATA INFOTECH LTD.  A group of related MIDs.  MFS uses MOD (message output descriptor) to interpret the data received from the application program.  The third field starts from 16th column and is known as operand field.  If the entire statement does not fit in one line then „X‟ is put in 72nd column and the statement is continued in next line.5 shows the format of an device format control statement.21.  MFS uses DOF (device output format) to determine how the data must be formatted for transmission to the terminal..21.  For an input message MFS uses DIF (device input format) to interpret the data as it is received from the terminal. Fig.  MFS uses MID (message input descriptor) to determine how the input must be formatted. IIMSHD/VER 0. The first character must be alphabet.5.  Columns 1 through 8 make the label field.4.  A „*‟ in column 1 indicates that it is a comment. It contains the control statements like FMT. DIFs and DOFs is called a format set. Information Management System Hand Out Fig. MODs.21.2 For Internal Use Only Page 73 of 84 . Coding of MFS statements 1-8 Label 10-14 Operation 16-71 Operand/Comment 72 Continuation Character Fig. indicates the various control blocks used by MFS.  The second field begins at column 10. DFLD etc.21. Fig. This field extends from 16th column to 71st column. It is the operation field.4.

[integer= IIMSHD/VER 0.  FMT identifies the beginning of a device format.TATA INFOTECH LTD.2) (3270-An) .1) (3270.PFK=(pfkeyfield . Information Management System Hand Out Coding of device format statements 1 TO 6 7 TO 9 10 TO 15 16 TO 71 label1 FMT DEV DIV DPAGE DFLD FMTEND  The FMT and FMTEND control statements: Format: 1 6 10 16 label FMT FMTEND  Label  Is a one to six character name.FEAT=IGNORE [.  FMTEND identifies the end of a device format. It is a part of DIF and DOF created as a result of device format specification. Multiple DEV statements can be coded within a device format.  The DEV control statement: Identifies the beginning of a series of control statements for a particular device type.2 For Internal Use Only „literal‟ NEXTPP ])] NEXTMSGP Page NEXTLP 74 of 84 ENDMPPI . Format: 10 DEV 16 TYPE= (3270.

Typical values for installation may be: 3270-A1 12 line. IIMSHD/VER 0. NEXTPP  This causes MFS to display the next physical page of a message. integer  An integer value from 1 to 36 that identifies the PF key that will be associated with the value that follows. 132 column  FEAT parameter: The value IGNORE specifies that DIF and DOF generated for this DEV statement will work with the indicated 3270 terminal type. 80 column 3270-A2 24 line. NEXTLP  Requests the next logical page of an output message.  PFK parameter : pfkey field  Specifies a name that can be referred to by the MFLD statement that defines the input message that will receive literal data as a result of a PF key operation. If integer key word is not used to identify PF key assignments. 80 column 3270-A3 32 line. Information Management System Hand Out [.TATA INFOTECH LTD.DSCA=X‟nnnn‟] The values are: 3270. [. ‘literal’  Specifies the text string user wants to associate with the PF key. 40 column 3270-A7 27 line.2 For Internal Use Only Page 75 of 84 . 80 column 3270-A5 12 line. 80 column 3270-A4 43 line. regardless of any special features.2 indicates 3270 model 2 display station (24-line screen) 3270-An 3270 display station symbolic name. the assignments are positional.SYSMSG=msgfield]  TYPE parameter: specifies the device models for which device format blocks should be created. NEXTMSGP  Requests the next message bypassing remaining pages of current message.1 indicates 3270 model 1 display station (12-line screen) 3270.

. This field must be atleast 79 bytes long.  The DSCA parameter: X’nnnn’ is a hexa decimal value of two-byte default system control area for the terminal..2 For Internal Use Only Page 76 of 84 . It is usually defined at the bottom of the screen. Value ‘X00C0’ causes the entire device buffer to be cleared before an output is written to the screen. columnnum[.. FILL=fillchar] [.TATA INFOTECH LTD.  The SYSMSG parameter : msgfield  Specifies the name of device field that can be used to display messages for IMS.. Format: 10 DIV 16 TYPE=INOUT  TYPE parameter: Value as INOUT specifies that the same device format should be used to generate both DIF and DOF.  The DIV control statement: Identifies the beginning of a set of control statements for a particular formats type subordinate to DEV statement. The value of the field determines the terminal actions when output messages are received. MULT=YES]  label  The name of the logical device page.)] [. If the Value is INPUT the device format should be used to generate DIF. Information Management System Hand Out ENDMPPI  Indicates MFS that no more physical pages are left to be entered for a mutlipage input message. If the Value is OUTPUT the device format should be used to generate DOF..  The DPAGE control statement: Identifies the beginning of a series of control statements for a device page subordinate to a DIV statement Format: 1 to 8 label 10 to 15 DPAGE 16 [CURSOR=((linenum.cfield]). IIMSHD/VER 0. Value X’00A0’ causes unprotected fields on the screen to be erased before new data is written to it.

2 For Internal Use Only Page 77 of 84 .page]) [. Cfield  The name of a pseudo field referred to in an MFLD statement that will be used to pass the cursor control information in between MFS and the application program. NOMOD MOD )] CD BLUE RED PINK GREEN TURQ YELLOW NEUTRAL [. X’hh’  specifies an hexa decimal value to be used as a fill character. 3.LTH=length] [. NO DISP HI .  DFLD control statement: Identifies a device field within a device page. Format: 1 to 8 label 10 to 15 DFLD 16 to 71 [„literal‟] . Columnum  specifies the column number of default cursor position. Values that can be specified are: PT  Specifies the program tab. IIMSHD/VER 0.EATTR=( HD HBLINK HREV HUL )] .POS=(line. 2.ATTR=( ALPHA NUM NOPROT . C’c’  specifies a character to be used as fill character.. PROT 72 NORM . Output fields that don’t fill the device field are followed by a program tab character to erase the remainder of device field.  MULT parameter: Value ‘ YES’ indicates that multiple physical pages within the device page can be used to generate an input message. Hand Out  CURSOR : Specifies where the cursor should be placed when screen is sent on to the terminal 1.column[. . Linenum  specifies the line number of the default cursor position.TATA Information Management System INFOTECH LTD.  FILL : fillchar : The fill parameter to be used for output device fields.

TATA INFOTECH LTD. PROT(protected). NUM(numeric).  LTH parameter : Length  Specifies the length in bytes of the device field. NORM (display in normal intensity) and NOMOD (do not allow the changes to the device field) for data entry fields.If literal is coded then LTH parameter need not be coded..  ATTR parameter: The ATTR parameter of the DFLD statement allows to set default values for basic attributes of the device field. If the attributes are not specified then by default IMS takes the attributes as : 1. it must be the first parameter on DFLD statement.  ‘Literal’ Parameter: Specifies the constant value for the device field. CD  use default colour NEUTRAL  device dependant usually White. Eg. 2. IIMSHD/VER 0. If literal has to define. NORM(display with normal intensity)  EATTR parameter: The EATTR parameter on the DFLD statement allows to set some extended attributes to the device field. HUL  Underline the field. It can be used to create caption on screen. NOPROT (unprotected).If ‘literal’ is coded then label must not be specified.2 For Internal Use Only Page 78 of 84 .  POS parameter : The POS parameter tells MFS where a device field is located Line  Specifies the line that contains the first charcter of the device field. Page  specifies the physical page where the field is located. Information Management System Hand Out  Label: The one to eight character name of the device field . ALPHA (alpha numeric). HREV  Display the field in reverse video. HBLINK  Make field blink. Values are: HD  Defualt highlight. Column  Specifies the column that contains the first character of the device field (not its preceding attribute byte).

 SOR parameter on MSG statement: Is required to be specified on each MSG statement. PAGE=YES is valid only if TYPE=OUTPUT. Contains the name of the device format.2 For Internal Use Only Page 79 of 84 . Next msgname  If the TYPE=INPUT. OUTPUT  Specifies that the statements following the message control statement is used to generate MOD. IIMSHD/VER 0.SOR=(dfname.PAGE=YES] MSGEND MSG  TYPE parameter on MSG statement: To specify whether to generate a MID (message input descriptor) or MOD (message output descriptor). IGNORE  Indicates that the device format coded with FEAT =IGNORE must be used. the name of next MOD to be used and if the TYPE =OUTPUT the name of next MID to be used. Coding Message Descriptor Control Statements Format 1 to 8 10 to 71 MSG MFLD MFLD MSGEND Information Management System Hand Out  The MSG and MSGEND statement: MSG identifies the beginning of the message descriptor. Format: Msgname TYPE={INPUT / OUTPUT} . MSGEND identifies the end of message descriptor.  PAGE parameter on MSG statement: Is coded on the MSG statement that defines an output message descriptor when logical paging has to be used.  NXT parameter on MSG statement: Specifies the message descriptor MFS should use after the one defined by the statement associated with this MSG is executed.TATA INFOTECH LTD. Specifies that logical paging should be supported for this output message.IGNORE) [. INPUT  Specifies that the statements following the message control statement is used to generate MID.NXT=next msgname] [. dfname  The device format to which this message descriptor is related.

This parameter can be coded in two ways: devfield  The label of the device field into which data from this message field is mapped. It indicates that logical paging is not supported for this output message. This bears no relation to a device field.  MFLD control statement: The statements that define messages are coded against MFLD statements. This parameter specifies the destination of data MFS will map from this field. The data is specified by system list (syslist) which is one of the system literal. (devfield . System list: IIMSHD/VER 0. JUST={L / R}] [. This parameter can be coded in three ways namely: ‘Literal’  A literal value that’s to be a part of every input sent to the application program. (Devfield.TATA INFOTECH LTD.2 For Internal Use Only Page 80 of 84 . Format MFLD {source / destination} [. This parameter specifies the source of the data IMS will map into this field. ATTR=(YES)]  Source: This is specified for input messages only. LTH=length] [. syslist)  The first sub parameter. is the label of the device field into which data from this message field is mapped. Information Management System Hand Out PAGE=NO is the default. space must not be given for this field. If this option is used. FILL = fill char] [. devfield. There is one to one relationship between fields in the message segment descriptor and the fields in the application program‟s IO area. ‘literal’)  The first sub parameter devfield is the label of the device field from which data for this message field is mapped.  Destination: This is specified for output messages only.If device field is left empty The value specified for literal will be used . Devfield  Thelabel of the device field from which the data to this message field will be mapped.

10 CRSNO PIC X(5). code ATTR=YES.DDD System date in the format MM/DD/YY System date in the format DD/MM/YY System date in the format YY/MM/DD System time in the format HH:MM:SS Logical name of the terminal device that will receive the current output message  LTH parameter: ‘length’ specifies the length in bytes of the field. the dynamic modification of attributes by application program is allowed. This parameter is not coded if system literal is defined on an MFLD field. The possible values of ‘ fill char’ are: X ‘hh’  Any specified hex value C ‘c’  Any specified character value NULL  Do not use fill  ATTR parameter: When the value is specified as YES. In the output message area if the attributes of course number are to be changed dynamically it will be declared as: 05 COURSE.  JUST parameter: This is used to provide justification to the data. 20 ATTR PIC X. 20 CP PIC X. Dynamic Changing of Attributes and cursor position control To change the attributes dynamically  On the MFLD statement of the field whose attributes are to be changed dynamically. It is valid only for the fields defined for an input message.  FILL parameter: Specifies the character to be padded when the data is shorter than specified length.TATA INFOTECH LTD. Name DATE1 DATE2 DATE3 DATE4 TIME LTNAME Length 6 8 8 8 8 8 Information Management System Hand Out Description System date in the format YY. IIMSHD/VER 0. Eg.  The control information is passed through the cobol program. ‘R’ is used if right justification is needed and ‘L’ is used if left justification is required.  A two-byte field prefixed along with data declaration in the output message area can be used to control the attributes dynamically.2 For Internal Use Only Page 81 of 84 . 10 PREFIX.

2 For Internal Use Only Page 82 of 84 . Information Management System Hand Out  Format of CP 0 1 2 0 3 0 4 0 5 0 6 0 7 0 Cursor Positioning 00 No cursor Position 01 Invalid 10 Invalid 11 Place Cursor at this field 2 to 7 are always zeros.  Format of ATTR 0 1 1 2 3 4 5 6 7 MDT Shift Attribute Override Protection Intensity Light Pen Detectable Attribute IIMSHD/VER 0.TATA INFOTECH LTD.

TATA INFOTECH LTD.2 For Internal Use Only Page 83 of 84 . Information Management System Hand Out Bit 0 1 Function Attribute Over ride Value 1 0 Description Always Use only the attributes whose corresponding over ride bit is 1 Replace all the attributes of the device field Unprotected Protected Alphanumeric Shift Numeric shift Normal Intensity No display Bright Intensity Bright Intensity Should always be zero for non light pen application MDT off MDT on 1 2 Protection attribute 0 1 0 1 00 01 10 11 6 Light Pen detectability attribute Modified data tag (MDT) 0 3 4–5 Shift attribute Intensity attribute 7 0 1 IIMSHD/VER 0.