solve it
Moderators: dbzTHEdinosauer, Moderator Group
solve it
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.
:
:
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.
what if I code like this?
What happens if I code like this?
which will be displayed? Is it CASE2?
Code: Select all
working-storage section.
77 A PIC 9 VALUE IS 1.
:
PROCEDURE DIVISION.
EVALUATE TRUE
WHEN A <2
DISPLAY "CASE2"
WHEN A = 1
DISPLAY "CASE1"
WHEN OTHER
DISPLAY "OTHER"
END-EVALUATE.
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-
- Member
- Posts: 3
- Joined: Mon Jun 19, 2006 5:23 pm
Answer Please!!!
Hi arrbee,
I think srinivas is correct. As per my knowledge, the output is "case2".
Isn't it correct?
Regards,
Alex.
I think srinivas is correct. As per my knowledge, the output is "case2".
Isn't it correct?
Regards,
Alex.
-
- Member
- Posts: 11
- Joined: Wed Nov 08, 2006 4:57 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-
- Member
- Posts: 1
- Joined: Tue Apr 10, 2007 4:10 pm
- Location: Pune
Re: what if I code like this?
once any condition for the Evaluate clause is satified the control will come out of the flow.Hence only CASE2 will be displayed.arrbee wrote:What happens if I code like this?
which will be displayed? Is it CASE2?Code: Select all
working-storage section. 77 A PIC 9 VALUE IS 1. : PROCEDURE DIVISION. EVALUATE TRUE WHEN A <2 DISPLAY "CASE2" WHEN A = 1 DISPLAY "CASE1" WHEN OTHER DISPLAY "OTHER" END-EVALUATE.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page