what is the difference between occurs and occurs depending
on? i dont think so there is the difference in
storage..then why we should use occurs depending on?

Answer Posted / venkat

when we define cobol table with OCCURS, it is of fixed
storage and length. The program execution will take the
total storage irrespective of utiliztaion. Where as table
degined with OCCURS DEPENDING ON provides flexibility to
the developers to choose length of table dynamically.
Length of below table is based on WS-OBJ value.

WS-SUB OCCURS 1 TO 5 TIMES DEPENDING ON WS-OBJ PIC X(2).

For example if you want to stoge employee detail in an
cobol table and you are not aware of number of employees at
the time of table declaration, you can use variable length
cobol table. During program execution based on number of
employees you can set the length of table

Is This Answer Correct ?    14 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1948


Which Search verb is equivalent to PERFORM…VARYING?

677


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

1708


how do you reference the variable unblock file formats from cobol programs

734


how can i see junk values in dclgen or in hostvariable of comp ?

2533






how do you reference the rrds file formats from cobol programs

786


What is the compute verb? How is it used?

650


How many bytes S(8) comp field occupy and its maximum value?

1621


What is comp-1 and comp-2?

754


Define cobol?

854


What are the access modes of START statement?

707


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

847


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

647


Which is not true about evaluate statement

1560


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

705