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

Performance impact of Unused variables in COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
S0C7

New User


Joined: 19 May 2006
Posts: 26

PostPosted: Fri Dec 11, 2009 12:00 pm
Reply with quote

Hi,

I've just started working in a new project. There seems to be many programs which have unused variables declared in working storage but not getting used anywhere in the program.

Can anyone throw some light on the run-time performance impact because of unused variables that have been defined in working storage? Since the program will occupy extra memory space while running, there has to be some performance impact on the mainframe system.

I know the frequency with which these programs run, I just need to know if there is a field, say PIC X(10), then what is the performance impact for a single run?

I just need to know if correcting these programs is actually worth the effort? icon_wink.gif I am guessing it's not.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


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

PostPosted: Fri Dec 11, 2009 12:06 pm
Reply with quote

I doubt you'll notice any run time performance difference at all, but your load module is obviously larger than it needs to be. For the sake of cleaning things up, I'd opt to remove the unreferenced fields. Make sure they really are unreferenced though.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Dec 11, 2009 12:33 pm
Reply with quote

Unless there are so many unused variables and they are so large that it causes variables to span pages and cause paging, you won't notice any difference at all. Even the load lib may be the same size since all that will change is the size of a getmain. Clean them up to help maintainability but forget performance on this one. You might save a base register and have optimization change but it will be minimal and not worth the effort. It probably took longer to ask the question than the amount of runtime you'll save over the life of the program.
Back to top
View user's profile Send private message
belchoff

New User


Joined: 21 Oct 2009
Posts: 4
Location: UK

PostPosted: Fri Dec 11, 2009 5:43 pm
Reply with quote

Initializing can take some toll, especially if there are lot of variables not to mention for unused variables. Cleaning them up can help improve readability.
Back to top
View user's profile Send private message
rehan

New User


Joined: 13 May 2007
Posts: 6
Location: India

PostPosted: Mon May 16, 2011 7:43 pm
Reply with quote

Just to add to this say my system has somewhere around 2000 modules and each module has 65 bytes of unused space[X(65)] does that count to billing from IBM?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon May 16, 2011 7:50 pm
Reply with quote

If you compile with the OPTIMIZE(FULL) option, all the unused variables will be noted in the listing.

It's then just a matter of removing them from the source....

Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon May 16, 2011 7:52 pm
Reply with quote

You should have started a new topic rather than tagging onto the end of one inacitve for a year and a half.

Does your billing from IBM include used storage? If so, then those bytes would count. However, since IBM billing is usually based on system capacity (as measured by MSU overall, 4-hour rolling MSU usage, or whatever your site is contracted for), the answer most likely will be that extra bytes of memory has ZERO impact on vendor billing.
Back to top
View user's profile Send private message
rehan

New User


Joined: 13 May 2007
Posts: 6
Location: India

PostPosted: Mon May 16, 2011 8:00 pm
Reply with quote

Thanks bill and rob for the guidance and ya i should have started a new topic but was looking for this on forum and found relevant ... neways will consider it next time icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon May 16, 2011 11:15 pm
Reply with quote

neways?
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: Tue May 17, 2011 2:23 am
Reply with quote

Hi Nic,

From the "chat-speak" or texting . . . =Any Ways
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue May 17, 2011 9:46 am
Reply with quote

I know that, Dick (nice to see you back!) I worked it out but for the sake of 1 letter.....And we are constantly saying we do not like "chat-speak" language. It was just a hint to the OP (took me a few minutes to work out what OP was when I first came across it and even longer for TS!)
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 17, 2011 3:13 pm
Reply with quote

rehan wrote:
Thanks bill and rob

1. Robert is elder to me.
2. He is a Senior System Programmer.
3. I look up to Him and read His answers carefully.
4. I've met Him personally and He is over 6'3" tall.
5. His experience, alone, in to zOS is much more than my own. I've not yet included the experience of Bill yet.
.
.
.
SPELL His name correctly!
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top