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 we delete unused cobol code in a program automatically?

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

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Thu Aug 02, 2007 4:17 pm    Post subject: Can we delete unused cobol code in a program automatically?
Reply with quote

Is there any tools or compiler options to delete unused code and never called procedures in COBOL programs.

I mean I just want to cut the branch of a tree, and the clean-up of all sub-branches should be done automatically.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 02, 2007 4:23 pm    Post subject:
Reply with quote

Automatically? I don't think so......
I do know that code that is not referenced or considered unreachable by the optimizer is not compiled......
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Thu Aug 02, 2007 4:36 pm    Post subject: Re: Can we delete unused cobol code in a program automatical
Reply with quote

thank You..

Actually, I wanted it to be removed from source code. Anyway, does compiler listing displays unreachable code?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Aug 02, 2007 4:48 pm    Post subject: Re: Can we delete unused cobol code in a program automatical
Reply with quote

rkprasanth_m wrote:
Actually, I wanted it to be removed from source code.
Yes, I understood that.....
Quote:
Anyway, does compiler listing displays unreachable code?
I (vaguely) recall seeing I-type error messages, you could try a little test program and see if you can generate some....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Aug 02, 2007 4:59 pm    Post subject:
Reply with quote

You can always check the cross reference listing of the compile step. If a paragraph is not referenced.

But then you have to deal with PERFORM THRU's and fall-thrus (from poor code).

suggest that before removing, you comment-out the code with comments as to why you are removing the code.
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 DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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