Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need Clarification on Evaluate Statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Kamaleshwaran

New User


Joined: 10 Apr 2010
Posts: 7
Location: Hyderabad

PostPosted: Thu Apr 22, 2010 6:03 pm    Post subject: Need Clarification on Evaluate Statement
Reply with quote

I Have a variable 01 Check Pic X(1). The variable Check can have values from A to Z. I need to move value 1 to output variable if check = A, C, E and 2 to output variable if check = B, D, F.

I tried this by following code. But its not working.

Code:
Evaluate Check
When 'A' 'C' 'E'
    Move 1 to output
When 'B' 'D' 'F'
    Move 2 to output
When others
    Move 0 to output
End-evaluate.

Please help me in this...
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Thu Apr 22, 2010 6:10 pm    Post subject:
Reply with quote

I guess the obvious question at this point is:

What is it doing?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Apr 22, 2010 6:11 pm    Post subject:
Reply with quote

Code:

Evaluate Check
  When 'A'
  When 'C'
  When 'E'
     Move 1 to output
  When 'B'
  When 'D'
  When 'F'
    Move 2 to output
  When other
    Move 0 to output
End-evaluate.


Evaluate in Cobol Reference
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Apr 22, 2010 7:45 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

When someone asks for informatoin, you need to provide it.

When someone posts a solution, you need to acknowledge this. Either thank them for the solution or explain why you have a problem with the solution. . .

"Grab and go" is just bad manners. . . icon_sad.gif
Back to top
View user's profile Send private message
Kamaleshwaran

New User


Joined: 10 Apr 2010
Posts: 7
Location: Hyderabad

PostPosted: Fri Apr 23, 2010 11:34 am    Post subject:
Reply with quote

Hi all,
Sorry for the late response. Today i tried the logic. Its working fine.
Thanks for your help. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us