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 find How Many Lines in Sysin DD * Parameter Thru Cobol Coding? If any one knows the Answer Please Reply .....Thanks From Shree
What are the differences between OS VS COBOL and VS COBOL II?
how do you reference the variable block file formats from cobol programs
There is a variable with value 19446. Requirement is to convert it to 194.46. I tried it by doing divide by 100 and my receiving field data type is 9(03)v99. But the output is 194. I am not getting the decimal value. Could anyone pls let me know how to get this done?
SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.
where do u use low-value and high value in cobol
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
What is Static and Dynamic linking ?
Consider the following: 77 A PIC 9(10) 77 B PIC 9(10) 77 C PIC 9(19) MULTIPLY AB BY B GIVING C Which of the following is true ? (a) The execution of the above may result in size error. (b) The execution of the above will result in size error. (c) The definition of C is invalid resulting in compilation error. (d) No error will be thee and the program would proceed correctly.
what is the purpose of linkage section?
Why we should use cursor ?
what is meaning by design document? who can repared for this?