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

) what is the difference between AID and HANDLE AID?

1742


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2204


What are literals?

725


How to know whether the module is dynamical or statistical?

750


What is the difference between PIC 9.99 and 9v99 in COBOL?

850






What is the difference between next sentence and continue in cobol programing language?

822


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

806


What is the Purpose of POINTER Phrase in STRING command in COBOL?

845


What are the pertinent COBOL

2125


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

812


Write the code implementing the perform … varying.

722


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1948


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

729


What are all the divisions of a COBOL program?

756


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

4950