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

Can you tell me which is more efficient in easytrieve.


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prash_infy

New User


Joined: 31 Aug 2006
Posts: 20

PostPosted: Mon Jun 14, 2010 8:42 pm
Reply with quote

Want to know which is more efficient in performance and why.

Code:
IF WS-VAR1 = 'A'
    GOTO PROCESS
END-IF
*
IF WS-VAR2 > 0
    GOTO PROCESS
END-IF



OR

Code:
IF WS-VAR1 = 'A' OR WS-VAR2 > 0
    GOTO PROCESS
END-IF
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 14, 2010 9:12 pm
Reply with quote

Hello,

One way to be more efficient is to make sure that the condition most likely to be true is specified first. . .

You could also run some timing tests but you would need to have a few million records . . .
Back to top
View user's profile Send private message
prash_infy

New User


Joined: 31 Aug 2006
Posts: 20

PostPosted: Mon Jun 14, 2010 9:19 pm
Reply with quote

Thanks d.sch

Of the two codes mentioned above, which one do you think is more efficient?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 14, 2010 9:24 pm
Reply with quote

Hello,

As i mentioned, the one that looks at the value most likely to be true first will be more efficient.

Either format will probably run about the same, so you want to eliminate as many "false" tests as possible to reduce the amount of internal processing.

The only way you can see this is to run some very large tests. A small test will show very little or no difference.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jun 14, 2010 10:00 pm
Reply with quote

prash_infy,

what Dick is trying to get you to do is
consider the impact of
IF WS-VAR2 > 0 or WS-VAR1 = 'A'
versus
IF WS-VAR1 = 'A' or WS-VAR2 > 0

are there more WS-VAR2 situations
than WS-VAR1?

the first condition, if true, will cause immediate transfer
otherwise
the second condition is checked.

So if you need to determine if there is statistically
(based on analysis of input data)
a higher chance of one over the other occuring;
the statistically higher should be coded first.
This is also referred to as fast track.
Back to top
View user's profile Send private message
prash_infy

New User


Joined: 31 Aug 2006
Posts: 20

PostPosted: Mon Jun 14, 2010 10:12 pm
Reply with quote

Thanks Mr Brenholtz!!!!
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Count the number of characters in a f... CA Products 1
No new posts File matching functionality in Easytr... DFSORT/ICETOOL 14
No new posts Easytrieve EZABX007 with error code 0... CA Products 7
No new posts How efficient are you, while working ... General Talk & Fun Stuff 0
No new posts SMS:- Efficient filter lists in ACS All Other Mainframe Topics 7
Search our Forums:

Back to Top