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

i want a program using by if, evaluate , string, unstring, perform, occurs?

4329


What are the different rules for performing sort operation?

939


What is static and dynamic call in cobol?

777


What the difference is between continue and next sentence?

861


What is a SSRANGE and NOSSRANGE?

1092


Describe the cobol database components?

876


A table has two indexes defined. Which one will be used by the SEARCH?

1002


How you can characterize tables in cobol?

914


What rules are to be followed while using the corresponding options?

822


What is the default value(s) for an initialize and what keyword allows for an override of the default?

940


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

2131


How do you get the data to code the BMS macro?

1681


Discuss about changing dataset name in proc.

951


) what is the difference between AID and HANDLE AID?

1876


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5581