IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need Clarification on Evaluate Statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Senior Member


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

PostPosted: Thu Apr 22, 2010 6:10 pm
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: 6966
Location: porcelain throne

PostPosted: Thu Apr 22, 2010 6:11 pm
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

Moderator Emeritus


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

PostPosted: Thu Apr 22, 2010 7:45 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
Search our Forums:

Back to Top