Code for Program to Describe The Functionality of the two dimention table in Cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. PROG.
DATA DIVISION.
01 MAT-DET.
05 ROW1 OCCURS 2 TIMES.
10 COL1 PIC 99 OCCURS 3 TIMES.
01 I PIC 9.
01 J PIC 9.
PROCEDURE DIVISION.
PARA1.
PERFORM VARYING I FROM 1 BY 1 UNTIL I IS GREATER THAN 2
PERFORM VARYING J FROM 1 BY 1 UNTIL J IS GREATER THAN 3
DISPLAY "ENTER THE NO(" I ")(" J ")"
ACCEPT COL1(I,J)
END-PERFORM
END-PERFORM.
* FOR PRINTING PURPOSE
PERFORM VARYING I FROM 1 BY 1 UNTIL I IS GREATER THAN 2
PERFORM VARYING J FROM 1 BY 1 UNTIL J IS GREATER THAN 3
DISPLAY "THE MARKS IS -->"COL1(I,J).
STOP RUN.
*******
OUTPUT
*******
ENTER THE NO(1)(1)
10
ENTER THE NO(1)(2)
11
ENTER THE NO(1)(3)
13
ENTER THE NO(2)(1)
14
ENTER THE NO(2)(2)
15
ENTER THE NO(2)(3)
16