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: 2287
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: 6970
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

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