PERFORM ACCUMULATE-TOTALS
VARYING A FROM 1 BY 2 UNTIL A >2
AFTER B FROM1 BY 1 UNTIL B>2
AFTER C FROM 2 BY -1 UNTIL C<2
How many times the paragraph ACCUMULATE-TOTALS would be
exicuted?
Answers were Sorted based on User's Feedback
Answer / shakilaashwin
PERFORM ACCUMULATE-TOTALS
VARYING A FROM 1 BY 2 UNTIL A >2
AFTER B FROM 1 BY 1 UNTIL B>2
AFTER C FROM 2 BY -1 UNTIL C<2.
ACCUMULATE-TOTALS.
ADD 1 TO ACCUMULATE-CNT.
DISPLAY 'A - ' , A.
DISPLAY 'B - ' , B.
DISPLAY 'C - ' , C.
Ans is 2 - The loop will be executed until all the condition
(A > 2, B > 2, C < 2) becomes True.
Execution : 1 Condition is
A - 1 True
B - 1 True
C - 2 False
Execution : 2
A - 1 False
B - 2 True
C - 2 False
When going for 3rd execution - No condition Will be True
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / shan
looping happens for following values of
A, B, C
1, 1, 2 = 1st
1, 2, 2 = 2nd
2, 1, 2 = 3rd
2, 2, 2 = 4th
So totally four times this will get executed
| Is This Answer Correct ? | 2 Yes | 3 No |
have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..
what is the difference between start and startbr?
What is EIBCALEN? Why it is used?
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
Write a program to explain size error.
what is the use of outrecord?
for an INITIALIZE and what keyword allows for an override of the default.
How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not using JCL)
01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??
What are differences between Static Call and Dynamic Call?
10 Answers IBM, KBC, Keane India Ltd, Verizon,
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
how do you reference the variable block file formats from cobol programs