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 |
What is rmode(any) ?
What is normalisation?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
01 a pic x(6) value is abcdef 01 b pic x(3) move a to b wht will be the value in b ?
01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i need to get the miuns sign in the result?
How do we get current date from system with century in COBOL?
can we use full outer join with cursors declared in cobol program?
What is the meaning of 'Eject' verb in cobol?
how do you reference the variable block file formats from cobol programs
consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move
Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.
Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.