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
 
Multiple "EVALUATE" objects were not separated by

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

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Mar 26, 2009 1:13 pm    Post subject: Multiple "EVALUATE" objects were not separated by
Reply with quote

Hi All,

I am using the following piece of code:

Code:

IF (WS-TEMP1 <= WS-ACCT-LEN)                             
      MOVE INP-OLD-ACCT-NUM(WS-ACCT-LEN:1) TO WS-ACCT-NUM
      MOVE WS-ACCT-NUM  TO  WS-SWITCHES                 
      DISPLAY 'ACCOUNT LENGTH: ' WS-ACCT-LEN             
      DISPLAY 'ACCOUNT NUMBER: ' WS-ACCT-NUM             
                                                         
      DIVIDE WS-TEMP2 BY 2 GIVING WS-TEMP3               
                        REMAINDER WS-TEMP4               
                                                         
      IF (WS-TEMP4 = 0)                                 
         DISPLAY 'J%2 IS EQUAL TO ZERO'                 
                                                         
         EVALUATE TRUE                                   
             WHEN WS-NUM-ZERO                           
                  WS-TOTAL-SUM = WS-TOTAL-SUM + 0       
                  DISPLAY 'SUM = 0: ' WS-TOTAL-SUM       
                                                         
             WHEN WS-NUM-ONE                             
                  WS-TOTAL-SUM = WS-TOTAL-SUM + 2       
                  DISPLAY 'SUM= 1: ' WS-TOTAL-SUM       
         END-EVALUATE 
     


However,

I am getting a compilation error stating that Multiple "Evaluate" objects not seperated by "ALSO".

I have defined WS-NUM-ZERO as a conditional parameter.

Even if I use the following piece of code, still I get the same error:

Code:


         EVALUATE WS-ACCT-NUM                                   
             WHEN 0
                  WS-TOTAL-SUM = WS-TOTAL-SUM + 0       
                  DISPLAY 'SUM = 0: ' WS-TOTAL-SUM       
                                                         
             WHEN 1
                  WS-TOTAL-SUM = WS-TOTAL-SUM + 2       
                  DISPLAY 'SUM= 1: ' WS-TOTAL-SUM       
         END-EVALUATE 


Please let me know where I am going wrong.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Thu Mar 26, 2009 1:32 pm    Post subject:
Reply with quote

Quote:
COMPUTE WS-TOTAL-SUM = WS-TOTAL-SUM + 0
Dont you need a COMPUTE statement?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Mar 26, 2009 2:01 pm    Post subject:
Reply with quote

Hi Arun,

I believe you hit on the nail - but why one would like to add zero to some variable . . . icon_rolleyes.gif
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Mar 26, 2009 2:43 pm    Post subject:
Reply with quote

Hi,

Its a part of the logic that we are to use for the Luhn Algol...

Thanks for your solution.

On previous statements when we omitted the COMPUTE part, it was working fine.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Mar 26, 2009 4:13 pm    Post subject:
Reply with quote

swapnadeep.ganguly wrote:
On previous statements when we omitted the COMPUTE part, it was working fine.
Sure? please post that code . . .
Back to top
View user's profile Send private message
swapnadeep.ganguly

Active User


Joined: 21 Mar 2007
Posts: 203
Location: India

PostPosted: Thu Mar 26, 2009 4:36 pm    Post subject:
Reply with quote

Please be informed that the piece of code was not under any evaluate statement.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Mar 26, 2009 4:48 pm    Post subject:
Reply with quote

my, my, my, the things we learn. COMPUTE can be written implicitly.
Quote:
Please be informed that the piece of code was not under any evaluate statement

please be informed that such BS does not cause anyone to want to help.
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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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