Consider the following:
77 W-NUM PIC 9 VALUE 0
------
MOVE 1 TO W-NUM
PERFORM PARA-X UNTIL W-NUM > 9.
------
PARA-X
ADD 1 TO W-NUM
How many times PARA-X is executed ?
Answer Posted / gaurav
Rahul's answer is correct.
Please note that the W-NUM is defined as PIC 9, hence it
can contain only a single digit numberic number i.e from
number 0 to number 9. Thus when the PARA-X is executed 9
times when W-NUM contains 9. It will not be able to add
further 1 to W-NUM, thus it will go in a infinite loop.
Hope this clear things.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What is the difference between Global and External Variables?
Explain about different table spaces.
how do you reference the fixed unblock file formats from cobol programs
i need a small 3d program using inline and outline.
what are decleratives in cobol?
what is difference between cobol and cobol/400
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
how do you reference the ksds vsam file formats from cobol programs
Explain what you understand by passing by value.
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.
Define cobol?
What is the difference between binary search and sequential search?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Difference between array and sub-script ?