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
What is the compute verb? How is it used?
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?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
Which is not true about evaluate statement
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
How do we get current date from system with century in COBOL?
What are the different rules of SORT operation?
how do you reference the variable block file formats from cobol programs
What is an in line perform? When would you use it? Anything else you wish to say about it.
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What are the various section in data division and briefly explain them.