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

can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

2181


Describe the cobol database components?

886


How many sections are there in data division in COBOL?

881


Explain about different table spaces.

851


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

976


How to use the same COBOL program in Batch and CICS on lines? explain with an example

2101


What is the problem of ordered sequential files access?

901


In COBOL programming, what is PERFORM? What is VARYING?

866


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

902


What type of SDLC u followed? Why?

1720


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1406


What is the difference between perform … with test after and perform … with test before?

1146


What is cobol?

942


Can you please let me know the centre name of INS certification in Kolkata.

1941


What is a SSRANGE and NOSSRANGE?

1106