perform I from 0 by 1 until I=5?How maney times it will
executes

Answers were Sorted based on User's Feedback



perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / varun v

I agree with Answr #3 and Answer # 3 is correct..

PERFORM I FROM 0 BY 1 UNTIL I=5
........................
........................

END-PERFORM.

would give syntax error.
************************************************************
Correct one is given as below...

PERFORM varying i from 0 by 1 until i = 5
.............
.............
END-PERFORM.

and this should get executed 5 times....

Is This Answer Correct ?    6 Yes 1 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / tiny,roshini,divya

Syntax error in inline perform.

PERFORM varying i from 0 by 1 until i = 5
.............
.............
END-PERFORM.
There is no 'varying ' with perform in the question.

Is This Answer Correct ?    4 Yes 1 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / satya

In this PERFORM loop, I is subscript. Minimum value for the
subscript is 1. As the subscript starting value is zero in
this loop, the program will not compile successfully. It
will show compilation error.

Is This Answer Correct ?    3 Yes 1 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / pradeep

IT WILL EXECUTE 5 TIMES

COBOL CODE:
IDENTIFICATION
DIVISION.
PROGRAM-ID.
MOVEPGM.
DATA
DIVISION.
WORKING-STORAGE
SECTION.
01 WS-I PIC 9
(2).
PROCEDURE
DIVISION.
A1000-MAIN-
PARA.
PERFORM PARA-X VARYING WS-I FROM 0 BY 1 UNTIL WS-
I=5
STOP
RUN.
PARA-
X.
DISPLAY "TEST2".


OUTPUT:

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

Is This Answer Correct ?    2 Yes 0 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / ananta

it will not excute because perform is not start from 0.

Is This Answer Correct ?    1 Yes 0 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / amit tomer

Infinite Times

Is This Answer Correct ?    2 Yes 2 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / guest

it will execute 5 times

Is This Answer Correct ?    3 Yes 3 No

perform I from 0 by 1 until I=5?How maney times it will executes..

Answer / vineet

your syntax is wrong

varun is right here and it will execute 5 times.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More COBOL Interview Questions

what is difference between cobol and cobol/400

1 Answers   HCL,


What is perform what is varying?

0 Answers  


what is ASRA, AEY9?

2 Answers   IBM,


How do you get the data to code the BMS macro?

0 Answers   IBM,


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,






What is the Purpose of POINTER Phrase in STRING command in COBOL?

0 Answers   Winsol Solutions,


If we use GO BACK instead of STOP RUN in cobol?

1 Answers   Temenos,


) How do u handle errors in BMS macro

0 Answers   IBM,


consider the following FD FILE-1 01 REC-1 PIC X(80) ...... WORKING-STORAGE SECTION 01 W-REC PIC X(90) ........ PROCEDURE DIVISION FIRST-PARA ....... READ FILE-1 INTO W-REC AT END MOVE 1 TO EOF-FLAG which of the following is true with respect to the above? a.REC-1 will contain nothing and W-REC will contain the contains of the record read b.REC-1 and W-REC contain the same data c.syntex is invalid and error will occur d.REC-1 and W-REC must be of same size

1 Answers   TCS,


The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

0 Answers  


what will happen if pass values more than 100 using PARM parameter?

1 Answers  


Categories