Rules for indexed tables, COBOL Programming

Assignment Help:

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


Related Discussions:- Rules for indexed tables

Search verb, SEARCH VERB: The SEARCH verb is used to position elements...

SEARCH VERB: The SEARCH verb is used to position elements in one-dimensional tables. Let us consider the following problem. Assume that each element of a table consists of thr

Perform with until option, PERFORM WITH UNTIL OPTION: The format is as...

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

Use of evaluate statement, Evaluate is like a case statement & Evaluate  s...

Evaluate is like a case statement & Evaluate  stamenet can be used to replace nested Ifs. The difference b/w EVALUATE and case is that there is no 'break' is required for EVALUATE

Delete statement - indexed files, DELETE STATEMENT : The file should be...

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

Program for move corresponding, PROGRAM FOR MOVE CORRESPONDING: We hav...

PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.

Example of move corresponding, Example of Move corresponding: Consider...

Example of Move corresponding: Consider the DATA DIVISION entries shown below. Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be

Object-computer - configuration section, Object-Computer - Configuration se...

Object-Computer - Configuration section: The computer name specifies a specific computer on which the object program is to be executed. The MEMORY SIZE is used to show the

Comparison of nonnumeric operands - relational condition, Comparison of Non...

Comparison of Nonnumeric Operands: A nonnumeric operand can be compared to the other nonnumeric operand according to the rules as shown below: (i) Fields of Equal Sizes:

Kirat da satikar, bal majduri ik kanuni apradh hai is de bavjud bache ,ghra...

bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

Data division, Data Division: The Data Division is a part of the COBOL...

Data Division: The Data Division is a part of the COBOL program where every data item processed by the program is described. It is very important to note that unless a data

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd