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

EVALUATE going in wrong WHEN condition


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Mon May 03, 2010 6:40 pm
Reply with quote

hi there,
i ran the comparison 4 times.
each time runs a pair of jobs.
job 1 has the poster original evaluate.
job 2 has the avaluate you suggested.

1st comparison:
original:
Code:
 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .87       .00    2.0           435  BATCH        0     0     0     0     
0000 - TIME=09.42.56                                                             
      TOTAL TCB CPU TIME=      .87 TOTAL ELAPSED TIME=   2.0                     

suggested:
Code:
 
 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .86       .00    2.0           440  BATCH        0     0     0     0     
0000 - TIME=09.43.02                                                             
      TOTAL TCB CPU TIME=      .86 TOTAL ELAPSED TIME=   2.0                     


2nd comparison:

original:
Code:
                                                                                 
         --TIMINGS (MINS.)--            -----PAGING COUNTS----                   
    TCB    SRB  CLOCK   SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS                   
 224.17    .00    1.0  1343K  BATCH        0     0     0     0                   
0000 - TIME=09.45.18                                                             
      TOTAL TCB CPU TIME=    .87 TOTAL ELAPSED TIME=   1.0                       

suggested:
Code:
 
         --TIMINGS (MINS.)--            -----PAGING COUNTS----                   
    TCB    SRB  CLOCK   SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS                   
 221.95    .00    1.0  1330K  BATCH        0     0     0     0                   
0000 - TIME=09.45.14                                                             
      TOTAL TCB CPU TIME=    .86 TOTAL ELAPSED TIME=   1.0                       


3rd comparison:

original:
Code:
                                                                                 
                                                                                 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .87       .00    2.0           384  BATCH        0     0     0     0     
0000 - TIME=09.49.47                                                             
      TOTAL TCB CPU TIME=      .87 TOTAL ELAPSED TIME=   2.0                     

suggested:
Code:
 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .86       .00    2.1           383  BATCH        0     0     0     0     
0000 - TIME=09.49.58                                                             
      TOTAL TCB CPU TIME=      .86 TOTAL ELAPSED TIME=   2.1                     



4th comparison:
original:
Code:
                                                                                 
                                                                                 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .87       .00    1.5           403  BATCH        0     0     0     0     
0000 - TIME=09.54.35                                                             
      TOTAL TCB CPU TIME=      .87 TOTAL ELAPSED TIME=   1.5                     
                           

suggested:
Code:
 
 -----TIMINGS (MINS.)------                          -----PAGING COUNTS----     
       TCB       SRB  CLOCK          SERV  WORKLOAD  PAGE  SWAP   VIO SWAPS     
       .86       .00    1.5           410  BATCH        0     0     0     0     
0000 - TIME=09.54.34                                                             
      TOTAL TCB CPU TIME=      .86 TOTAL ELAPSED TIME=   1.5                     




the result is the same, except for comparison 3. it may be due to the machine load situation at the moment of the execution.
each evaluate is tested 900 million times and the jobs ran at the same time to ensure they were under the same conditions.

the program:
Code:
                                                                                 
> APPLID(ROS0P03)    USER(HB1,E817252)                                           
> LIB(HB1.EVTPTST0)   SCRL CSR  COLS 00001 00072                   LINE 000062   
>      <...+....1....+....2....+....3....+....4....+....5....+....6....+....7.. 
000062 000790 PROCEDURE DIVISION USING LK-PARM.                                 
000063            DISPLAY 'PARM=' LK-PARM                                       
000064                                                                           
000065            PERFORM AAA LK-TIMES TIMES.                                   
000066                                                                           
000067            MOVE 'X' TO A                                                 
000068            PERFORM AAA LK-TIMES TIMES.                                   
000069                                                                           
000070            MOVE ' ' TO A                                                 
000071            MOVE 'X' TO B                                                 
000072            PERFORM AAA LK-TIMES TIMES.                                   
000073                                                                           
000074            STOP RUN.                                                     
000075                                                                           
000076                                                                           
000077                                                                           
000078        AAA.                                                               
000079            IF LK-OPC = 1                                                 
000080               EVALUATE TRUE ALSO TRUE ALSO TRUE                           
000081               WHEN A= SPACE      ALSO B = SPACE     ALSO C = SPACE       
000082                    MOVE 1 TO W-RESULT                                     
000083               WHEN A NOT = SPACE ALSO B = SPACE     ALSO C = SPACE       
000084                    MOVE 2 TO W-RESULT                                     
000085               WHEN A = SPACE     ALSO B NOT = SPACE ALSO C = SPACE       
000086                    MOVE 3 TO W-RESULT                                     
000087               END-EVALUATE                                               
000088            ELSE                                                           
000089               EVALUATE A = SPACE ALSO B = SPACE ALSO C = SPACE           
000092                 WHEN TRUE ALSO TRUE ALSO TRUE                             
000093                      MOVE 1        TO W-RESULT                           
000094                 WHEN FALSE ALSO TRUE ALSO TRUE                           
000095                      MOVE 2        TO W-RESULT                           
000096                 WHEN TRUE ALSO FALSE ALSO TRUE                           
000097                      MOVE 3        TO W-RESULT                           
000098                 WHEN OTHER                                               
000099                      MOVE 4        TO W-RESULT                           
000100               END-EVALUATE         
000101 *******       EVALUATE TRUE                                             
000102 *******       WHEN A= SPACE      AND  B = SPACE     AND  C = SPACE       
000103 *******            MOVE 1 TO W-RESULT                                   
000104 *******       WHEN A NOT = SPACE AND  B = SPACE     AND  C = SPACE       
000105 *******            MOVE 2 TO W-RESULT                                   
000106 *******       WHEN A = SPACE     AND  B NOT = SPACE AND  C = SPACE       
000107 *******            MOVE 3 TO W-RESULT                                   
000108 *******       END-EVALUATE                                               
000109            END-IF.                                           
SPACE       


Thanks.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Mon May 03, 2010 7:46 pm
Reply with quote

Thanks jctgf for your effort,

I think the only conclusion for this is: What form of evaluate statement you use is not significant to processing time and resources.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
Search our Forums:

Back to Top