Concept of a two-dimensional table, COBOL Programming

Concept of a two-dimensional table:

Concept of a two-dimensional table can be easily extended to tables having three or more dimensions. The Handling of tables up to three dimensions is permitted by most compilers; some even allow more than three. The rules below may be noted in connection with multi-dimensional tables.

(i)  The Multi-dimensional tables are to be defined as records with OCCURS clauses at different levels. As we go down the hierarchy, each lower level item with an OCCURS clause identifies an additional dimension. For illustration, consider the table shown below:

(ii)         

1049_Concept of a two-dimensional table.png

2053_Concept of a two-dimensional table1.png

A & C are one-dimensional, F is a two-dimensional table and E is a three dimensional table. B & D are group items that can be referred to as one-dimensional and two dimensional tables correspondingly. 

 

 (ii)  A table is stored in such a way that a subscript on the right of the other subscript changes more rapidly than the later.

The organization of the SALES-TABLE shown above describes this. The elements MONTHLY-SALES (1, 12) are stored first. The elements MONTHLY-SALES (2, 1) to

MONTHLY-SALES (2, 12) are stored next, and so on. Keep in mind that the second subscript is changed more regularly than the first subscript. This fact must be taken into consideration while redefining a multi-dimensional table.

(iii)  The Multiple subscripts must be separated from one another either by a space or comma.  

Posted Date: 10/18/2012 1:39:00 AM | Location : United States







Related Discussions:- Concept of a two-dimensional table, Assignment Help, Ask Question on Concept of a two-dimensional table, Get Answer, Expert's Help, Concept of a two-dimensional table Discussions

Write discussion on Concept of a two-dimensional table
Your posts are moderated
Related Questions
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

SUBTRACT VERB: The SUBTRACT verb is used to subtract one, or the sum of two or more numbers from one or more numbers and to store the result. The form of the SUBTRACT verb

RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

REWRITE STATEMENT: The REWRITE statement has the format for a relative file as shown below, REWRITE record-name  [ FORM identifier ]

DIVIDE VERB: The aim of the DIVIDE verb is to divide one number by the other and to store the result.  There are few forms of this verb. One of its forms is as shown below:

VALUE CLAUSE: The value clause defines the preliminary value of the data item. Normally initialization will be completed just before the first statement in the procedure di

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.

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

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:

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