consider the following two statements
MOVE 10 TO N
PERFORM PARA-X N TIMES
STOP RUN
PARA-X
MOVE 5 TO N
how many times PARA-X willbe exicuted?
a.10
b.5
c.infinate
d.execution error

Answer Posted / pradeep

It will execute only 10 Times only

See Below Code

IDENTIFICATION DIVISION.
PROGRAM-ID. MOVEPGM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-COUNT PIC 9(2).
PROCEDURE DIVISION.
A1000-MAIN-PARA.
MOVE 10 TO WS-COUNT
PERFORM PARA-X WS-COUNT TIMES.
STOP RUN.
PARA-X.
DISPLAY "TEST1".
MOVE 5 TO WS-COUNT.

Output Looks like this:

COMMAND INPUT ===>
********************************* TOP OF DATA *****
TEST1
TEST1
TEST1
TEST1
TEST1
TEST1
TEST1
TEST1
TEST1
TEST1
******************************** BOTTOM OF DATA ***

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What guidelines should be followed to write a structured cobol prgm?

668


how to move the records from file to array table. give with code example

2218


What are the pertinent COBOL

2041


What is the difference between comp and comp-3?

694


IF I mention stop run in CICS what happens?

1894






Give some examples of command terminators?

752


Explain what you understand by passing by value.

694


how do you reference the ksds vsam file formats from cobol programs

664


What is the difference between binary search and sequential search?

638


What the difference is between continue and next sentence?

653


What is the local-storage section?

681


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2093


How do you differentiate between cobol and cobol-ii?

652


What is the usage of comp fields in cobol?

656


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

710