Explain complete concept of table handling in COBOL with an
example?

Answer Posted / sivakumar sekharannair

repeated occurance of a field in a file can be defined as a
table of occurance. for example the file has records of of
a student details. it has the following fields
student name
stud registration number
stud class
student mark1
student mark2
student mark3
student mark4
student mark5
first three fields will vary in number of bytes. but 4th to
8th fields will be having same number of bytes(same
information repeated). so when we usually define a layout
for the file we will follow the below mentioned layout.
01 stud-details.
05 stud-name pic x(20).
05 stud-reg-no pic 9(9).
05 stud-class pic 9(2).
05 stud-mark1 pic 9(3).
05 stud-mark2 pic 9(3).
05 stud-mark3 pic 9(3).
05 stud-mark4 pic 9(3).
05 stud-mark5 pic 9(3).

Here we can see that for marks we have five different
fields which is wastage of space. to prevent this there is
a concept called table . by this all the five marks field
can be defined using a single field.
01 stud-details.
05 stud-name pic x(20).
05 stud-reg-no pic 9(9).
05 stud-class pic 9(2).
05 stud-mark pic 9(3) occurs 5 times
occurs clause will occupy the value of stud-mark five times
which is equal to having the mark field defined five times.

Is This Answer Correct ?    69 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2124


Difference between array and sub-script ?

1169


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1958


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1808


What is static and dynamic call in cobol?

601






Explain the configuration section of a cobol program with examples of syntax.

661


what is amode(24), amode(31), rmode(24) and rmode(any)?

705


How can you get the ksds file records into your cobol program?

646


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2103


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

714


Can we redefine the field of x(200) to less than 200?

823


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

645


Define cobol?

866


how do you reference the ksds vsam file formats from cobol programs

669


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

691