perform I from 0 by 1 until I=5?How maney times it will
executes
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / ananta
it will not excute because perform is not start from 0.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vineet
your syntax is wrong
varun is right here and it will execute 5 times.
Is This Answer Correct ? | 1 Yes | 1 No |
what is difference between cobol and cobol/400
What is perform what is varying?
what is ASRA, AEY9?
How do you get the data to code the BMS macro?
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?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
If we use GO BACK instead of STOP RUN in cobol?
) How do u handle errors in BMS macro
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
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
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
what will happen if pass values more than 100 using PARM parameter?