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 |
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250
what is level 66 means??
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this
how to fetch the record before the last record in a cobol file( its a huge file and if the key field is not known)
In the JCL, how do you define the files referred to in a subroutine ?
What are the cobol coding sheets?
I have a sequential file. How do I access a record in this sequential file randomly in my program ?
IF there 5 to 6 files in a JCL and there is some space abends, how can we identify which file has space abend and what can be done to get off that abend or rectify that abend.
how many bytes do SPPPP999 will store?
How many divisions we have in Cobol ?
Write some characteristics of cobol as means of business language.