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
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What is the difference between PIC 9.99 and PIC9v99?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What the difference is between continue and next sentence?
What is the difference between goback, stop run and exit program in cobol?
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 not true about evaluate statement
Write some characteristics of cobol as means of business language.
How do you reference the following file formats from cobol programs?
What is the difference between binary search and sequential search?
example for sub strings ? and refernce modifications whit output pls
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
What is the difference between Call and a Link?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.