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
How you can read the file from bottom?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
how do you define single dimensional array and multidimensional array in your cobol?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
How do you get the data to code the BMS macro?
Difference between cobol and cobol-ii?
) how do u code after getting data?
what is difference between cobol and cobol/400
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
What are the pertinent COBOL commands?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
) what is the difference between AID and HANDLE AID?
What is link edit in cobol?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?