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
 

 

Which method is faster PERFORM Loop or FUNCTION REVERSE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Tue Feb 17, 2009 5:33 pm    Post subject: PERFORM Loop or FUNCTION REVERSE
Reply with quote

Which method is faster PERFORM Loop or FUNCTION REVERSE ?
Back to top
View user's profile Send private message

ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Tue Feb 17, 2009 9:41 pm    Post subject:
Reply with quote

surely FUNCTION REVERSE..but there could be exceptions depending on the kind of data
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Feb 17, 2009 9:58 pm    Post subject: Reply to: Which method is faster PERFORM Loop or FUNCTION RE
Reply with quote

I'm not thoroughly convinced that some of these FUNCTIONS are quicker than the old fashioned method.

However, in this day and age, with the speed of these machines, this difference in speed is probably immeasurable and "Fast" is diluted to a relative term.

What's more important is ease of maintenance and perhaps, other folks will gravitate towards the FUNCTIONS rather than a manual method.

If we were on a 360/20, then I'd say do it manually. icon_wink.gif

Regards,
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Tue Feb 17, 2009 10:43 pm    Post subject:
Reply with quote

yes sir...could be..
just would like to share a thing...it makes much of a difference when u do the same thing for lets say 50 million records.

There is performance difference in the following:

MOVE 0 to WS-VAR-NAME.
MOVE ZERO TO WS-VAR_NAME.(faster for huge volume of data)
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: Wed Feb 18, 2009 12:46 am    Post subject:
Reply with quote

Hello,

It would surely be educational to look at the generated assembler for these 2 moves. . .

You might see different code generated depending on the size and data type of ws-var-name also. . .
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1239
Location: Richfield, MN, USA

PostPosted: Wed Feb 18, 2009 8:33 am    Post subject:
Reply with quote

Completely agree with Bill. My understanding of FUNCTIONs is that most, if not all, of them call LE subroutines and are probably more cpu intensive. But since cpus have become so fast, efficiency has taken a back seat to readability (maintainability) and rightfully so. In the situation where the function is to be performed millions of times, a simple benchmark test might be in order.
Back to top
View user's profile Send private message
ykishor
Currently Banned

New User


Joined: 11 Aug 2007
Posts: 24
Location: my pc

PostPosted: Wed Feb 18, 2009 2:01 pm    Post subject:
Reply with quote

Quote:
efficiency has taken a back seat to readability (maintainability) and rightfully so


This view is shared by a lot of people..including my bosses!!!!.....but I agree only partially...

I would try to do a job using a complicated ICETOOL/SAS(much faster) rather than a COBOL program(heavy in terms of I/O and elapsed time)...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Feb 18, 2009 5:40 pm    Post subject:
Reply with quote

Quote:
I would try to do a job using a complicated ICETOOL/SAS(much faster) rather than a COBOL program(heavy in terms of I/O and elapsed time)...
This all depends -- some years back I had a SAS program that took a week or so to develop converted to COBOL for production reasons. The SAS job took twice as much I/O and about four times as much CPU time to run as the COBOL program, which makes sense since SAS has to create the program data vector, and it writes a lot of data to the WORK file and reads it back in when requested. On the other hand, the COBOL program took more than 2 months to develop versus the one week for the SAS program.

For quick and dirty, or ad hoc reports, I use SAS. When there's massive amounts of data to process (millions of records) every day / week / month (i.e., a production situation), I use COBOL because the savings over time pay for the additional cost of development.
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
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am


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