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

Way to remove unused variables from a program


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

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Tue Sep 23, 2008 3:23 pm
Reply with quote

Hi all,

Do you know a way to remove unused variables from a cobol source pgm automaticlly ?

Thank's in advance !

Xeno.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Tue Sep 23, 2008 3:37 pm
Reply with quote

You can find the unused variables from the compiler listing and think about removing those from the cobol program but I have a feeling that this may not solve your purpose. Tell us what is exact business requirement, then we may be able to offer better solution.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Tue Sep 23, 2008 3:46 pm
Reply with quote

I doubt if there is any automated tool/method to remove unused variables.

But there is a section in compile listing, where usage of variables is displayed.

it looks as below in my shop

Code:


PP 5655-G53 IBM Enterprise COBOL for z/OS  3.4.1 OMA           TESTPGM   Date 09/23/2008  Time 11:11:15   Page     4
An "M" preceding a data-name reference indicates that the data-name is modified by this reference.                 
                                                                                                                   
 Defined   Cross-reference of data names   References                                                               
                                                                                                                   
      18   LOLLOL                                                                                                   
      19   PDVAL. . . . . . . . . . . . .  20 26                                                                   
      21   PDVALUE. . . . . . . . . . . .  M25 27                                                                   
      20   PDVALX                                                                                                   



You can identify the unused variables using this listing and remove them. However this is not accurate when you use redefines.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 23, 2008 4:23 pm
Reply with quote

or if you delete a group item (that is not referenced) that contains an elementary item that is.
Back to top
View user's profile Send private message
xenomorph

New User


Joined: 27 Jul 2007
Posts: 9
Location: Europe

PostPosted: Tue Sep 23, 2008 11:47 pm
Reply with quote

Thank you all for your comments.

@agkshirsagar : it's not a request from the business but more a code tuning.
It appears that one of our shared copybook that was supposed to be stable
is not and the dev. team decided to remove it from all sources in order to
facilitate the application management.

@hchinnam : it involves a lot of sources but that's a way.

@dbzTHEdinosauer : okay.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Sep 24, 2008 12:31 am
Reply with quote

Hi,

You might like to check these links..

www.ibmmainframes.com/viewtopic.php?t=25745&highlight=unused
www.ibmmainframes.com/viewtopic.php?t=23268&highlight=unused
www.ibmmainframes.com/viewtopic.php?t=20057&highlight=unused
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 Using API Gateway from CICS program CICS 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top