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


Please Help Members By Posting Answers For Below Questions

Write a program that uses move corresponding.

673


What is comp-1 and comp-2?

764


In which area will you utilize 88 level items in cobol?

720


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

417


Describe the cobol database components?

680






What is difference between static and dynamic call in cobol?

777


What is the difference between Global and External Variables?

666


i need a small 3d program using inline and outline.

1633


What is the problem of ordered sequential files access?

694


how do you reference the variable unblock file formats from cobol programs

748


how do you reference the printer file formats from cobol programs

659


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

641


How to know whether the module is dynamical or statistical?

652


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

706


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1902