Indexed tables, COBOL Programming

INDEXED TABLES:

The OCCURS clause that is used to define tables can optionally have an INDEXED phrase. This phrase involves the names of data items which are to be used as subscripts to specify table elements. These data item is termed as index. The illustration below describes the table description with the INDEXED phrase.

2322_INDEXED TABLES.png

The reference to an element of this table can be completed as YEAR (F1, D1, Y1) having set suitable values to the index names F1, D1 and Y1.

The common form of the INDEXED   phrase is as shown below:

INDEXED BY index-name-1 [, index-name-2]...

The OCCURS clause with an INDEXED phrase takes the form as shown below:

1952_INDEXED TABLES1.png

Posted Date: 10/18/2012 1:46:24 AM | Location : United States







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

Write discussion on Indexed tables
Your posts are moderated
Related Questions
Example of Write statement: Illustration: (i) WRITE TRANS-RECORD AFTER ADVANCING 3 LINES. This WRITE statement specified that the TRANS-RECORD is a record name of a fi

CLOSE STATEMENT: When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is

FILE-CONTROL paragraph for the indexed files: The common format for the SELECT clause for a file is as shown below: SELECT  file-name  ASSIGN   TO  implementor -name

Example of add verb: (a) ADD A TO B. This illustration represents that the value of A will be added to the value of B and the result will be stored in B.  The alignment of

Example of File-control: The assign clause assigns a specific physical peripheral device name to a file. The physical peripheral device are machine-dependent. We use the devic

OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

LEVEL NUMBERS: The COBOL makes use of the level number concept to explain the hierarchical data structure. A level number is a 2 digit number. The permitted level numbers a

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below:

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil