Move Zeroes to I
move 5 to j
perform para1 varying I from 10 by -2 until I = 0
display j.
para1.
Add 5 to j.
What’ll be the value after execution of display stmt.
A) 35
B) 40
C) 30
D) 25
please explain how?
Answers were Sorted based on User's Feedback
Answer / gayathri
The para1 will be performed only 5 times for the values of
I = 10, 8, 6, 4, and 2 respectively. Para1 can not be
executed for the value I = 0 as it uses Perform until
condition.
so the value of J is 5+(5*5) equals 30
correct answer is c) 30
Please correct me if I am wrong.
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / sudeshna majumdar
Correct answer is c) 30.
The para1 will be performed 6 times where the values of I
will be 10, 8, 6, 4, 2, and 0 respectively.
After each processing of para1, value of J will be
incremented by 5 and value of I will be decremented by 2.
Now, the para1 is called starting from I = 10 and ends when
I = 0. Thus, after 6 time para1 processing,J value will be
5*6 = 30.
| Is This Answer Correct ? | 10 Yes | 4 No |
Answer / shivakumar deshpande
Gayathri is correct ie Answer -3 is correct
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / suputhru
Gaayathri is right!!!
para1 will be performed only 5 times
J is 5+(5*5) equals 30
correct answer is c) 30
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / avi
The value of J before the Para call is 5.
Now,the loop executes for 6 times, so 5*6 is added to the
existing value of J.
J=5+(5*6)
=35.
The correct option is 35.
| Is This Answer Correct ? | 7 Yes | 12 No |
which of the following can be used as a check protection symbol a.Z b.S c.* d.+
what happens if parmparameter passes zero bytes to the program
What is rmode(any) ?
In INITIALIZE what is Repalcing Word will do
how to create temporary data set in jcl? what is the use?
3 Answers Cap Gemini, Temenos,
SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length
Scenario: I have 3 Input Files.Read the first i/p file and depending on certain business logic, I want to read wither i/p file-2 or i/p file-3.Now, depending on certain business logic applied to the record read from either file-2 or file-3, I decide to write them to either output file-2 or output file-2. Question: How many job steps are necessary to implement a solution for the above.
Hi All, Can anyone tell me how we can MOVE value of a X(19) variable to a S9(17) COMP-3 variable? Answer with an Example will be of great help.
in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 to 20 in reverse order in cobol environ ment any one please give the answer......
what are the paramater we cannot use in procedure?how many instream we can write in single jcl?can we call instream to catalog and ctalog to instream?