Can we dynamically increase the size of occurs clause? i.e
In case I an not sure of the size of array and want to
increase the size at run time.If yes , how?
Answer Posted / lu
yes, ...you declare an array like this:
77 ws-counter pic 9(04) value zeroes.
01 ws-array.
07 ws-field pic x (01) ouccurs 1 to 1000
depending on ws-counter.
Procedure Division.
Perform Read-file until ws-end-of-file = 'y'.
Read-file.
Read file at end
move 'y' to ws-end-of-file.
if ws-end-of-file not = 'y'
add 1 to ws-counter
move aa of file to ws-field (ws-counter).
the maximun is 1000 occurrences and minimun is 1...
| Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
What is the difference between next sentence and continue in cobol programing language?
For rewrite, why is it mandatory that file needs to be opened?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What is an in line perform? When would you use it? Anything else you wish to say about it.
What are the rules of the move verb?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Write down the divisions of cobol program?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
A table has two indexes defined. Which one will be used by the SEARCH?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
What are different data types in cobol?