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

Difference between cobol and cobol-ii?

715


What are the different rules of SORT operation?

702


What are the different rules for performing sort operation?

766


Which mode is used to operate the sequential file?

673


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

1638






What is the local-storage section?

685


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

714


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

720


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

1878


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1916


How do we get current date from system with century in COBOL?

809


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

712


What the difference is between continue and next sentence?

665


Write down the divisions of cobol program?

673


how to access the file from prodution from changeman tool and to submit a file to production

6692