Explain complete concept of table handling in COBOL with an
example?
Answers were Sorted based on User's Feedback
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 |
can i give 9(10) in comp 3 instead of s9(10) ? if i can give wht would be ths ans
how we separate the cobol cics statements from cobol&cics programming?
is it mandatory to give data division before procedure division ? wht happens if i give procedure division first thn data division ? reply soon
Explain Restart Logic in Cobol?
Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?
How is sign stored in a COMP field ?
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?
given the following piece of code: CALL SUB-PGM USING A, B, C. CALL SUB-PGM USING A, C, C. (a) Both CALL statements will always produce same result. (d) Both CALL statements may produce different result. (c) Compile-time error because SUB-PGM is a dataname. (d) Compile-time error because A, B, C are used twice.
What is the difference between PIC 9.99 and 9v99 in COBOL?
0 Answers SwanSoft Technologies,
Can anyone explain me CALL procedure in COBOL.Does it carries similarities like call by reference in C.
Are you comfortable in cobol or jcl?
1.What is the default print format in cobol?