Page 1 of 1

solve it

Posted: Tue Jul 04, 2006 7:03 pm
by Abhiyanta
Tell me output of following porgram.
:
:
working-storage section.
77 A PIC 9 VALUE IS 1.
:
PROCEDURE DIVISION.
EVALUATE TRUE
WHEN A = 1
DISPLAY "CASE1"
WHEN A <2
DISPLAY "CASE2"
WHEN OTHER
DISPLAY "OTHER"
END-EVALUATE.

Evaluate

Posted: Wed Jul 05, 2006 2:45 pm
by srinivas
Hi,

It displays CASE1. Once evaluate founds any match it executes the same and skips to next statement of end-evaluate.

Posted: Tue Aug 22, 2006 4:11 pm
by sadhana
Hi,

Srinivas was right.

rgds,
sadhana

what if I code like this?

Posted: Thu Sep 07, 2006 10:53 am
by arrbee
What happens if I code like this?

Code: Select all

working-storage section. 
77 A PIC 9 VALUE IS 1. 
&#58; 
PROCEDURE DIVISION. 
EVALUATE TRUE 
WHEN A <2 
DISPLAY "CASE2" 
WHEN A = 1 
DISPLAY "CASE1" 
WHEN OTHER 
DISPLAY "OTHER" 
END-EVALUATE.
which will be displayed? Is it CASE2?

Answer Please!!!

Posted: Mon Oct 30, 2006 10:44 am
by chris_alex3k
Hi arrbee,
I think srinivas is correct. As per my knowledge, the output is "case2".
Isn't it correct?

Regards,
Alex.

Posted: Sun Nov 12, 2006 7:50 pm
by abhishek.pradhan
Hi,

Alex is correct. CASE2 will be displayed utill the value of A is changed.

-Abhi

Slove it

Posted: Thu Nov 16, 2006 9:01 pm
by Kgumraj
Hello,

Cobol supports only sequential excecution.
the value contains CASE1

Posted: Thu Nov 16, 2006 9:21 pm
by dbzTHEdinosauer
Kgumraj,

The answer to Abhiyanta's question is CASE1.

The answer to arrbee's question is CASE2.
Cobol supports only sequential excecution.
that's a nice phrase, but means nothing.

Posted: Fri Sep 07, 2007 2:17 pm
by piyush
hi All,
i agree with Dick,
if there is any other answer plz let me know. :?:

Re: what if I code like this?

Posted: Tue Sep 11, 2007 1:12 pm
by manitesh_kumar
arrbee wrote:What happens if I code like this?

Code: Select all

working-storage section. 
77 A PIC 9 VALUE IS 1. 
&#58; 
PROCEDURE DIVISION. 
EVALUATE TRUE 
WHEN A <2 
DISPLAY "CASE2" 
WHEN A = 1 
DISPLAY "CASE1" 
WHEN OTHER 
DISPLAY "OTHER" 
END-EVALUATE.
which will be displayed? Is it CASE2?
once any condition for the Evaluate clause is satified the control will come out of the flow.Hence only CASE2 will be displayed.

Topic deleted by Admin

Posted: Wed Jan 27, 2016 8:15 pm
by academyindia4
<< Content deleted By Admin >>