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 |
I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?
how do u indetify files succesfully executed or not ?
What type of SDLC u followed? Why?
01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to display the value of NAME1 in reverse order i.e value should be displayed as "GNIMMARGORP LOBOC" HOW can I do that ??? please let me know if any one knows it.
wht happens if we dnt give scope terminator ?
What are 77 levels used for?
WE HAVE 5 DIFFERENT RECORDING MODE IN COBOL.FIXED, FIXEDBLOCK, VARIABLE, VARIABLEBLOCK AND UNDEFINED. WHAT IS THE DIFFERENCE AMONG ALL AND WHICH TYPE OF FORMAT SHOULD BE USED WHEN
hie everyone.i just completed my b.tech in electronics and joined mainframes course.am i doing right course for my better future?please help me with your suggestions.ill be very thankful to you guys.
how to transfer the file from pc to mainframe??
Can we put move statement in COBOL copybook
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
can any one help -s806