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
 

 

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: 2276
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: 6967
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


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