Rules for indexed tables, COBOL Programming

RULES FOR INDEXED TABLES:

The rules of indexing a table with an INDEXED phrase are as shown below:

(1) If indexing is completed for any one level of a table, then indexing should be used for all levels. Therefore it will be an error if in the above the INDEXED phrase is used only for FACULTY and not for the DEPARTMENT and YEAR.

(2) The Index names cannot be used in combination with the subscripts. And hence, a reference as YEAR (F1, S2, S3) will be treated as an error as F1 is an index name but S2 and S3 are data names. Though, index names can be used in a combination with numeric positive integral literals. Therefore YEAR (F1, 2, 3) is valid as F1 is an index name, while 2 and 3 are numeric integral literals.

(3) Indexes are valid only for the tables where they have been identified. The Indexes for one table cannot be used for the other table. Therefore F1, D1 and Y1, being indexes for the table ENROLL-TABLE, cannot be used for other tables in similar program.

(4) The index names should be exclusive. The same index name should not be used for various levels of a table.

(5) The indexes should not appear anywhere in the DATA DIVISION except in the INDEXED phrase of the OCCURS clause. This means that the index names must be implicitly defined and must not be defined explicitly.

(6) The Indexes can be manipulated only by the SEARCH, SET and PERFORM statements. The value of an index is frequently known as the occurrence number. The internal presentation of the occurrence number is system dependent.

(7) An index can be coded plus or minus an integer literal for the relative addressing of the table elements. For illustration, YEAR (F1+1, D1-2, Y1-1) is valid. If F1, D1 and suppose that the value 1,3 and 4 respectively then this will refer to the third YEAR of the first DEPARTMENT of the second FACULTY.

(8) There can be more than one index for each level. For illustration, the ENROLL-TABLE can also be defined as

1783_RULES FOR INDEXED TABLES.png

Posted Date: 10/18/2012 1:48:09 AM | Location : United States







Related Discussions:- Rules for indexed tables, Assignment Help, Ask Question on Rules for indexed tables, Get Answer, Expert's Help, Rules for indexed tables Discussions

Write discussion on Rules for indexed tables
Your posts are moderated
Related Questions
Example of constructing an arithmetic expression: An arithmetic expression may be proceeded by a + or - sign. These operations are known as unary + or unary - operators. Il

FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.

Rules for Simple sort verb: The work file is to be defined by a sort elaboration entry (SD entry).The format of SD entry is as shown below. The rules below should be taken

Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

LABEL RECORD CLAUSE: This clause specifies whether or not the standard header and trailer labels must be present in the magnetic-tape files. VALUE OF CLAUSE: The VAL

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

DELETE STATEMENT : The file should be opened in the I-O mode. If the access is SEQUENTIAL, the INVALID KEY phrase must be specified. Rather than, the last input-output state

Block Size: The normal practice is to group a number of consecutive records to form that is termed as a block or a physical record. The number of records in a block is frequen