Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 967
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: 6970
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 COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us