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
 

 

Performance impact of Unused variables in COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Performance impact of Unused variables in COBOL program
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: 1238
Location: Richfield, MN, USA

PostPosted: Fri Dec 11, 2009 12:06 pm    Post subject:
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: 401
Location: Mumbai

PostPosted: Fri Dec 11, 2009 12:33 pm    Post subject: Reply to: Performance impact of Unused variables in COBOL pr
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    Post subject:
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    Post subject: Reply to: Performance impact of Unused variables in COBOL pr
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon May 16, 2011 7:50 pm    Post subject: Reply to: Performance impact of Unused variables in COBOL pr
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: 7913
Location: Bellevue, IA

PostPosted: Mon May 16, 2011 7:52 pm    Post subject:
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    Post subject:
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: 1715
Location: UK

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

neways?
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: Tue May 17, 2011 2:23 am    Post subject:
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: 1715
Location: UK

PostPosted: Tue May 17, 2011 9:46 am    Post subject:
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

Senior Member


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

PostPosted: Tue May 17, 2011 3:13 pm    Post subject:
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    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
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
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 Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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