Multi-dimensional tables, COBOL Programming


The type of table which has been considered above is known as one-dimensional table. Whenever a table is such that each of its elements in turn is a table of one dimension, it is known as the two-dimensional table. The illustration of a two-dimensional table is as shown below:


             02  BRANCH-FIGURES OCCURS  18  TIMES.

    03  MONTHLY-SALES  PIC  9(6)  V99  OCCURS  12


The table is supposed to store monthly sales figures for 12 months for each of the 18 branches of an organization. Keep in mind that this is a two-dimensional table as each of the 18 BRANCH-FIGURES is itself a table having 12 elements. It might be further noted that a reference to an element of a two-dimensional table needs two subscripts. We should specify the branch as well as the month so that the preferred element is identified. Therefore, the MONTHLY-SALES (3, 5) means that the sales figure for fifth month of the third branch. Because of the organization identified in the above description of the table, the initial subscript implicitly refers to the branch and the second subscript to the month. The two-dimensional table has been separated first into 18 one-dimensional tables through the entry at level 02. Each of such tables has then been defined by the entry at level 03. This organization can be shown diagrammatically as:


If needed, the tables for the individual branches can be referred to by the name BRANCH-FIGURE with only one subscript specifying the branch. Therefore the BRANCH-FIGURE (4) will show the monthly sales table for the fourth branch. \

Posted Date: 10/18/2012 1:36:16 AM | Location : United States

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

Write discussion on Multi-dimensional tables
Your posts are moderated
Related Questions
REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION (RANDOM MODE): We have to write a program to create an Indexed Sequential File in random mode for Student particulars. Suppose jus

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

Edit Characters for Numeric Data: The characters below can be used in the PICTURE clause to indicate the editing.   Z    *  $  -    +    CR    DB    .    ,    B    O    /

IF STATEMENT: The easiest form of the IF statement is  IF condition-1 statement-1 where the condition-1 may be any one from the shown below. When the condition-1

PROGRAM FOR IF -ELSE: We have to write a program to check whether the given number is ODD or EVEN. You can use IF..ELSE. Identification division. Program- id. IfElse.

Format for COBOL Programs: The COBOL is a high-level language. Therefore, a COBOL program can be executed on a computer for which a COBOL compiler exists. The compiler transla

Column and Field in COBOL program: In COBOL there are 2 types of entries termed as margin A and margin B entries. The Margin A entries start from the column 8, 9, 10 or 11 and

Numeric -   Literals : The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specifi

Illustration of the abbreviation: A few illustration of the abbreviation are given below: Illustration: The compound condition  AMOUNT GREATER THAN 499 AND AMOUNT L