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 perform what is varying?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
how do you reference the esds vsam file formats from cobol programs
What is the difference between PIC 9.99 and PIC9v99?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What are all the divisions of a COBOL program?
HOw can I get the negative sign while deduct high value from low value
What are the different data types in cobol?
Explain the configuration section of a cobol program with examples of syntax.
Can we change the password using ALTER? anyone tried and changed?
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 ......
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
How do you get the data to code the BMS macro?
Write down the divisions of cobol program?