Since you are working on performance, have you tried compiling with the 
Enterprise COBOL V4.2 compiler?  New compilers will generate code that 
uses instruction sets on new CPUs. You may get some benefit that way. Code 
can also be optimized.

pionion abovet is mine and not that of IBM.

Thank You,

Paul Strauss

Integrated Technology Delivery, Global Services, IBM
L0DB z/OS MVS/Program Products/Security 
150 Kettletown Rd.
Southbury, CT 06488
(203) 272-2758 
[email protected]



From:   Mark Pace <[email protected]>
To:     [email protected], 
Date:   07/17/2013 10:50 AM
Subject:        Re: COBOL Parser
Sent by:        IBM Mainframe Discussion List <[email protected]>



What I suggest you do is compile the program with the assembly option and
look at the code generated.

In the case that something will ALWAYS be equal or not equal, why bother 
to
test?

But going with your conditions. If you put the know condition first, then
one that satisfies the test, then yes it should perform better.



On Wed, Jul 17, 2013 at 10:29 AM, K <[email protected]> wrote:

> Dear all
>
> I would like to tune some IF THEN ELSE statements by changing operands
> positions of OR & AND statements in some of my COBOL II v3.4 programs.
>
> Can we say that if always VAR1 assigned to VALUE1 the following 
statement
> (VAR1 EQUAL 'VALUE1') OR (VAR2 EQUAL 'VALUE2)
> has better performance than
> (VAR2 EQUAL 'VALUE2) OR (VAR1 EQUAL 'VALUE1') ?
>
> In a similar way, can we say that if always VAR1 is not equal to VALUE1
> the following statement
> (VAR2 EQUAL 'VALUE2) AND (VAR1 EQUAL 'VALUE1')
> has better performance than
> (VAR1 EQUAL 'VALUE1') AND (VAR2 EQUAL 'VALUE2)  ?
>
> Kind regards
> Kostas
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>



-- 
The postings on this site are my own and don’t necessarily represent
Mainline’s positions or opinions

Mark D Pace
Senior Systems Engineer
Mainline Information Systems

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to