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 / mr.perfect
9 times.
Initially, W-Num value will be 1.
1>9, so para will be executed. - 1 time
2>9, so para will be executed. - 2 times
3>9, so para will be executed. - 3 times
4>9, so para will be executed. - 4 times
5>9, so para will be executed. - 5 times
6>9, so para will be executed. - 6 times
7>9, so para will be executed. - 7 times
8>9, so para will be executed. - 8 times
9>9, so para will be executed. - 9 times
10>9, this will go to 0 because , the PIC at WOrking
storage section is 9. so that 10 becomes 0
W-NNum = 0 . THe loop again start from 0> 9
this will execute Infinite loop.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How many sections are there in data division in COBOL?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
what is s000 u4087 error? please give the all error codes in cobol,jcl.
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
Which Search verb is equivalent to PERFORM…VARYING?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
how do you reference the ksds vsam file formats from cobol programs
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
Write the code implementing the perform … varying.
How do you differentiate between cobol and cobol-ii?
What guidelines should be followed to write a structured cobol prgm?
what is the use of outrecord?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
how do you define single dimensional array and multidimensional array in your cobol?