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

Multiple "EVALUATE" objects were not separated by


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Thu Mar 26, 2009 1:32 pm
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

Superior Member


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

PostPosted: Thu Mar 26, 2009 2:01 pm
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
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

Superior Member


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

PostPosted: Thu Mar 26, 2009 4:13 pm
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
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: 6966
Location: porcelain throne

PostPosted: Thu Mar 26, 2009 4:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top