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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / villan

Cool explanation... Hats off....

Is This Answer Correct ?    28 Yes 3 No

Post New Answer

More COBOL Interview Questions

What is an in-line perform ?

4 Answers   Accenture,


if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.

2 Answers   UST,


What is the different between index and subscript?

3 Answers  


How to know whether the module is dynamical or statistical?

0 Answers  


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  






what is MSGLEVEL?

1 Answers   IBM,


Wat is the difference between NEXT and CONTINUE statement in cobol,can any one explain with example.

11 Answers   Deloitte,


) How do u handle errors in BMS macro?

0 Answers   IBM,


have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..

5 Answers   TCS,


77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......

8 Answers  


Which mode is used to operate the sequential file?

0 Answers  


what happens when a copybook variables are declared using include statement ?

3 Answers   IBM,


Categories