IMS DB – DL/I Terminology ”; Previous Next Hierarchical databases work on the relationships between two or more segments. The following example shows how segments are related to each other in the IMS database structure. Root Segment Points to note − The segment that lies at the top of the hierarchy is called the root segment. The root segment is the only segment through which all dependent segments are accessed. The root segment is the only segment in the database which is never a child segment. There can be only one root segment in the IMS database structure. For example, ”A” is the root segment in the above example. Parent Segment Points to note − A parent segment has one or more dependent segments directly below it. For example, ”A”, ”B”, and ”E” are the parent segments in the above example. Dependent Segment Points to note − All segments other than the root segment are known as dependent segments. Dependent segments depend on one or more segments to present complete meaning. For example, ”B”, ”C1”, ”C2”, ”D”, ”E”, ”F1” and ”F2” are dependent segments in our example. Child Segment Points to note − Any segment having a segment directly above it in the hierarchy is known as a child segment. Each dependent segment in the structure is a child segment. For example, ”B”, ”C1”, ”C2”, ”D”, ”E”, ”F1” and ”F2” are child segments. Twin Segments Points to note − Two or more segment occurrences of a particular segment type under a single parent segment are called twin segments. For example, ”C1” and ”C2” are twin segments, so do ”F1” and ”F2” are. Sibling Segment Points to note − Sibling segments are the segments of different types and the same parent. For example, ”B” and ”E” are sibling segments. Similarly, ”C1”, ”C2”, and ”D” are sibling segments. Database Record Points to note − Each occurrence of the root segment, plus all the subordinate segment occurrences make one database record. Every database record has only one root segment but it may have any number of segment occurrences. In standard file processing, a record is a unit of data that an application program uses for certain operations. In DL/I, that unit of data is known as a segment. A single database record has many segment occurrences. Database Path Points to note − A path is the series of segments that starts from the root segment of a database record to any specific segment occurrence. A path in the hierarchy structure need not be complete to the lowest level. It depends on how much information we require about an entity. A path must be continuous and we cannot skip intermediate levels in the structure. In the following figure, the child records in dark grey color show a path which starts from ”A” and goes through ”C2”. Print Page Previous Next Advertisements ”;
Category: ims Db
IMS DB – Control Blocks
IMS DB – Control Blocks ”; Previous Next IMS Control Blocks define the structure of the IMS database and a program”s access to them. The following diagram shows the structure of IMS control blocks. DL/I uses the following three types of Control Blocks − Database Descriptor (DBD) Program Specification Block (PSB) Access Control Block (ACB) Database Descriptor (DBD) Points to note − DBD describes the complete physical structure of the database once all the segments have been defined. While installing a DL/I database, one DBD must be created as it is required to access the IMS database. Applications can use different views of the DBD. They are called Application Data Structures and they are specified in the Program Specification Block. The Database Administrator creates a DBD by coding DBDGEN control statements. DBDGEN DBDGEN is a Database Descriptor Generator. Creating control blocks is the responsibility of the Database Administrator. All the load modules are stored in the IMS library. Assembly Language macro statements are used to create control blocks. Given below is a sample code that shows how to create a DBD using DBDGEN control statements − PRINT NOGEN DBD NAME=LIBRARY,ACCESS=HIDAM DATASET DD1=LIB,DEVICE=3380 SEGM NAME=LIBSEG,PARENT=0,BYTES=10 FIELD NAME=(LIBRARY,SEQ,U),BYTES=10,START=1,TYPE=C SEGM NAME=BOOKSEG,PARENT=LIBSEG,BYTES=5 FIELD NAME=(BOOKS,SEQ,U),BYTES=10,START=1,TYPE=C SEGM NAME=MAGSEG,PARENT=LIBSEG,BYTES=9 FIELD NAME=(MAGZINES,SEQ),BYTES=8,START=1,TYPE=C DBDGEN FINISH END Let us understand the terms used in the above DBDGEN − When you execute the above control statements in JCL, it creates a physical structure where LIBRARY is the root segment, and BOOKS and MAGZINES are its child segments. The first DBD macro statement identifies the database. Here, we need to mention the NAME and ACCESS which is used by DL/I to access this database. The second DATASET macro statement identifies the file that contains the database. The segment types are defined using the SEGM macro statement. We need to specify the PARENT of that segment. If it is a Root segment, then mention PARENT=0. The following table shows parameters used in FIELD macro statement − S.No Parameter & Description 1 Name Name of the field, typically 1 to 8 characters long 2 Bytes Length of the field 3 Start Position of field within segment 4 Type Data type of the field 5 Type C Character data type 6 Type P Packed decimal data type 7 Type Z Zoned decimal data type 8 Type X Hexadecimal data type 9 Type H Half word binary data type 10 Type F Full word binary data type Program Specification Block (PSB) The fundamentals of PSB are as given below − A database has a single physical structure defined by a DBD but the application programs that process it can have different views of the database. These views are called application data structure and are defined in the PSB. No program can use more than one PSB in a single execution. Application programs have their own PSB and it is common for application programs that have similar database processing requirements to share a PSB. PSB consists of one or more control blocks called Program Communication Blocks (PCBs). The PSB contains one PCB for each DL/I database the application program will access. We will discuss more about PCBs in the upcoming modules. PSBGEN must be performed to create a PSB for the program. PSBGEN PSBGEN is known as Program Specification Block Generator. The following example creates a PSB using PSBGEN − PRINT NOGEN PCB TYPE=DB,DBDNAME=LIBRARY,KEYLEN=10,PROCOPT=LS SENSEG NAME=LIBSEG SENSEG NAME=BOOKSEG,PARENT=LIBSEG SENSEG NAME=MAGSEG,PARENT=LIBSEG PSBGEN PSBNAME=LIBPSB,LANG=COBOL END Let us understand the terms used in the above DBDGEN − The first macro statement is the Program Communication Block (PCB) that describes the database Type, Name, Key-Length, and Processing Option. DBDNAME parameter on the PCB macro specifies the name of the DBD. KEYLEN specifies the length of the longest concatenated key. The program can process in the database. PROCOPT parameter specifies the program”s processing options. For example, LS means only LOAD Operations. SENSEG is known as Segment Level Sensitivity. It defines the program”s access to parts of the database and it is identified at the segment level. The program has access to all the fields within the segments to which it is sensitive. A program can also have field-level sensitivity. In this, we define a segment name and the parent name of the segment. The last macro statement is PCBGEN. PSBGEN is the last statement telling there are no more statements to process. PSBNAME defines the name given to the output PSB module. The LANG parameter specifies the language in which the application program is written, e.g., COBOL. Access Control Block (ACB) Listed below are the points to note about access control blocks − Access Control Blocks for an application program combines the Database Descriptor and the Program Specification Block into an executable form. ACBGEN is known as Access Control Blocks Generator. It is used to generate ACBs. For online programs, we need to pre-build ACBs. Hence the ACBGEN utility is executed before executing the application program. For batch programs, ACBs can be generated at execution time too. Print Page Previous Next Advertisements ”;
IMS DB – Data Manipulation
IMS DB – Data Manipulation ”; Previous Next The different data manipulation methods used in IMS DL/I calls are as follows − ISRT Call Get Hold Calls REPL Call DLET Call Let us consider the following IMS database structure to understand the data manipulation function calls − ISRT Call Points to note − ISRT call is known as Insert call which is used to add segment occurrences to a database. ISRT calls are used for loading a new database. We issue an ISRT call when a segment description field is loaded with data. An unqualified or qualified SSA must be specified in the call so that the DL/I knows where to place a segment occurrence. We can use a combination of both unqualified and qualified SSA in the call. A qualified SSA can be specified for all the above levels. Let us consider the following example − CALL ”CBLTDLI” USING DLI-ISRT PCB-NAME IO-AREA LIBRARY-SSA BOOKS-SSA UNQUALIFIED-ENGINEERING-SSA The above example shows we are issuing an ISRT call by providing a combination of qualified and unqualified SSAs. When a new segment that we are inserting has a unique key field, then it is added at the proper position. If the key field is not unique, then it is added by the rules defined by a database administrator. When we issue an ISRT call without specifying a key field, then the insert rule tells where to place the segments relative to existing twin segments. Given below are the insert rules − First − If the rule is first, the new segment is added before any existing twins. Last − If the rule is last, the new segment is added after all existing twins. Here − If the rule is here, it is added at the current position relative to existing twins, which may be first, last, or anywhere. Status Codes The following table shows the relevant status codes after an ISRT call − S.No Status Code & Description 1 Spaces Successful call 2 GE Multiple SSAs are used and the DL/I cannot satisfy the call with the specified path. 3 II Try to add a segment occurrence that is already present in the database. 4 LB / LC LD / LE We get these status codes while load processing. In most cases, they indicate that you are not inserting the segments in an exact hierarchical sequence. Get Hold Call Points to note − There are three types of Get Hold call which we specify in a DL/I call: Get Hold Unique (GHU) Get Hold Next (GHN) Get Hold Next within Parent (GHNP) Hold function specifies that we are going to update the segment after retrieval. So before an REPL or DLET call, a successful hold call must be issued telling the DL/I an intent to update the database. REPL Call Points to note − After a successful get hold call, we issue an REPL call to update a segment occurrence. We cannot change the length of a segment using an REPL call. We cannot change the value of a key field using an REPL call. We cannot use a qualified SSA with an REPL call. If we specify a qualified SSA, then the call fails. CALL ”CBLTDLI” USING DLI-GHU PCB-NAME IO-AREA LIBRARY-SSA BOOKS-SSA ENGINEERING-SSA IT-SSA. *Move the values which you want to update in IT segment occurrence* CALL ‘CBLTDLI’ USING DLI-REPL PCB-NAME IO-AREA. The above example updates the IT segment occurrence using an REPL call. First, we issue a GHU call to get the segment occurrence we want to update. Then, we issue an REPL call to update the values of that segment. DLET Call Points to note − DLET call works much in the same way as an REPL call does. After a successful get hold call, we issue a DLET call to delete a segment occurrence. We cannot use a qualified SSA with a DLET call. If we specify a qualified SSA, then the call fails. CALL ”CBLTDLI” USING DLI-GHU PCB-NAME IO-AREA LIBRARY-SSA BOOKS-SSA ENGINEERING-SSA IT-SSA. CALL ‘CBLTDLI’ USING DLI-DLET PCB-NAME IO-AREA. The above example deletes the IT segment occurrence using a DLET call. First, we issue a GHU call to get the segment occurrence we want to delete. Then, we issue a DLET call to update the values of that segment. Status Codes The following table shows the relevant status codes after an REPL or a DLET call − S.No Status Code & Description 1 Spaces Successful call 2 AJ Qualified SSA used on REPL or DLET call. 3 DJ Program issues a replace call without an immediately preceding get hold call. 4 DA Program makes a change to the segment’s key field before issuing the REPL or DLET call Print Page Previous Next Advertisements ”;
IMS DB – DL/I Processing
IMS DB – DL/I Processing ”; Previous Next IMS DB stores data at different levels. Data is retrieved and inserted by issuing DL/I calls from an application program. We will discuss about DL/I calls in detail in the upcoming chapters. Data can be processed in the following two ways − Sequential Processing Random Processing Sequential Processing When segments are retrieved sequentially from the database, DL/I follows a predefined pattern. Let us understand the sequential processing of IMS DB. Listed below are the points to note about sequential processing − Predefined pattern for accessing data in DL/I is first down the hierarchy, then left to right. The root segment is retrieved first, then DL/I moves to the first left child and it goes down till the lowest level. At the lowest level, it retrieves all the occurrences of twin segments. Then it goes to the right segment. To understand better, observe the arrows in the above figure that show the flow for accessing the segments. Library is the root segment and the flow starts from there and goes till cars to access a single record. The same process is repeated for all occurrences to get all the data records. While accessing data, the program uses the position in the database which helps to retrieve and insert segments. Random Processing Random processing is also known as direct processing of data in IMS DB. Let us take an example to understand random processing in IMS DB − Listed below are the points to note about random processing − Segment occurrence that needs to be retrieved randomly requires key fields of all the segments it depends upon. These key fields are supplied by the application program. A concatenated key completely identifies the path from the root segment to the segment which you want to retrieve. Suppose you want to retrieve an occurrence of the Commerce segment, then you need to supply the concatenated key field values of the segments it depends upon, such as Library, Books, and Commerce. Random processing is faster than sequential processing. In real-world scenario, the applications combine both sequential and random processing methods together to achieve best results. Key Field Points to note − A key field is also known as a sequence field. A key field is present within a segment and it is used to retrieve the segment occurrence. A key field manages the segment occurrence in ascending order. In each segment, only a single field can be used as a key field or sequence field. Search Field As mentioned, only a single field can be used as a key field. If you want to search for the contents of other segment fields which are not key fields, then the field which is used to retrieve the data is known as a search field. Print Page Previous Next Advertisements ”;
IMS DB – Overview
IMS DB – Overview ”; Previous Next A Brief Overview Database is a collection of correlated data items. These data items are organized and stored in a manner to provide fast and easy access. IMS database is a hierarchical database where data is stored at different levels and each entity is dependent on higher level entities. The physical elements on an application system that use IMS are shown in the following figure. Database Management A Database Management system is a set of application programs used for storing, accessing, and managing data in the database. IMS database management system maintains integrity and allows fast recovery of data by organizing it in such a way that it is easy to retrieve. IMS maintains a large amount of world”s corporate data with the help of its database management system. Transaction Manager The function of transaction manager is to provide a communication platform between the database and the application programs. IMS acts as a transaction manager. A transaction manager deals with the end-user to store and retrieve data from the database. IMS can use IMS DB or DB2 as its back-end database to store the data. DL/I – Data Language Interface DL/I comprises of application programs that grant access to the data stored in the database. IMS DB uses DL/I which serves as the interface language that programmers use for accessing the database in an application program. We will discuss this in more detail in the upcoming chapters. Characteristics of IMS Points to note − IMS supports applications from different languages such as Java and XML. IMS applications and data can be accessed over any platform. IMS DB processing is very fast as compared to DB2. Limitations of IMS Points to note − Implementation of IMS DB is very complex. IMS predefined tree structure reduces flexibility. IMS DB is difficult to manage. Print Page Previous Next Advertisements ”;
IMS DB – Cobol Basics
IMS DB – Cobol Basics ”; Previous Next We include DL/I calls inside COBOL application program to communicate with IMS database. We use the following DL/I statements in COBOL program to access the database − Entry Statement Goback Statement Call Statement Entry Statement It is used to pass the control from the DL/I to the COBOL program. Here is the syntax of the entry statement − ENTRY ”DLITCBL” USING pcb-name1 [pcb-name2] The above statement is coded in the Procedure Division of a COBOL program. Let us go into the details of the entry statement in COBOL program − The batch initialization module triggers the application program and is executed under its control. The DL/I loads the required control blocks and modules and the application program, and control is given to the application program. DLITCBL stands for DL/I to COBOL. The entry statement is used to define the entry point in the program. When we call a sub-program in COBOL, its address is also provided. Likewise, when the DL/I gives the control to the application program, it also provides the address of each PCB defined in the program”s PSB. All the PCBs used in the application program must be defined inside the Linkage Section of the COBOL program because PCB resides outside the application program. The PCB definition inside the Linkage Section is called as PCB Mask. The relation between PCB masks and actual PCBs in storage is created by listing the PCBs in the entry statement. The sequence of listing in the entry statement should be same as they appear in the PSBGEN. Goback Statement It is used to pass the control back to the IMS control program. Following is the syntax of the Goback statement − GOBACK Listed below are the fundamental points to note about the Goback statement − GOBACK is coded at the end of the application program. It returns the control to DL/I from the program. We should not use STOP RUN as it returns the control to the operating system. If we use STOP RUN, the DL/I never gets a chance to perform its terminating functions. That is why, in DL/I application programs, Goback statement is used. Before issuing a Goback statement, all the non-DL/I datasets used in the COBOL application program must be closed, otherwise the program will terminate abnormally. Call Statement Call statement is used to request for DL/I services such as executing certain operations on the IMS database. Here is the syntax of the call statement − CALL ”CBLTDLI” USING DLI Function Code PCB Mask Segment I/O Area [Segment Search Arguments] The syntax above shows parameters which you can use with the call statement. We will discuss each of them in the following table − S.No. Parameter & Description 1 DLI Function Code Identifies the DL/I function to be performed. This argument is the name of the four character fields that describe the I/O operation. 2 PCB Mask The PCB definition inside the Linkage Section is called as PCB Mask. They are used in the entry statement. No SELECT, ASSIGN, OPEN, or CLOSE statements are required. 3 Segment I/O Area Name of an input/output work area. This is an area of the application program into which the DL/I puts a requested segment. 4 Segment Search Arguments These are optional parameters depending on the type of the call issued. They are used to search data segments inside the IMS database. Given below are the points to note about the Call statement − CBLTDLI stands for COBOL to DL/I. It is the name of an interface module that is link edited with your program’s object module. After each DL/I call, the DLI stores a status code in the PCB. The program can use this code to determine whether the call succeeded or failed. Example For more understanding of COBOL, you can go through our COBOL tutorial here. The following example shows the structure of a COBOL program that uses IMS database and DL/I calls. We will discuss in detail each of the parameters used in the example in the upcoming chapters. IDENTIFICATION DIVISION. PROGRAM-ID. TEST1. DATA DIVISION. WORKING-STORAGE SECTION. 01 DLI-FUNCTIONS. 05 DLI-GU PIC X(4) VALUE ”GU ”. 05 DLI-GHU PIC X(4) VALUE ”GHU ”. 05 DLI-GN PIC X(4) VALUE ”GN ”. 05 DLI-GHN PIC X(4) VALUE ”GHN ”. 05 DLI-GNP PIC X(4) VALUE ”GNP ”. 05 DLI-GHNP PIC X(4) VALUE ”GHNP”. 05 DLI-ISRT PIC X(4) VALUE ”ISRT”. 05 DLI-DLET PIC X(4) VALUE ”DLET”. 05 DLI-REPL PIC X(4) VALUE ”REPL”. 05 DLI-CHKP PIC X(4) VALUE ”CHKP”. 05 DLI-XRST PIC X(4) VALUE ”XRST”. 05 DLI-PCB PIC X(4) VALUE ”PCB ”. 01 SEGMENT-I-O-AREA PIC X(150). LINKAGE SECTION. 01 STUDENT-PCB-MASK. 05 STD-DBD-NAME PIC X(8). 05 STD-SEGMENT-LEVEL PIC XX. 05 STD-STATUS-CODE PIC XX. 05 STD-PROC-OPTIONS PIC X(4). 05 FILLER PIC S9(5) COMP. 05 STD-SEGMENT-NAME PIC X(8). 05 STD-KEY-LENGTH PIC S9(5) COMP. 05 STD-NUMB-SENS-SEGS PIC S9(5) COMP. 05 STD-KEY PIC X(11). PROCEDURE DIVISION. ENTRY ”DLITCBL” USING STUDENT-PCB-MASK. A000-READ-PARA. 110-GET-INVENTORY-SEGMENT. CALL ‘CBLTDLI’ USING DLI-GN STUDENT-PCB-MASK SEGMENT-I-O-AREA. GOBACK. Print Page Previous Next Advertisements ”;
IMS DB – SSA
IMS DB – SSA ”; Previous Next SSA stands for Segment Search Arguments. SSA is used to identify the segment occurrence being accessed. It is an optional parameter. We can include any number of SSAs depending on the requirement. There are two types of SSAs − Unqualified SSA Qualified SSA Unqualified SSA An unqualified SSA provides the name of the segment being used inside the call. Given below is the syntax of an unqualified SSA − 01 UNQUALIFIED-SSA. 05 SEGMENT-NAME PIC X(8). 05 FILLER PIC X VALUE SPACE. The key points of unqualified SSA are as follows − A basic unqualified SSA is 9 bytes long. The first 8 bytes hold the segment name which is being used for processing. The last byte always contains space. DL/I uses the last byte to determine the type of SSA. To access a particular segment, move the name of the segment in the SEGMENT-NAME field. The following images show the structures of unqualified and qualified SSAs − Qualified SSA A Qualified SSA provides the segment type with the specific database occurrence of a segment. Given below is the syntax of a Qualified SSA − 01 QUALIFIED-SSA. 05 SEGMENT-NAME PIC X(8). 05 FILLER PIC X(01) VALUE ”(”. 05 FIELD-NAME PIC X(8). 05 REL-OPR PIC X(2). 05 SEARCH-VALUE PIC X(n). 05 FILLER PIC X(n+1) VALUE ”)”. The key points of qualified SSA are as follows − The first 8 bytes of a qualified SSA holds the segment name being used for processing. The ninth byte is a left parenthesis ”(”. The next 8 bytes starting from the tenth position specifies the field name which we want to search. After the field name, in the 18th and 19th positions, we specify two-character relational operator code. Then we specify the field value and in the last byte, there is a right parenthesis ”)”. The following table shows the relational operators used in a Qualified SSA. Relational Operator Symbol Description EQ = Equal NE ~= ˜ Not equal GT > Greater than GE >= Greater than or equal LT << Less than LE <= Less than or equal Command Codes Command codes are used to enhance the functionality of DL/I calls. Command codes reduce the number of DL/I calls, making the programs simple. Also, it improves the performance as the number of calls is reduced. The following image shows how command codes are used in unqualified and qualified SSAs − The key points of command codes are as follows − To use command codes, specify an asterisk in the 9th position of the SSA as shown in the above image. Command code is coded at the tenth position. From 10th position onwards, DL/I considers all characters to be command codes until it encounters a space for an unqualified SSA and a left parenthesis for a qualified SSA. The following table shows the list of command codes used in SSA − Command Code Description C Concatenated Key D Path Call F First Occurrence L Last Occurrence N Path Call Ignore P Set Parentage Q Enqueue Segment U Maintain Position at this level V Maintain Position at this and all above levels – Null Command Code Multiple Qualifications The fundamental points of multiple qualifications are as follows − Multiple qualifications are required when we need to use two or more qualifications or fields for comparison. We use Boolean operators like AND and OR to connect two or more qualifications. Multiple qualifications can be used when we want to process a segment based on a range of possible values for a single field. Given below is the syntax of Multiple Qualifications − 01 QUALIFIED-SSA. 05 SEGMENT-NAME PIC X(8). 05 FILLER PIC X(01) VALUE ”(”. 05 FIELD-NAME1 PIC X(8). 05 REL-OPR PIC X(2). 05 SEARCH-VALUE1 PIC X(m). 05 MUL-QUAL PIC X VALUE ”&”. 05 FIELD-NAME2 PIC X(8). 05 REL-OPR PIC X(2). 05 SEARCH-VALUE2 PIC X(n). 05 FILLER PIC X(n+1) VALUE ”)”. MUL-QUAL is a short term for MULtiple QUALIification in which we can provide boolean operators like AND or OR. Print Page Previous Next Advertisements ”;
IMS DB – DL/I Functions
IMS DB – DL/I Functions ”; Previous Next DL/I function is the first parameter that is used in a DL/I call. This function tells which operation is going to be performed on the IMS database by the IMS DL/I call. The syntax of DL/I function is as follows − 01 DLI-FUNCTIONS. 05 DLI-GU PIC X(4) VALUE ”GU ”. 05 DLI-GHU PIC X(4) VALUE ”GHU ”. 05 DLI-GN PIC X(4) VALUE ”GN ”. 05 DLI-GHN PIC X(4) VALUE ”GHN ”. 05 DLI-GNP PIC X(4) VALUE ”GNP ”. 05 DLI-GHNP PIC X(4) VALUE ”GHNP”. 05 DLI-ISRT PIC X(4) VALUE ”ISRT”. 05 DLI-DLET PIC X(4) VALUE ”DLET”. 05 DLI-REPL PIC X(4) VALUE ”REPL”. 05 DLI-CHKP PIC X(4) VALUE ”CHKP”. 05 DLI-XRST PIC X(4) VALUE ”XRST”. 05 DLI-PCB PIC X(4) VALUE ”PCB ”. This syntax represents the following key points − For this parameter, we can provide any four-character name as a storage field to store the function code. DL/I function parameter is coded in the working storage section of the COBOL program. For specifying the DL/I function, the programmer needs to code one of the 05 level data names such as DLI-GU in a DL/I call, since COBOL does not allow to code literals on a CALL statement. DL/I functions are divided into three categories: Get, Update, and Other functions. Let us discuss each of them in detail. Get Functions Get functions are similar to the read operation supported by any programming language. Get function is used to fetch segments from an IMS DL/I database. The following Get functions are used in IMS DB − Get Unique Get Next Get Next within Parent Get Hold Unique Get Hold Next Get Hold Next within Parent Let us consider the following IMS database structure to understand the DL/I function calls − Get Unique ”GU” code is used for the Get Unique function. It works similar to the random read statement in COBOL. It is used to fetch a particular segment occurrence based on the field values. The field values can be provided using segment search arguments. The syntax of a GU call is as follows − CALL ”CBLTDLI” USING DLI-GU PCB Mask Segment I/O Area [Segment Search Arguments] If you execute the above call statement by providing appropriate values for all parameters in the COBOL program, you can retrieve the segment in the segment I/O area from the database. In the above example, if you provide the field values of Library, Magazines, and Health, then you get the desired occurrence of the Health segment. Get Next ”GN” code is used for the Get Next function. It works similar to the read next statement in COBOL. It is used to fetch segment occurrences in a sequence. The predefined pattern for accessing data segment occurrences is down the hierarchy, then left to right. The syntax of a GN call is as follows − CALL ”CBLTDLI” USING DLI-GN PCB Mask Segment I/O Area [Segment Search Arguments] If you execute the above call statement by providing appropriate values for all parameters in the COBOL program, you can retrieve the segment occurrence in the segment I/O area from the database in a sequential order. In the above example, it starts with accessing the Library segment, then Books segment, and so on. We perform the GN call again and again, until we reach the segment occurrence we want. Get Next within Parent ”GNP” code is used for Get Next within Parent. This function is used to retrieve segment occurrences in sequence subordinate to an established parent segment. The syntax of a GNP call is as follows − CALL ”CBLTDLI” USING DLI-GNP PCB Mask Segment I/O Area [Segment Search Arguments] Get Hold Unique ”GHU” code is used for Get Hold Unique. Hold function specifies that we are going to update the segment after retrieval. The Get Hold Unique function corresponds to the Get Unique call. Given below is the syntax of a GHU call − CALL ”CBLTDLI” USING DLI-GHU PCB Mask Segment I/O Area [Segment Search Arguments] Get Hold Next ”GHN” code is used for Get Hold Next. Hold function specifies that we are going to update the segment after retrieval. The Get Hold Next function corresponds to the Get Next call. Given below is the syntax of a GHN call − CALL ”CBLTDLI” USING DLI-GHN PCB Mask Segment I/O Area [Segment Search Arguments] Get Hold Next within Parent ”GHNP” code is used for Get Hold Next within Parent. Hold function specifies that we are going to update the segment after retrieval. The Get Hold Next within Parent function corresponds to the Get Next within Parent call. Given below is the syntax of a GHNP call − CALL ”CBLTDLI” USING DLI-GHNP PCB Mask Segment I/O Area [Segment Search Arguments] Update Functions Update functions are similar to re-write or insert operations in any other programming language. Update functions are used to update segments in an IMS DL/I database. Before using the update function, there must be a successful call with Hold clause for the segment occurrence. The following Update functions are used in IMS DB − Insert Delete Replace Insert ”ISRT” code is used for the Insert function. The ISRT function is used to add a new segment to the database. It is used to change an existing database or load a new database. Given below is the syntax of an ISRT call − CALL ”CBLTDLI” USING DLI-ISRT PCB Mask Segment I/O Area [Segment Search Arguments] Delete ”DLET” code is used for the Delete function. It is used to remove a segment from an IMS DL/I database. Given below is the syntax of a DLET call − CALL ”CBLTDLI” USING DLI-DLET PCB Mask Segment I/O Area [Segment Search Arguments] Replace ”REPL” code is used for Get Hold Next within Parent. The Replace function is used to replace a segment in the IMS DL/I database. Given below is the syntax of an REPL call − CALL ”CBLTDLI” USING DLI-REPL PCB Mask Segment I/O Area [Segment Search Arguments] Other Functions The
IMS DB – Home
IMS DB Tutorial PDF Version Quick Guide Resources Job Search Discussion IMS stands for Information Management System. IMS was developed by IBM with Rockwell and Caterpillar in year 1966 for the Apollo program to send a man to the moon. It started the database management system revolution and still continues to evolve to meet data processing requirements. IMS provides an easy-to-use, reliable, and standard environment for executing high-performance transactions. IMS database is used by high-level programming languages like COBOL to store data in hierarchical arrangement and access it. Audience This tutorial is designed for software programmers who are interested in understanding the concepts of IMS database starting from scratch. This tutorial gives enough understanding on IMS data management from where you can take yourself to higher levels of expertise. Prerequisites Before proceeding with this tutorial, you should have a basic understanding COBOL programming skills. A basic knowledge of database concepts will help you understand the IMS database management system. Print Page Previous Next Advertisements ”;