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
 

 

Can you tell me which is more efficient in easytrieve.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Can you tell me which is more efficient in easytrieve.
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

Site Director


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

PostPosted: Mon Jun 14, 2010 9:12 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Jun 14, 2010 9:24 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Mon Jun 14, 2010 10:00 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am


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